-
Notifications
You must be signed in to change notification settings - Fork 893
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: "called Option::unwrap()
on a None
value"
#3936
Comments
@Baiyuetribe Sorry for your bad experience! Do you have the |
This comment was marked as outdated.
This comment was marked as outdated.
Wait, why is rustup doing this directly? I thought it used the |
Needing the |
@ChrisDenton Blame: Introduced in 0997247, four years ago. |
That's super weird because I have installed it within that time without having |
It seems like we have two Lines 50 to 53 in 79ba44c
Lines 130 to 133 in 79ba44c
|
@ChrisDenton My theory is that the former calls the latter with an indirection, in that /// Returns the path of the current user's home directory from [`Env::home_dir`].
pub fn home_dir_with_env(env: &dyn Env) -> Option<PathBuf> {
env.home_dir()
} |
Then I'm super confused why this isn't a problem for |
@ChrisDenton I believe it should be, but we shouldn't trust the CI runner because from its POV setting |
Ah, I see. From testing it seems the published x86_64 installer works but not if I build from master. So it seems like this did regress at some point. I'm less confused now. This is a major regression because it means rustup-init is broken by default on Windows. It also seems weird that we have two ways of getting rustup home that are implemented completely differently. In some places we use |
@ChrisDenton You mean somewhere between master and the v1.27.1 tag? Could you do a bisect in addition since I don't have a Windows machine near me, many thanks in advance 🙇
That'll be a very good place to improve indeed. |
Option::unwrap()
on a None
value called Option::unwrap()
on a None
value"
Sure. It regressed in 204c8a9.
I think we should calculate rustup/cargo home once then cache it somewhere. Also those sanity checks look very unix-specific (unix paths and bash scripts). Not sure if they're relevant to Windows. Maybe there should be greater separation between platform specific bits. But that's a bigger job. |
@ChrisDenton Thanks a lot for helping out!
Rustup used to have runtime detection of OS instead of conditional compilation. The idea of this check is that it should be a no-op on Windows... I've set it as a part of #2424.
cc @djc (Looks like |
@Baiyuetribe Given @ChrisDenton's analysis, https://win.rustup.rs/aarch64 should work for you without problems. |
Please note that #3938 does NOT close this.
Looks like Now let's look at the files it verifies:
... so this function serves no purpose, at least not on Windows. My suggestion for now is to revert 0080271 completely. @djc @ChrisDenton what do you think? |
thanks,it works 👍🏻 |
Option::unwrap()
on a None
value called Option::unwrap()
on a None
value"Option::unwrap()
on a None
value"
Makes sense to me! I think it served it's purpose in helping migration to rustup in ancient times but I don't think we still need to handle pre-1.0 stuff. |
Verification
Problem
windows on Arm64 still not work.
Steps
reproduce
# my device: windows arm64 git clone https://github.com/rust-lang/rustup.git cargo build --release
after,i got
rustup-init.exe
.Possible Solution(s)
No response
Notes
No response
Rustup version
latest
Installed toolchains
none
OS version
windows arm64
Tasks
The text was updated successfully, but these errors were encountered: