Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling rocket_http v0.4.7 fails with E0107 #1548

Closed
573 opened this issue Feb 23, 2021 · 5 comments
Closed

Compiling rocket_http v0.4.7 fails with E0107 #1548

573 opened this issue Feb 23, 2021 · 5 comments
Assignees
Labels
upstream An unresolvable issue: an upstream dependency bug

Comments

@573
Copy link

573 commented Feb 23, 2021

Bug report

  1. The version of Rocket you're using. Ensure it's the latest, if possible.
    0.4.7

  2. The operating system (distribution and version) where the issue occurs.

Linux u 4.4.0-19041-Microsoft #488-Microsoft Mon Sep 01 13:43:00 PST 2020 x86_64 GNU/Linux

  1. A brief description of the bug that includes:
    * The nature of the bug.
    It occurs while building (cargo) a project using rocket_http
    * When the bug occurs.
    running cargo build on the example given at https://rocket.rs/v0.4/guide/getting-started/#
    * What you expected vs. what actually happened.
    cargo should build successful, but it fails with:

Compiling rocket_http v0.4.7
Running rustc --crate-name rocket_http /home/dkahlenberg/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket_http-0.4.7/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="private-cookies"' -C metadata=1d45e05f4c40de14 -C extra-filename=-1d45e05f4c40de14 --out-dir /home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps -L dependency=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps --extern cookie=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libcookie-88711a7887c74ba3.rmeta --extern hyper=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libhyper-d4edfeadec0ee1ef.rmeta --extern indexmap=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libindexmap-99fc342959722d6b.rmeta --extern pear=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libpear-9a2578c4814e5113.rmeta --extern percent_encoding=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libpercent_encoding-a49f808696dc9385.rmeta --extern smallvec=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libsmallvec-d879f3dc72faadac.rmeta --extern state=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libstate-551fc2cd5865959b.rmeta --extern time=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libtime-fc954b8cf58271a9.rmeta --extern unicode_xid=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libunicode_xid-04f9d636d60cad8c.rmeta --cap-lints allow --sysroot=/nix/store/l38dzrqwkv4b96pnikngnh2nnczawg7s-rust
error[E0107]: wrong number of type arguments: expected 3, found 2
--> /home/dkahlenberg/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket_http-0.4.7/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.

Caused by:
process didn't exit successfully: rustc --crate-name rocket_http /home/dkahlenberg/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket_http-0.4.7/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="private-cookies"' -C metadata=1d45e05f4c40de14 -C extra-filename=-1d45e05f4c40de14 --out-dir /home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps -L dependency=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps --extern cookie=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libcookie-88711a7887c74ba3.rmeta --extern hyper=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libhyper-d4edfeadec0ee1ef.rmeta --extern indexmap=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libindexmap-99fc342959722d6b.rmeta --extern pear=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libpear-9a2578c4814e5113.rmeta --extern percent_encoding=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libpercent_encoding-a49f808696dc9385.rmeta --extern smallvec=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libsmallvec-d879f3dc72faadac.rmeta --extern state=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libstate-551fc2cd5865959b.rmeta --extern time=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libtime-fc954b8cf58271a9.rmeta --extern unicode_xid=/home/dkahlenberg/christine.website-how-i-start-nix-2020-03-08/helloworld/target/debug/deps/libunicode_xid-04f9d636d60cad8c.rmeta --cap-lints allow --sysroot=/nix/store/l38dzrqwkv4b96pnikngnh2nnczawg7s-rust (exit code: 1)

@jebrosen
Copy link
Collaborator

I think this is related to indexmap-rs/indexmap#144 since it looks like you are using WSL. On WSL something breaks the "is std available" detection, and you end up with the no_std version of IndexMap.

One workaround you can apply for now is to add the following to your own Cargo.toml:

[dependencies]
indexmap = { version = "1.6.1", features = ["std"] }

We could also work around this in rocket by backporting #1502 to v0.4.

@jebrosen jebrosen added the upstream An unresolvable issue: an upstream dependency bug label Feb 23, 2021
@573
Copy link
Author

573 commented Feb 24, 2021

It would be good to backport this for WSL1 users.
Especially behind corporate proxies or vpns WSL1 might still be easier to handle in the first place.
I needed some patch to use the rust-overlay so I used a modified overlay which in turn missed some of the patches https://github.com/mozilla/nixpkgs-mozilla added, i. e. mozilla/nixpkgs-mozilla#227.
Which has potential to lead to follow-up errors etc.

On WSL2 these errors do not occur.

@SergioBenitez
Copy link
Member

@jebrosen I'll leave the decision to backport to you. Please feel free to do so or close this issue.

@SergioBenitez
Copy link
Member

@jebrosen What do you think?

jebrosen pushed a commit that referenced this issue Apr 17, 2021
@573
Copy link
Author

573 commented Apr 19, 2021

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream An unresolvable issue: an upstream dependency bug
Projects
None yet
Development

No branches or pull requests

3 participants