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

Windows 2022: couldn't determine visual studio generator #141

Open
nibanks opened this issue Jan 25, 2022 · 5 comments
Open

Windows 2022: couldn't determine visual studio generator #141

nibanks opened this issue Jan 25, 2022 · 5 comments

Comments

@nibanks
Copy link

nibanks commented Jan 25, 2022

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!

@aloucks
Copy link
Contributor

aloucks commented Jan 26, 2022

Looks like the error is coming from the cc crate: https://github.com/alexcrichton/cc-rs/blob/030baede12f079793cc50d6f90b677b889c49fcd/src/windows_registry.rs#L150

@Byron
Copy link
Member

Byron commented Feb 13, 2022

Thanks, this helped me to fix the same issue by settings runs-on: windows-2019 for the time being.

@stefangalowicz
Copy link

stefangalowicz commented Feb 16, 2022

@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
Copy link
Author

nibanks commented Feb 16, 2022

@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

@pacmancoder
Copy link

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" }

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

No branches or pull requests

5 participants