jwilm / racerd

Rust semantic analysis server powered by Racer
http://jwilm.github.io/racerd/libracerd/
Apache License 2.0
134 stars 24 forks source link

Fresh clone doesn't build from #![deny(warnings)] on nightly #39

Closed anp closed 8 years ago

anp commented 8 years ago

racerd builds find for me on stable, but I accidentally had multirust's default set to nightly and got a nice little lint build error:

$ rustc --version
rustc 1.10.0-nightly (e0fd34bba 2016-05-09)
$ cargo build --release
   Compiling libracerd v0.2.0 (file:///home/adam/rust-projects/racerd)
/home/adam/rust-projects/racerd/target/release/build/libracerd-426767cf8a838e70/out/http/definition.rs:7:14: 7:28 error: unused import
/home/adam/rust-projects/racerd/target/release/build/libracerd-426767cf8a838e70/out/http/definition.rs:7 use engine::{SemanticEngine, Definition, Context, CursorPosition, Buffer};
                                                                                                                      ^~~~~~~~~~~~~~
/home/adam/rust-projects/racerd/target/release/build/libracerd-426767cf8a838e70/out/http/definition.rs:7:14: 7:28 note: in this expansion of include!
src/lib.rs:9:9: 9:17 note: lint level defined here
src/lib.rs:9 #![deny(warnings)]
                     ^~~~~~~~
/home/adam/rust-projects/racerd/target/release/build/libracerd-426767cf8a838e70/out/http/completion.rs:7:14: 7:28 error: unused import
/home/adam/rust-projects/racerd/target/release/build/libracerd-426767cf8a838e70/out/http/completion.rs:7 use engine::{SemanticEngine, Completion, Context, CursorPosition, Buffer};
                                                                                                                      ^~~~~~~~~~~~~~
/home/adam/rust-projects/racerd/target/release/build/libracerd-426767cf8a838e70/out/http/completion.rs:7:14: 7:28 note: in this expansion of include!
src/lib.rs:9:9: 9:17 note: lint level defined here
src/lib.rs:9 #![deny(warnings)]
                     ^~~~~~~~
error: aborting due to 2 previous errors
error: Could not compile `libracerd`.

I haven't investigated in depth, but I'm assuming that since the error is inside an include! it's due to differing behavior of syntex on nightly vs. stable. Might be good to add something to the README noting which compiler versions are supported?

jwilm commented 8 years ago

Hmm... can we force serde to use aster/syntex/etc from crates.io even on nightly builds? Since this all works on stable, it should work on the newer nightlies, too.

anp commented 8 years ago

Cargo is using the same package versions and sources for me on both stable and nightly:

Stable:

   Compiling aster v0.15.0
   Compiling syntex v0.31.0
   Compiling quasi v0.9.0
   Compiling quasi_codegen v0.9.0
   Compiling serde_codegen v0.7.2

Nightly:

   Compiling syntex v0.31.0
   Compiling aster v0.15.0
   Compiling quasi v0.9.0
   Compiling quasi_codegen v0.9.0
   Compiling serde_codegen v0.7.2

As far as I can tell Cargo.lock is being honored on both nightly and stable. It seems like it's maybe a difference between how the serde_codegen dependencies behave on stable vs. nightly? Trying a couple things out.

jwilm commented 8 years ago

serde_codegen has some features that would offer control of this

[features]
default = ["with-syntex"]
nightly = ["quasi_macros"]
nightly-testing = ["clippy"]
with-syntex = ["quasi/with-syntex", "quasi_codegen", "quasi_codegen/with-syntex", "syntex", "syntex_syntax"]

I think we can specify with-syntex as a feature, and that should make it use syntex always. I won't be able to try this out until later, though.

Thanks for digging into this!

anp commented 8 years ago

No problem! I was just trying with-syntex with no apparent effect, unfortunately. Seems like it might be an improvement to nightly's dead code analysis, as opposed to a problem with serde. If that's the case, I'll have a PR together in a few.

anp commented 8 years ago

@jwilm fun fact: serde_codegen has with-syntex in its default features -- go figure.