-
Notifications
You must be signed in to change notification settings - Fork 900
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
Installation stops if .profile
is a directory.
#2506
Comments
Those changes were merged after the last release. |
That is a good point and an excellent question which I admit I did not consider. :) (Perhaps a "Verify against master branch" would be a good thing to be added to the issue template.) Checking against master is something I'm open to doing but despite extensive searching around (via docs, issues, CI, TOML & source) I couldn't work out if there are pre-built nightly/master versions of Does a check against current master require me to build Thanks. |
Yes, you'll need to build it yourself at this point, as we don't publish the builds of master / PRs. |
Yes, for rustup you should be able to just walk into the directory and |
@follower Have you been able to reproduce this with |
Unfortunately I'm unlikely to get through my pre-existing yaks in order to test this with I'll endeavour to remember to take another look when a new version is released. Given that It doesn't seem entirely unlikely that someone might encounter an issue with Potential todo's for me if I get back to this:
|
Precisely because |
@follower Since 1.23 is now out with the revamped code by @workingjubilee in place, could you have another go and see how things behave? If we still need to make improvements then we will. |
Problem
When installing, if
.profile
is a directory, an error occurs and installation stops.Ideally, if an error occurs when modifying
.profile
, the change of.profile
would be skipped (displaying a warning or giving choice) but rest of changes/installation continues.This is, admittedly very much a corner case, but I encountered it in the "real world" as a result of simlu/voxelshop#305 which (mis)uses what seems to be a semi-common Java application framework/pattern.
Steps
mkdir ~/.profile
./rustup-init
Possible Solution(s)
It may be sufficient to modify the first conditional here in
do_add_to_path()
to also ensure the "rcfile" is not a directory if the path exists:rustup/src/cli/self_update/unix.rs
Lines 89 to 94 in d3bb61a
The
.profile
path is always used for POSIX:rustup/src/cli/self_update/shell.rs
Lines 118 to 122 in 4cbc785
The
do_add_to_path()
routine is called from:rustup/src/cli/self_update.rs
Line 340 in 4ee141e
The path removal code around here may also need to be modified--but probably not because it seems the check here is for
is_file()
:rustup/src/cli/self_update/unix.rs
Lines 60 to 61 in d3bb61a
Tests would also need to be modified/added but it seems from this test the error may be intentional:
rustup/tests/cli-paths.rs
Lines 108 to 119 in 8e987b3
Part of me wonders if an error should only occur if zero rcfiles can be updated but another part of me wonders if a warning is likely to be missed & result in more confusion in other situations...
Notes
Output of
rustup-init --version
:Output of
rustup show
: (not a command forrustup-init
)Additional (semi-)related code/issues
https://github.com/rust-lang/rustup/blob/d8eed08b0274b175fd2684f5da466bb48e11ac9d/tests/cli-inst-interactive.rs#L111-L113
The text was updated successfully, but these errors were encountered: