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 fails to open non-existing windows registry path #3779

Closed
2 tasks done
fruzitent opened this issue Apr 19, 2024 · 3 comments · Fixed by #3896
Closed
2 tasks done

rustup fails to open non-existing windows registry path #3779

fruzitent opened this issue Apr 19, 2024 · 3 comments · Fixed by #3896
Labels
bug O-containers Not really OS-related, but container-specific O-windows Windows related
Milestone

Comments

@fruzitent
Copy link

fruzitent commented Apr 19, 2024

Verification

Problem

https://github.com/rust-lang/rustup/blob/1.27.0/src/cli/self_update/windows.rs#L420-L423

Steps

$ docker run --rm -it mcr.microsoft.com/windows/nanoserver:ltsc2022

C:\>reg query HKCU
HKEY_CURRENT_USER\Console
HKEY_CURRENT_USER\Control Panel
HKEY_CURRENT_USER\Network
HKEY_CURRENT_USER\SOFTWARE

C:\>curl --location --remote-name --remote-header-name "https://static.rust-lang.org/rustup/archive/1.27.0/x86_64-pc-windows-msvc/rustup-init.exe"

C:\>.\rustup-init.exe -y
warning: installing msvc toolchain without its prerequisites
error: Failed opening Environment key: The system cannot find the file specified. (os error 2)

Possible Solution(s)

C:\>reg add HKCU\Environment

Notes

No response

Rustup version

rustup-init 1.27.0 (bbb9276d2 2024-03-08)

Installed toolchains

unknown

OS version

Microsoft Windows [Version 10.0.20348.2402]
@fruzitent fruzitent added the bug label Apr 19, 2024
@ChrisDenton
Copy link
Member

ChrisDenton commented Apr 19, 2024

Just to provide some more context, nanoserver is a kind of minimal Windows install that would not be expected to have everything the desktop or full server OS does.

@rami3l rami3l added this to the On Deck milestone Apr 20, 2024
@rami3l
Copy link
Member

rami3l commented Apr 20, 2024

Currently we use open_subkey for all Environment related stuff, do in theory replacing that with create_subkey will do.

I'm not sure about the right direction to go though... The most harmless approach would probably be prompting our users to create it on error, but we cannot test this behavior on standard Windows either.

Update: Looks like nothing is stopping me from running the Rustup CI in the nanoserver image, even if it's just for this particular issue. If the perf overhead is negligible, we might even keep it that way.

@rami3l rami3l modified the milestones: On Deck, 1.28.0 Apr 22, 2024
@fruzitent
Copy link
Author

running the Rustup CI in the nanoserver image

for msvc toolchain you would have to use the next tier image - servercore (4.5gb), because nanoserver (300mb) does not support running 32-bit executables and .NET Framework used in VS Installer, but i tested gnu toolchain with llvm-mingw, works well.

@rami3l rami3l added O-windows Windows related O-containers Not really OS-related, but container-specific labels Jun 19, 2024
@rami3l rami3l modified the milestones: 1.28.0, 1.28.1 Aug 9, 2024
@rami3l rami3l modified the milestones: 1.28.1, 1.28.0 Sep 25, 2024
@djc djc closed this as completed in #3896 Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug O-containers Not really OS-related, but container-specific O-windows Windows related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants