You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm unable to build a project with Rocket when using a custom JSON target spec.
Rocket version
0.4.6
Operating system
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
What is expected
A successful build.
What actually happens
$ cargo build -Z build-std --target x86_64-custom-linux-gnu.json
...
error[E0107]: wrong number of type arguments: expected 3, found 2
--> /home/yungkneez/.cargo/registry/src/garden.eu.org-1ecc6299db9ec823/rocket_http-0.4.6/src/header.rs:124:14
|
124 | headers: IndexMap<Uncased<'h>, Vec<Cow<'h, str>>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 type arguments
error: aborting due to previous error
For more information about this error, try `rustc --explain E0107`.
error: could not compile `rocket_http`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
Steps to reproduce (with nightly)
cargo new rocket-custom-target && cd rocket-custom-target
[package]
name = "rocket-custom-target"
version = "0.1.0"
authors = ["yungkneez"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rocket = "0.4.6"
src/main.rs
#![feature(decl_macro)]
#[macro_use] extern crate rocket;
#[get("/<name>/<age>")]
fn hello(name: String, age: u8) -> String {
format!("Hello, {} year old named {}!", age, name)
}
fn main() {
let _r = rocket::ignite().mount("/hello", routes![hello]);
}
indexmap (a dependency in rocket_http) uses autocfg to determine if std is available. If autocfg cannot find std, S = RandomState is not provided by default. See indexmap-rs/indexmap#145.
To support custom targets for which std is available, we can enable the std feature for indexmap.
The text was updated successfully, but these errors were encountered:
indexmap (a dependency in rocket_http) uses autocfg to determine if std is available. If autocfg cannot find std, S = RandomState is not provided by default. See indexmap-rs/indexmap#145.
I'm a bit confused by this situation. autocfg's detection checks whether or not extern crate std; compiles. Since you ran cargo build -Z build-std, it seems like that should work and std should be detected? It sounds like there may be a bug or mismatch between what autocfg is detecting and how std is actually looked up that's worth reporting somewhere, but build-std is of course still unstable.
To support custom targets for which std is available, we can enable the std feature for indexmap.
Other issues aside, this approach seems fine since rocket_http does depend on IndexMap only needing two type arguments.
I'm unable to build a project with Rocket when using a custom JSON target spec.
Rocket version
0.4.6
Operating system
What is expected
A successful build.
What actually happens
Steps to reproduce (with nightly)
cargo new rocket-custom-target && cd rocket-custom-target
rustc -Z unstable-options --print target-spec-json --target x86_64-unknown-linux-gnu > x86_64-custom-linux-gnu.json
Cargo.toml
src/main.rs
cargo build -Z build-std --target x86_64-custom-linux-gnu.json
What is happening
indexmap (a dependency in rocket_http) uses autocfg to determine if std is available. If autocfg cannot find std,
S = RandomState
is not provided by default. See indexmap-rs/indexmap#145.To support custom targets for which std is available, we can enable the
std
feature for indexmap.The text was updated successfully, but these errors were encountered: