Windows nightlies not up-to-date

I'm getting this error from my build using the Windows 64-bit nightlies:

Running: C:\Program Files\Rust nightly 1.4\bin\cargo.exe build
Compiling libc v0.1.8
Compiling regex-syntax v0.2.1
error: Unrecognized option: 'cap-lints'.
Build failed, waiting for other jobs to finish...
error: Unrecognized option: 'cap-lints'.
Could not compile libc.

That feature was merged on July 29th, so it should be in the nightlies, right? It also works for me on Ubuntu via the nightly PPA. According to the server, rust-nightly-x86_64-pc-windows-gnu.msi has been updated on August 14th which should be fine. Also "rustc --version" gives me an up-to-date commit ab450ef22 and date 2015-08-14 as the server says.

So how can I resolve this problem?

Is this still happening? In theory Cargo should auto-detect whether the compiler has support for --cap-lints or not, so I'm surprised it's passing the option to a compiler that doesn't support it.

Also, what're the versions of Cargo and Rust in play here?

Still happening with the just downloaded nightlies (as linked on the main site: https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.msi).

"C:\Program Files\Rust nightly 1.4\bin\cargo.exe" --version
cargo 0.5.0-nightly (1f24be7 2015-08-13)

"C:\Program Files\Rust nightly 1.4\bin\rustc.exe" --version
rustc 1.4.0-nightly (7e13faee1 2015-08-19)

I found the actual cause. It's working fine with a new crate, but as soon as I add the line [dependencies.regex] to Cargo.toml, it gives the error

C:\Projects>"\Program Files\Rust nightly 1.4\bin\cargo.exe" new NewCrate

C:\Projects>cd NewCrate

C:\Projects\NewCrate>"\Program Files\Rust nightly 1.4\bin\cargo.exe" build
Compiling NewCrate v0.1.0 (file:///C:/Projects/NewCrate)

C:\Projects\NewCrate>"\Program Files\Rust nightly 1.4\bin\cargo.exe" build
Updating registry https://github.com/rust-lang/crates.io-index
Downloading memchr v0.1.5
Downloading libc v0.1.10
Compiling regex-syntax v0.2.1
Compiling libc v0.1.10
error: Unrecognized option: 'cap-lints'.
Build failed, waiting for other jobs to finish...
error: Unrecognized option: 'cap-lints'.
Could not compile regex-syntax.

To learn more, run the command again with --verbose.

Does that make sense?

Here's the verbose output:

Compiling regex-syntax v0.2.1
Running rustc C:\Users\Dog\.cargo\registry\src\github.com-0a35038f75765ae4\regex-syntax-0.2.1\src\lib.rs --crate-name regex_syntax --crate-type lib -g -C metadata=0276adb4f6478fcb -C extra-filename=-0276adb4f6478fcb --out-dir C:\Projects\NewCrate\target\debug\deps --emit=dep-info,link -L dependency=C:\Projects\NewCrate\target\debug\deps -L dependency=C:\Projects\NewCrate\target\debug\deps --cap-lints allow
Compiling libc v0.1.10
Running rustc C:\Users\Dog\.cargo\registry\src\github.com-0a35038f75765ae4\libc-0.1.10\rust/src/liblibc/lib.rs --crate-name libc --crate-type lib -g --cfg "feature=\"cargo-build\"" --cfg "feature=\"default\"" -C metadata=144c435538abd757 -C extra-filename=-144c435538abd757 --out-dir C:\Projects\NewCrate\target\debug\deps --emit=dep-info,link -L dependency=C:\Projects\NewCrate\target\debug\deps -L dependency=C:\Projects\NewCrate\target\debug\deps --cap-lints allow
error: Unrecognized option: 'cap-lints'.
Build failed, waiting for other jobs to finish...
error: Unrecognized option: 'cap-lints'.
Could not compile libc.

Caused by:
Process didn't exit successfully: rustc C:\Users\Dog\.cargo\registry\src\github.com-0a35038f75765ae4\libc-0.1.10\rust/src/liblibc/lib.rs --crate-name libc --crate-type lib -g --cfg feature="cargo-build" --cfg feature="default" -C metadata=144c435538abd757 -C extra-filename=-144c435538abd757 --out-dir C:\Projects\NewCrate\target\debug\deps --emit=dep-info,link -L dependency=C:\Projects\NewCrate\target\debug\deps -L dependency=C:\Projects\NewCrate\target\debug\deps --cap-lints allow (exit code: 101)

If you just run rustc -vV in the command line, what version of the compiler are you using? Cargo by default uses the rustc in your PATH so the compiler you ran may not be the one Cargo's running if you've got multiple installations. Could you also see if rustc -vV --cap-lints allow works for you in the command line?

This also only becomes a problem when a dependency is added because Cargo only passes --cap-lints allow to upstream dependencies.

The PATH hint did it. Rust 1.0 stable is in the PATH and even though RustDT asks for a specific Rust installation path, it doesn't take care of making cargo find the right compiler. Removing Rust from the PATH makes it work. I might open an issue with RustDT.

Thanks :smile: