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

builds fail due to missing components on non tier 1 platforms using the default profile #2068

Closed
estokes opened this issue Oct 16, 2019 · 2 comments · Fixed by #2074
Closed

Comments

@estokes
Copy link

estokes commented Oct 16, 2019

Problem
On platforms that don't have rustfmt and/or clippy, packages that use a rust-toolchain file that contains a toolchain that isn't already present on the host machine will fail because cargo does not call rustup with the --force option. e.g.

$ rustup toolchain install nightly-2019-10-02-powerpc64le-unknown-linux-gnu         
info: syncing channel updates for 'nightly-2019-10-02-powerpc64le-unknown-linux-gnu'
info: latest update on 2019-10-02, rust version 1.40.0-nightly (702b45e40 2019-10-01)
error: some components unavailable for download for channel nightly-2019-10-02: 'clippy', 'rustfmt'
If you require these components, please install and use the latest successful build version,
which you can find at <https://rust-lang.github.io/rustup-components-history>.

After determining the correct date, install it with a command such as:

    rustup toolchain install nightly-2018-12-27

Then you can use the toolchain with commands such as:

    cargo +nightly-2018-12-27 build

This is problematic for 2 reasons. 1, it probably shouldn't happen at all unless the package actually depends on one of those tools, and 2, nothing in the above message says anything about --force being a thing, so it's not obvious how I can fix it. I had to ask on discord to figure that out.

$ rustup --version
rustup 1.20.2 (13979c968 2019-10-16)
@estokes estokes added the bug label Oct 16, 2019
@kinnison
Copy link
Contributor

So I think the right fix here is that if rustup decides to install a toolchain because it's missing (e.g. from an override) then we should force the installation so that it's more likely to succeed.

This ought to be a fairly small job to write (there're three sites which call install_from_dist() in the config.rs::Cfg code, and the one in update_all_channels() should be left alone. As such there are two sites to amend a boolean.

The difficulty will be in devising a nice set of tests to verify that this works. I'd be happy to mentor someone through this and I should be contacted on Discord if you want to help.

@BeniCheni
Copy link
Contributor

Friendly note: gonna tinker to try a fix. Will either open a PR or ask questions on Discord if stuck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants