Skip to content

Retry to install proxies during already up-to-date self update - #1310

Merged
alexcrichton merged 1 commit into
rust-lang:masterfrom
SimonSapin:update-installs-proxies
Dec 17, 2017
Merged

alexcrichton merged 1 commit into
rust-lang:masterfrom
SimonSapin:update-installs-proxies

Conversation

@SimonSapin

Copy link
Copy Markdown
Contributor

CC #1305, which this hopefully fixes.

@SimonSapin

Copy link
Copy Markdown
Contributor Author

I expected this to fail before this PR, but it already passes. So I don’t know if this PR actually fixes the problem.

diff --git a/tests/cli-self-upd.rs b/tests/cli-self-upd.rs
index c8bc9c4b..3a24f93a 100644
--- a/tests/cli-self-upd.rs
+++ b/tests/cli-self-upd.rs
@@ -1273,5 +1273,12 @@ fn update_does_not_overwrite_rustfmt() {
                          "`rustfmt` is already installed");
         assert!(rustfmt_path.exists());
         assert_eq!(utils::file_size(rustfmt_path).unwrap(), 0);
+
+        // Remove the file as suggested by the error "already installed" error message.
+        utils::remove_file("rustfmt", rustfmt_path).unwrap();
+        assert!(!rustfmt_path.exists());
+
+        expect_ok(config, &["rustup", "self", "update"]);
+        assert!(rustfmt_path.exists());
     });
 }

@alexcrichton

Copy link
Copy Markdown
Member

@SimonSapin it looks like the failures on CI may be related?

@SimonSapin
SimonSapin force-pushed the update-installs-proxies branch from 837ecab to ae57f64 Compare December 16, 2017 22:29
@SimonSapin
SimonSapin force-pushed the update-installs-proxies branch from ae57f64 to a914469 Compare December 16, 2017 23:19
@SimonSapin

Copy link
Copy Markdown
Contributor Author

Fixed.

@alexcrichton
alexcrichton merged commit cb2d148 into rust-lang:master Dec 17, 2017
@alexcrichton

Copy link
Copy Markdown
Member

@SimonSapin it looks like unfortunately this causes what I think is perhaps more buggy behavior?

Now every time I type rustup update it looks like rustup unconditionally downloads an update and then installs it (for itself).

@SimonSapin
SimonSapin deleted the update-installs-proxies branch December 19, 2017 01:30
@SimonSapin

Copy link
Copy Markdown
Contributor Author

Could you say more, maybe copy/paste the output? This PR hasn’t changed the code in prepare_update() that skips the download when available_version == current_version.

@alexcrichton

Copy link
Copy Markdown
Member

Every self update looks like

info: checking for self-updates
info: downloading self-update
info: rustup updated successfully to 1.8.0

and every update looks like:

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'beta-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: checking for self-updates
info: downloading self-update

   stable-x86_64-unknown-linux-gnu unchanged - rustc 1.22.1 (05e2e1c41 2017-11-22)
     beta-x86_64-unknown-linux-gnu unchanged - rustc 1.23.0-beta.2 (c9107ee93 2017-12-08)
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.24.0-nightly (dc39c3169 2017-12-17)

where strace confirms the latter is indeed downloading/relinking rustup.

@SimonSapin

Copy link
Copy Markdown
Contributor Author

https://static.rust-lang.org/rustup/release-stable.toml contains version = '1.7.0', https://dev-static.rust-lang.org/rustup/release-stable.toml contains version = '--live-run'.

@SimonSapin

Copy link
Copy Markdown
Contributor Author

#1315

@alexcrichton

Copy link
Copy Markdown
Member

Urgh well that's a bummer :(

Thanks for taking a look!

@alexcrichton

Copy link
Copy Markdown
Member

Hm that doesn't seem to have fixed the issue though?

@alexcrichton

Copy link
Copy Markdown
Member

Hm no wait hang on, that may be a cloudfront caching issue

@alexcrichton

Copy link
Copy Markdown
Member

Deployed!

@cbcoutinho

Copy link
Copy Markdown

I'm having this issue as well. At the last rustup update I got a warning to remove rustfmt and cargo-fmt, which I did using cargo uninstall rustfmt

Executing rustup update does nothing. Further I still have executables in .cargo/bin, for rustfmt and cargo-fmt. If this fix is only checking for he existence of those then it doesn't work.

Launching rustfmt results in the following error:

$ rustfmt
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not have the binary `rustfmt`

I get the same error for nightly

@alexcrichton

Copy link
Copy Markdown
Member

@cbcoutinho that's actually expected (albeit not a great error message)

You'll need to add the rustup component like so:

$ rustup component add rustfmt-preview --toolchain nightly

and then you can execute it via rustfmt +nightly ...

@systemtrap systemtrap mentioned this pull request Dec 20, 2017
@brendanzab

Copy link
Copy Markdown

Hmm, I tried this on macOS, but no luck:

λ rustup component add rustfmt-preview --toolchain nightly
error: toolchain 'nightly-x86_64-apple-darwin' does not contain component 'rustfmt-preview' for target 'x86_64-apple-darwin'

@brendanzab

Copy link
Copy Markdown

Oh, I'm guessing this might be because of a build failure? I seem to be missing rls as well since I ran rustup update:

λ rustup component add rls-preview --toolchain nightly
error: toolchain 'nightly-x86_64-apple-darwin' does not contain component 'rls-preview' for target 'x86_64-apple-darwin'

@brendanzab

brendanzab commented Dec 22, 2017 •

Copy link
Copy Markdown

nightly-2017-12-20 worked for me:

rustup toolchain install nightly-2017-12-20
rustup component add rust-analysis --toolchain nightly-2017-12-20
rustup component add rust-src --toolchain nightly-2017-12-20
rustup component add rls-preview --toolchain nightly-2017-12-20
rustup component add rustfmt-preview --toolchain nightly-2017-12-20

@olson-dan

Copy link
Copy Markdown

Note that this PR is alleged to have caused #1316

whilei added a commit to ethereumproject/go-ethereum that referenced this pull request Dec 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants