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

specify the minimal profile when installing rust toolchain (due to bug in rustup?) #522

Merged
merged 1 commit into from
Sep 5, 2021

Conversation

blesson3
Copy link
Contributor

this is needed bc of some bug(?) in rustup not being able to install the necessary toolchain without error using the default profile, so the minimal profile is needed.

see my comment in the rustup project regarding this issue: rust-lang/rustup#2661 (comment)

this is the error I get when running cross

# clear all toolchains
$ rm -rf ~/.rustup                                       

$ cross build --target aarch64-unknown-linux-gnu
warning: toolchain 'nightly-x86_64-unknown-linux-gnu' may not be able to run on this system.
warning: If you meant to build software to target that platform, perhaps try `rustup target add x86_64-unknown-linux-gnu` instead?
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2021-02-22, rust version 1.52.0-nightly (3e826bb11 2021-02-21)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
 15.0 MiB /  15.0 MiB (100 %)  10.0 MiB/s in  1s ETA:  0s
info: downloading component 'rust-std'
 24.9 MiB /  24.9 MiB (100 %)  12.7 MiB/s in  2s ETA:  0s
info: downloading component 'rustc'
 47.9 MiB /  47.9 MiB (100 %)  13.5 MiB/s in  3s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: using up to 500.0 MiB of RAM to unpack components
info: installing component 'clippy'
info: installing component 'rust-docs'
 15.0 MiB /  15.0 MiB (100 %)   6.0 MiB/s in  2s ETA:  0s
info: rolling back changes
error: failed to install component: 'rust-docs-x86_64-unknown-linux-gnu', detected conflict: '"share/doc/rust/html/std/keyword.self.html"'
error: couldn't install toolchain `nightly-x86_64-unknown-linux-gnu`
caused by: `"rustup" "toolchain" "add" "nightly-x86_64-unknown-linux-gnu"` failed with exit code: Some(1)
note: run with `RUST_BACKTRACE=1` for a backtrace

I get the same error when running cross with the following (randomly selected toolchains)

  • aarch64-unknown-linux-gnu
  • armv7-linux-androideabi
  • thumbv6m-none-eabi
  • s390x-unknown-linux-gnu

cargo test seems to pass and cross-compilation seems to work okay now (with this PR).

Another work-around that isn't this pull request

install the toolchain outside of cross using the `minimal` profile, then run cross command
$ rm -rf ~/.rustup

$ rustup toolchain add nightly-x86_64-unknown-linux-gnu --profile minimal
warning: toolchain 'nightly-x86_64-unknown-linux-gnu' may not be able to run on this system.
warning: If you meant to build software to target that platform, perhaps try `rustup target add x86_64-unknown-linux-gnu` instead?
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2021-02-22, rust version 1.52.0-nightly (3e826bb11 2021-02-21)
info: downloading component 'cargo'
info: downloading component 'rust-std'
 24.9 MiB /  24.9 MiB (100 %)  12.4 MiB/s in  2s ETA:  0s
info: downloading component 'rustc'
 47.9 MiB /  47.9 MiB (100 %)  13.6 MiB/s in  3s ETA:  0s
info: installing component 'cargo'
info: using up to 500.0 MiB of RAM to unpack components
info: installing component 'rust-std'
 24.9 MiB /  24.9 MiB (100 %)  11.1 MiB/s in  2s ETA:  0s
info: installing component 'rustc'
 47.9 MiB /  47.9 MiB (100 %)  12.6 MiB/s in  3s ETA:  0s

  nightly-x86_64-unknown-linux-gnu installed - (error reading rustc version)

info: default toolchain set to 'nightly-x86_64-unknown-linux-gnu'
info: checking for self-updates

$ cross build --target aarch64-unknown-linux-gnu                         
info: downloading component 'rust-std' for 'aarch64-unknown-linux-gnu'
info: installing component 'rust-std' for 'aarch64-unknown-linux-gnu'
info: using up to 500.0 MiB of RAM to unpack components
 26.6 MiB /  26.6 MiB (100 %)  11.5 MiB/s in  2s ETA:  0s
   Compiling libc v0.2.77
   Compiling proc-macro2 v1.0.21
   Compiling syn v1.0.41
...

@blesson3 blesson3 requested review from Dylan-DPC-zz and a team as code owners February 22, 2021 22:52
@blesson3
Copy link
Contributor Author

blesson3 commented Feb 22, 2021

I definitely understand if the right solution here is updated documentation (instead of a code-change). I figured I would post the PR anyway in-case this is what was preferred.

this is needed bc of some bug(?) in rustup not being able to install the
necessary toolchain without error using the `default` profile

see my comment in the rustup project:
rust-lang/rustup#2661 (comment)
@UebelAndre
Copy link
Contributor

This seems strictly better since it would result in less data being downloaded. @Dylan-DPC Would you be able to take a look?

@reitermarkus
Copy link
Member

bors try

bors bot added a commit that referenced this pull request May 2, 2021
@bors
Copy link
Contributor

bors bot commented May 2, 2021

try

Build failed:

@blesson3
Copy link
Contributor Author

blesson3 commented May 2, 2021 via email

@reitermarkus
Copy link
Member

bors retry

bors bot added a commit that referenced this pull request Aug 29, 2021
@bors
Copy link
Contributor

bors bot commented Aug 29, 2021

try

Build succeeded:

Copy link
Member

@Emilgardis Emilgardis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@Emilgardis
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 5, 2021

Build succeeded:

@bors bors bot merged commit 2b2a012 into cross-rs:master Sep 5, 2021
@Emilgardis Emilgardis added this to the v0.2.2 milestone Jun 15, 2022
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.

4 participants