Message is thread 'main' panicked at 'assertion failed:(left == right)(left:2, right:1)', src/rustup-cli/self_update.rs:495
The line in question seems to check that there is only one unix shell profile file in the list to be checked. But if the user's $SHELL is zsh, the list will contain both .profile and .zprofile and fail with an assertion error.
Setting the user's SHELL var to something non-zsh works around this problem temporarily.
confirmed.
Yeah, same issue for me. And here is the stack backtrace:
鈺扳攢$ echo $SHELL
/bin/zsh
鈺扳攢$ curl https://sh.rustup.rs -sSf | sh
info: downloading installer
thread 'main' panicked at 'assertion failed: `(left == right)` (left: `2`, right: `1`)', src/rustup-cli/self_update.rs:495
stack backtrace:
1: 0x1079c320a - std::sys::imp::backtrace::tracing::imp::write::he3d1bfbdbf113480
2: 0x1079cb24f - std::panicking::default_hook::{{closure}}::h575f1b40d2e88f07
3: 0x1079c9edf - std::panicking::default_hook::h3d5dccce8125d0cf
4: 0x1079ca516 - std::panicking::rust_panic_with_hook::h00b81bb3dcbd51f2
5: 0x1079ca3b4 - std::panicking::begin_panic::ha6a0d553db9869ff
6: 0x1079ca2d2 - std::panicking::begin_panic_fmt::h24d113aee3ee4081
7: 0x1077bc8bf - rustup_init::self_update::install::h90ee439c9b6ab7e9
8: 0x1077c9f4d - rustup_init::run_multirust::hcf1b092d2ea80abf
9: 0x1077c8939 - rustup_init::main::h1a642123296d704d
10: 0x1079cb80a - __rust_maybe_catch_panic
11: 0x1079ca8b6 - std::rt::lang_start::h74b3afbdd8daef1c
rustup: command failed: /var/folders/2w/_gw1ybsn2m97nqltx84zvl9r0000gp/T/tmp.GHUQlujY/rustup-init
鈺扳攢$ export SHELL=/bin/bash
鈺扳攢$ curl https://sh.rustup.rs -sSf | sh
info: downloading installer
Welcome to Rust!
How do you change Shell? I tried SHELL=/bin/bash curl https://sh.rustup.rs -sSf | sh but without success. I'm using ZSH by default so I'm not quite sure how to switch back to Bash any more.
What worked for me was setting SHELL=/bin/bash and then manually running the rustup-init command.
Got it working by downloaded shell file and run them locally. First day with Rust here. Appreciate the help 馃憤 .
Happening for me as well. Downloading the script and running it with --no-modify-path allows installation to proceed.
$ echo $SHELL
/bin/zsh
$ ~/rustup.sh --version
info: downloading installer
rustup-init 1.1.0 (04fda5e 2017-04-04)
There are numerous paths rustup can take to solve this issue:
.profile config..profile if the shell is unknown by rustup..profile and to the config of the running shell.My vote goes to appending to the config of the running shell or .profile when that shell is unknown.
We are seeing this a _lot_ in #rust-beginners.
Temporary fix is curl https://sh.rustup.rs -sSf | SHELL=/bin/bash sh
I'm willing to work on a PR if someone will describe the expected behavior.
@rmbreak Let's go with your instincts since you seem to know what's up. Will you make a patch?
@rmbreak actually, is there any harm in modifying both .profile and .zprofile? That's kind of what I intended. ISTM we can just delete this assertion and things should work.
Oh that assertion is because the message displays just one modified script. To remove the assertion we'd have to make the pre_install_message smarter.
I'm poking at a patch to remove that assertion, which I think is probably desirable regardless of whatever the ultimate strategy is.
Ok here's the patch. I intend to land that to fix the immediate problem and as a general improvement, but I'm open to further debate about the right way to handle PATH.
@rmbreak how do you feel about the maximal solution of modifying both .profile and .zprofile?
@brson I think modifying .profile and the currently running shell's login config is fine.
If a system has sh, zsh, and csh installed with rustup running under a csh instance, then rustup should update .login and .profile, ignoring .zprofile.
When rustup gains support for other shells, such as csh, there will be different syntax for appending to PATH. In the case of csh: setenv PATH $HOME/.cargo/bin:$PATH.
Most helpful comment
Temporary fix is
curl https://sh.rustup.rs -sSf | SHELL=/bin/bash sh