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

mac - can't cross build for any target #547

Closed
avnerbarr opened this issue Apr 6, 2021 · 6 comments
Closed

mac - can't cross build for any target #547

avnerbarr opened this issue Apr 6, 2021 · 6 comments
Labels
needs-information needs more information to replicate

Comments

@avnerbarr
Copy link

avnerbarr commented Apr 6, 2021

reproduce

cd /tmp/
mkdir test
cd test
cargo init
cargo run
# prints hello world as expected

now try to cross build

(all of the following were tried)

cross build --target aarch64-unknown-linux-gnu
cross build --target i686-pc-windows-gnu
cross build --target powerpc-unknown-linux-gnu
cross build --target aarch64-unknown-linux-gnu

# a single example here 👇 

 cross build --target aarch64-unknown-linux-gnu
warning: toolchain '1.51.0-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 '1.51.0-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
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'
 14.9 MiB /  14.9 MiB (100 %)   6.8 MiB/s in  1s 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 `1.51.0-x86_64-unknown-linux-gnu`
caused by: `"rustup" "toolchain" "add" "1.51.0-x86_64-unknown-linux-gnu"` failed with exit code: Some(1)
note: run with `RUST_BACKTRACE=1` for a backtrace

My setup is:

rustup show
Default host: x86_64-apple-darwin
rustup home:  /Users/avner/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin
1.50.0-x86_64-apple-darwin
1.51.0-x86_64-apple-darwin (default)

installed targets for active toolchain
--------------------------------------

x86_64-apple-darwin
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl

active toolchain
----------------

1.51.0-x86_64-apple-darwin (default)
rustc 1.51.0 (2fd73fabe 2021-03-23)


/tmp/avner$ cat ~/.rustup/settings.toml
default_toolchain = "1.51.0-x86_64-apple-darwin"
profile = "default"
version = "12"

[overrides]
/tmp/avner$


@olitha
Copy link
Contributor

olitha commented Apr 8, 2021

Hi, I don't know the details. But there is another issue open #522

As a workaround this worked for me. Install before compiling with cross the toolchain with minimal profile
rustup toolchain install --profile minimal stable-x86_64-unknown-linux-gnu

@avnerbarr
Copy link
Author

I've installed that per your suggestion.

printing my tool chains I have

installed toolchains
--------------------

stable-x86_64-apple-darwin
stable-x86_64-unknown-linux-gnu
nightly-x86_64-apple-darwin
1.49.0-x86_64-apple-darwin
1.49.0-x86_64-unknown-linux-gnu
1.50.0-x86_64-apple-darwin
1.51.0-x86_64-apple-darwin (default)

installed targets for active toolchain
--------------------------------------

x86_64-apple-darwin
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl

active toolchain
----------------

1.51.0-x86_64-apple-darwin (default)
rustc 1.51.0 (2fd73fabe 2021-03-23)

but still getting a build error:

error: failed to install component: 'rust-docs-x86_64-unknown-linux-gnu', detected conflict: '"share/doc/rust/html/std/keyword.self.html"'

@jiayihu
Copy link

jiayihu commented Apr 12, 2021

@olitha's suggestion worked for me too, maybe retry a clean install of rustup

@avnerbarr
Copy link
Author

when I use the nightly it works:

/tmp/foo$ cross +nightly build --target x86_64-unknown-linux-musl

@Alexhuszagh Alexhuszagh added the needs-information needs more information to replicate label May 29, 2022
@Alexhuszagh
Copy link
Contributor

I'd recommend doing a clean install, annoying but there's likely weird conflicts arising somewhere and I doubt this is specifically a cross issue, since this is effectively failing on rustup target add aarch64-unknown-linux-gnu.

@Alexhuszagh
Copy link
Contributor

Alexhuszagh commented Jul 2, 2022

Closed since #522 has been merged, which fixes this.

when I use the nightly it works:

That's likely because nightly doesn't have all the components, so it doesn't try to install conflicting components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-information needs more information to replicate
Projects
None yet
Development

No branches or pull requests

4 participants