I spent last week getting Rust to work with Visual Studio 2017. In the
process I learned a few things that crate authors need to know in
order to ensure VS2017 compatibility. Here they are.
rustc 1.19.0-nightly (0418fa9d3 2017-06-04)should work correctly
with VS 2017 without running vcvars.bat. Sadly, it’s now busted
against gnu toolchains, but that should be fixed soon.
- Upgrade gcc-rs deps to 0.3.50
- Upgrade cmake deps to 0.1.24
- Upgrade lzma-sys to 0.1.6
In VS 2017 the scheme for locating the MSVC compiler changed again, so
I updated the gcc crate (which is actually the general C compiler
driver crate) to do that detection, based on work by @retep998, and
then updated rustc itself to use the gcc crate instead of its own
Similarly, I replaced some detection logic in cmake-rs to defer again
to gcc-rs, making gcc-rs the source of truth globally for locating
And in the process I discovered that lzma-sys was reporting the wrong
"platform toolset" version to msbuild (it should be “v141”), and
At this point, cargo, rls, and rustup all appear to build correctly
under VS 2017. So please give it a try and see if it works for you.