cmake-rs
cmake-rs copied to clipboard
Windows 2022: couldn't determine visual studio generator
We use the cmake crate in our CI for building msquic. We just tried updating the Azure Pipeline to use Windows Server 2022 instead of 2019 to build it and the CI failed.
We are getting the following error (from here):
--- stderr
thread 'main' panicked at '
couldn't determine visual studio generator
if VisualStudio is installed, however, consider running the appropriate vcvars script before building this crate
We have no problem with any non-Rust cmake builds, so I suspect this is something specific to the the cmake crate. Do you know of any work around for this? For the time being we can continue to use 2019, but eventually that will be deprecated. Thanks!
Looks like the error is coming from the cc crate: https://github.com/alexcrichton/cc-rs/blob/030baede12f079793cc50d6f90b677b889c49fcd/src/windows_registry.rs#L150
Thanks, this helped me to fix the same issue by settings runs-on: windows-2019 for the time being.
@aloucks Looks to me like it's not cc but cmake: https://github.com/alexcrichton/cmake-rs/blob/7793895d88acc45d29fac7c711ddaef11c897ea9/src/lib.rs#L610-L621
I assume Vs17 must be added.
@nibanks Is your target i686?
@nibanks Is your target i686?
We're just running on a windows-2022 agent in Azure Pipelines. I assume it's x64. cc @thhous-msft
Hi, for anyone interested in a temporary solution - just add this patch to your root Cargo.toml, VS2022 support is already merged, but new cc version is not yet released:
[patch.crates-io]
cc = { git = "https://github.com/alexcrichton/cc-rs" }