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

Rustup-init link guides me to install Build Tools 2022 #3024

Closed
nathanmerrill opened this issue Jul 8, 2022 · 10 comments
Closed

Rustup-init link guides me to install Build Tools 2022 #3024

nathanmerrill opened this issue Jul 8, 2022 · 10 comments
Labels

Comments

@nathanmerrill
Copy link

nathanmerrill commented Jul 8, 2022

Problem

I'm attempting to install rust on a new machine. When I run rustup-init, it indicates that it can't find C++ build tools, and directs me to this link to install the build tools: https://visualstudio.microsoft.com/visual-cpp-build-tools/ After using that link, and selecting the appropriate components, the visual studio installer indicates that I have installed Visual Studio Build Tools 2022, not 2019. I don't know how to install 2019 build tools

Steps

  1. Visit https://visualstudio.microsoft.com/visual-cpp-build-tools/, and download Build Tools
  2. Select Windows 10 SDK + English Language pack (I also selected MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.29-16.11) to be safe)
  3. Install
  4. After installation is finished, notice that the Visual Studio Installer indicates that Visual Studio Build Tools 2022 is installed, and that rustup still displays the same startup warning.

Possible Solution(s)

I'm guessing that Microsoft has changed the download on the above page to 2022 instead of 2019. Possible solutions include:

  • Change the link to one that explicitly targets the 2019 build tools?
  • Add additional instructions that indicate how to download the 2019 build tools
  • If 2022 build tools is fine, then perhaps the check at the start of rustup-init needs changing
  • Perhaps, this is a user error on my end.

Notes

No response

Rustup version

rustup-init 1.24.3 (ce5817a94 2021-05-31)

Installed toolchains

rustup is not installed
@rbtcollins
Copy link
Contributor

2022 build tools should work fine

@nathanmerrill
Copy link
Author

nathanmerrill commented Jul 9, 2022

If 2022 build tools works fine, then something has gone wrong with the check for build tools. From visual studio installer's side, everything looks as I would expect, but rustup-init still indicates that it can't find build tools.

@ehuss
Copy link
Contributor

ehuss commented Jul 9, 2022

At a minimum, I think you need to select these components when choosing individual components:

  • MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)
  • Windows 10 SDK (10.0.20348.0)
  • C++ CMake tools for Windows

(Assuming you are on x64 and not arm.)

Or, just choose the "Desktop development with C++", though that may include extra things you may not need. I'm not exactly sure why the cmake option is necessary.

@nathanmerrill
Copy link
Author

Ah, C++ CMake tools was what I was missing. I didn't see that in the documentation. I'll see if there's a good spot to list those components in the documentation, but otherwise, you can consider this issue closed.

@ChrisDenton
Copy link
Member

You shouldn't need CMake itself for a basic Rust install (though admittedly it can be useful for mixed code projects). I just tried a minimal setup of rust in a VM:

vs_rustup

@nathanmerrill
Copy link
Author

Ah, interesting. So, perhaps the real requirement is MSVC vLatest? I initially chose v142 because it mentioned VS2019.

@ChrisDenton
Copy link
Member

Huh, that should work. But it doesn't. Rustup uses the cc crate to find out if MSVC is installed but that's failing to find it if the 2022 installer is used to install the 2019 build tools. Weird. I'll see if I can figure out why that is.

@ehuss
Copy link
Contributor

ehuss commented Jul 9, 2022

I had tested in a VM, and I encountered the same problem. Trying again, I see what I did wrong that required installing cmake.

I had selected MSVC v143 - VS 2022 C++ x64/x86 build tools (v14.32-17.2). The critical difference is the version at the end. Only when I choose the entry with the (Latest) version does it seem to work correctly. 🤷

@ChrisDenton
Copy link
Member

See the issue linked above for the cause. A fix in cc-rs should not be too difficult.

@hammypants
Copy link

Ran into this on a fresh install and can confirm the workaround is to use whatever the latest is for VS 2022.

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

No branches or pull requests

5 participants