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 1.17 complains about not being installed in CARGO_HOME #1742

Closed
Nemo157 opened this issue Apr 8, 2019 · 9 comments · Fixed by #1763
Closed

rustup 1.17 complains about not being installed in CARGO_HOME #1742

Nemo157 opened this issue Apr 8, 2019 · 9 comments · Fixed by #1763
Assignees
Labels

Comments

@Nemo157
Copy link
Member

Nemo157 commented Apr 8, 2019

On rustup 1.16.0 it was possible to override CARGO_HOME to change Cargo's cache directory, since rustup 1.17.0 this has stopped working and rustup complains about not being installed under the overridden CARGO_HOME directory:

> docker run --rm -e 'CARGO_HOME=target/cargo' nemo157/rustup@sha256:cc47026867f4dade98fdaa6aa385732ad3feaf04cb56c3b9a363be70c196c1e0 sh -c 'rustup --version && rustup update stable && cargo +stable --version'
rustup 1.16.0 (beab5ac2b 2018-12-06)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2019-02-28, rust version 1.33.0 (2aa4c46cf 2019-02-28)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'

  stable-x86_64-unknown-linux-gnu installed - rustc 1.33.0 (2aa4c46cf 2019-02-28)

cargo 1.33.0 (f099fe94b 2019-02-12)
> docker run --rm -e 'CARGO_HOME=target/cargo' nemo157/rustup@sha256:0d85c5b353b6674357db5b302e43a67c9705b7095f8128a7e59264e532644878 sh -c 'rustup --version && rustup update stable && cargo +stable --version'
rustup 1.17.0 (069c88ed6 2019-03-05)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2019-02-28, rust version 1.33.0 (2aa4c46cf 2019-02-28)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'

error: rustup is not installed at '/target/cargo'
  stable-x86_64-unknown-linux-gnu installed - rustc 1.33.0 (2aa4c46cf 2019-02-28)
@Nemo157 Nemo157 added the bug label Apr 8, 2019
@kinnison
Copy link
Contributor

kinnison commented Apr 9, 2019

Interesting. Are you able to bisect between 1.16.0 and 1.17.0 to find the commit which causes this to occur? I am not really au-fait with docker so don't know how I'd do that myself.

@Nemo157
Copy link
Member Author

Nemo157 commented Apr 9, 2019

These were just the docker images I’ve been using in CI so was the easiest way to test without affecting my system, I only have these two versions of rustup installed in them.

I can probably give bisecting a go later today.

@kinnison
Copy link
Contributor

kinnison commented Apr 9, 2019

Thank you.

@Nemo157
Copy link
Member Author

Nemo157 commented Apr 9, 2019

I found some time to do it earlier, first failing commit is 9f532de

commit 9f532de4d33330a35d4164a7d2faad68a6b7addb
Author: Nick Cameron <nrc@ncameron.org>
Date:   Thu Dec 6 14:15:19 2018 -0500

    self update after updating a single toolchain

which makes sense, the other issues I noticed related to this error message were from running rustup self update.

It looks like this can be suppressed with --no-self-update, but that doesn't appear to be mentioned in rustup update --help.

Nemo157 added a commit to Nemo157/circleci-rust that referenced this issue Apr 9, 2019
@kinnison
Copy link
Contributor

kinnison commented Apr 9, 2019

Interesting, thank you.

The --no-self-update option is indeed deliberately hidden, perhaps @nrc can explain why?

@nrc
Copy link
Member

nrc commented Apr 11, 2019

The --no-self-update option is indeed deliberately hidden, perhaps @nrc can explain why?

I cannot. I think it should be documented.

@kinnison
Copy link
Contributor

I cannot. I think it should be documented.

OK, thanks, I'll see if I can get to that if you don't before me.

@Nemo157 would that be sufficient for you, or do you think there's a better error we might give in this circumstance?

@Nemo157
Copy link
Member Author

Nemo157 commented Apr 11, 2019

That seems fine. You could consider adding some context to the error message so that users know it's self-update related, but this seems like a niche enough use-case.

I think the real fix would be decoupling the environment variables that determine where rustup is installed and where cargo caches the registry & crates, but seeing as RFC1615 has been stuck for almost 3 years and it's somewhat related, I don't see that happening anytime soon.

@kinnison
Copy link
Contributor

OK thanks, I'll assign this to myself to remind me to get some documentation around --no-self-update done, but I'm not sure it's worth complicating the error path there. As you say, the decoupling has been, erm, on-pause :D

@kinnison kinnison self-assigned this Apr 11, 2019
kinnison added a commit to kinnison/rustup that referenced this issue Apr 14, 2019
Fixes: rust-lang#1742

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants