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

"Can't find crate" syntax #598

Closed
raphaelcohn opened this issue Oct 20, 2016 · 3 comments
Closed

"Can't find crate" syntax #598

raphaelcohn opened this issue Oct 20, 2016 · 3 comments
Labels

Comments

@raphaelcohn
Copy link

Hi, I just followed the instructions at https://serde.rs/codegen-nightly.html for my first experience of Serde. Whilst building the serde_codegen dependency, cargo barfs with :-

   Compiling serde_codegen_internals v0.10.0
     Running `rustc /Users/raph/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_codegen_internals-0.10.0/src/lib.rs --crate-name serde_codegen_internals --crate-type lib -g -C metadata=7453e4105b65d936 -C extra-filename=-7453e4105b65d936 --out-dir /Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps --emit=dep-info,link --target x86_64-unknown-linux-musl -C ar=x86_64-linux-musl-ar -C linker=x86_64-linux-musl-cc -L dependency=/Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps --extern syn=/Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps/libsyn-acd6f0256d61d97a.rlib --cap-lints allow -Anon-snake-case -Anon-upper-case-globals -Wtrivial-casts -Wunused-extern-crates -Wunused-import-braces -Wmissing-copy-implementations -Wmissing-debug-implementations -Ddrop_with_repr_extern`
warning: lint drop_with_repr_extern has been removed: drop flags have been removed
  |
  = note: requested on the command line with `-D drop_with_repr_extern`

   Compiling serde_codegen v0.8.14
     Running `rustc /Users/raph/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_codegen-0.8.14/src/lib.rs --crate-name serde_codegen --crate-type lib -g --cfg feature=\"with-syn\" -C metadata=1c2640c6d5d4a61d -C extra-filename=-1c2640c6d5d4a61d --out-dir /Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps --emit=dep-info,link --target x86_64-unknown-linux-musl -C ar=x86_64-linux-musl-ar -C linker=x86_64-linux-musl-cc -L dependency=/Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps --extern serde_codegen_internals=/Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps/libserde_codegen_internals-7453e4105b65d936.rlib --extern quote=/Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps/libquote-90e47f572f455756.rlib --extern syn=/Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps/libsyn-acd6f0256d61d97a.rlib --cap-lints allow -Anon-snake-case -Anon-upper-case-globals -Wtrivial-casts -Wunused-extern-crates -Wunused-import-braces -Wmissing-copy-implementations -Wmissing-debug-implementations -Ddrop_with_repr_extern`
warning: lint drop_with_repr_extern has been removed: drop flags have been removed
  |
  = note: requested on the command line with `-D drop_with_repr_extern`

error[E0463]: can't find crate for `syntax`
  --> /Users/raph/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_codegen-0.8.14/src/lib.rs:21:1
   |
21 | extern crate syntax;
   | ^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

Build failed, waiting for other jobs to finish...
error: Could not compile `serde_codegen`.

Caused by:
  Process didn't exit successfully: `rustc /Users/raph/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_codegen-0.8.14/src/lib.rs --crate-name serde_codegen --crate-type lib -g --cfg feature="with-syn" -C metadata=1c2640c6d5d4a61d -C extra-filename=-1c2640c6d5d4a61d --out-dir /Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps --emit=dep-info,link --target x86_64-unknown-linux-musl -C ar=x86_64-linux-musl-ar -C linker=x86_64-linux-musl-cc -L dependency=/Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps --extern serde_codegen_internals=/Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps/libserde_codegen_internals-7453e4105b65d936.rlib --extern quote=/Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps/libquote-90e47f572f455756.rlib --extern syn=/Volumes/Source/GitHub/lemonrock/dpdk/.cargo/target/x86_64-unknown-linux-musl/debug/deps/libsyn-acd6f0256d61d97a.rlib --cap-lints allow -Anon-snake-case -Anon-upper-case-globals -Wtrivial-casts -Wunused-extern-crates -Wunused-import-braces -Wmissing-copy-implementations -Wmissing-debug-implementations -Ddrop_with_repr_extern` (exit code: 101)

I'm using nightly. Any ideas? It's left me stumped.

@dtolnay
Copy link
Member

dtolnay commented Oct 20, 2016

I have never seen that before but it looks like your compiler and/or cargo may be very old. You should be seeing the following versions or later:

$ rustc --version
  rustc 1.14.0-nightly (16eeeac78 2016-10-18)
$ cargo --version
  cargo 0.13.0-nightly (02fed69 2016-10-18)

If you are using the nightly-only features, you need to use a nightly compiler i.e. update your compiler every night. In general we only ever support the most recent nightly.

@raphaelcohn
Copy link
Author

Ah! This particular crate is pinned on a specific nightly compiler because of rust-lang/rust#36954

@dtolnay dtolnay changed the title "Can't find create" "Can't find crate" syntax Oct 20, 2016
@dtolnay
Copy link
Member

dtolnay commented Oct 20, 2016

It looks like more of a cargo issue. See whether you can update cargo without updating rustc. I don't know how to do that exactly but #rust IRC might.

Failing that, the other approach will work even on nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants