-
Notifications
You must be signed in to change notification settings - Fork 377
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
How to use cross with custom toolchains? #699
Comments
cross needs to know where the toolchain lives, I think it would be possible to support this, unless it's actually already supported. The error is due to this: Line 42 in 7599e1a
You should get a better output if you do also, make sure you have the latest (unreleased) cross, as there have been some changes, but I doubt they would fix this. My guess is that the way we discover sysroots and targets is not robust enough for bisect-rustc |
OK, I've installed the trunk version of
And
Edit:
|
@Emilgardis I think the problem is that After reading the
but it gives me the same output:
|
for cross to work, you'll need a toolchain that is |
@Emilgardis The main problem is that
So maybe |
I'm fairly reticent to add specific exceptions for custom rustc wrappers, however, we might be able to add a command-line flag or determine if the rustc command is not actually rustc? I don't think we should add exceptions for specific crates acting like they're rustc to not be rustc. Making the logic more general may warrant this functionality. |
I'm not reproducing this anymore: the error would have to be in exec rustc --version And |
Sure |
@Alexhuszagh Still encounter the same error:
|
Can you provide the output of |
Should be the same since I just reinstalled it (because broken libssl.1.1). I will post these info below. |
|
|
I'm reproducing this on stable but not nightly. FYI: I'm using a modified Stable $ rustc --version
rustc 1.61.0 (fe5b13d68 2022-05-18)
$ cargo-bisect-rustc --script=./script.sh -vv
installing nightly-2022-06-15
cargo for x86_64-unknown-linux-gnu: 6.56 MB / 6.56 MB [========================================================================================================================] 100.00 % 9.40 MB/s
testing...
+ "cargo" "metadata" "--format-version=1" "--filter-platform" "powerpc64le-unknown-linux-gnu"
+ "rustc" "--print" "sysroot"
default_toolchain="bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu"
+ "rustup" "toolchain" "list"
final toolchain="bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu"
+ "rustup" "target" "list" "--toolchain" "bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu"
Error:
0: `"rustup" "target" "list" "--toolchain" "bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu"` failed with exit code: exit status: 1 NIghtly ]$ rustc --version
rustc 1.63.0-nightly (ca122c7eb 2022-06-13)
$ cargo-bisect-rustc --script=./script.sh -vv
checking nightly-2022-06-14 from the currently installed default nightly toolchain as the last failure
installing nightly-2022-06-14
testing...
+ "cargo" "metadata" "--format-version=1" "--filter-platform" "powerpc64le-unknown-linux-gnu"
+ "rustc" "--print" "sysroot"
default_toolchain="nightly-x86_64-unknown-linux-gnu"
+ "rustup" "toolchain" "list"
final toolchain="nightly-x86_64-unknown-linux-gnu"
+ "rustup" "target" "list" "--toolchain" "nightly-x86_64-unknown-linux-gnu" I guess the short-term, quick-and-dirty solution would be to use nightly, but there should be a way to fix this on stable. |
Lines 316 to 320 in d90b016
This also doesn't seem to work when manually specifying the toolchain: $ cat run.sh
#!/bin/bash
exec /home/ahuszagh/git/cross/target/debug/cross +stable run -vv --target powerpc64le-unknown-linux-gnu
$ rustup run stable cargo-bisect-rustc --script=./run.sh -vv
installing nightly-2022-06-15
cargo for x86_64-unknown-linux-gnu: 6.56 MB / 6.56 MB [========================================================================================================================] 100.00 % 9.81 MB/s
testing...
+ "cargo" "metadata" "--format-version=1" "--filter-platform" "powerpc64le-unknown-linux-gnu"
host=X86_64UnknownLinuxGnu
+ "rustc" "--print" "sysroot"
default_toolchain="bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu"
+ "rustup" "toolchain" "list"
+ "rustup" "toolchain" "add" "stable-nightly-2022-06-15-x86_64-unknown-linux-gnu" "--profile" "minimal"
info: syncing channel updates for 'stable-nightly-2022-06-15-x86_64-unknown-linux-gnu'
info: latest update on 2022-05-19, rust version 1.61.0 (fe5b13d68 2022-05-18)
error: target 'nightly-2022-06-15-x86_64-unknown-linux-gnu' not found in channel. Perhaps check https://doc.rust-lang.org/nightly/rustc/platform-support.html for available targets
Error:
0: couldn't install toolchain `stable-nightly-2022-06-15-x86_64-unknown-linux-gnu`
1: `"rustup" "toolchain" "add" "stable-nightly-2022-06-15-x86_64-unknown-linux-gnu" "--profile" "minimal"` failed with exit code: exit status: 1
|
Sorry for the many notifications, but I doubt this is an issue in #!/bin/bash
set -x
sysroot="$(rustc --print sysroot)"
toolchain=$(basename "${sysroot}")
rustup target add powerpc64le-unknown-linux-gnu --toolchain "${toolchain}"
exec "rustup" "target" "list" "--toolchain" "${toolchain}" I've made a simple script that tries to add a target and then list the available targets, the former which is absolutely necessary for $ cargo-bisect-rustc --script=./list.sh -vv
installing nightly-2022-06-15
cargo for x86_64-unknown-linux-gnu: 6.56 MB / 6.56 MB [========================================================================================================================] 100.00 % 9.69 MB/s
testing...
++ rustc --print sysroot
+ sysroot=/home/ahuszagh/.rustup/toolchains/bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu
++ basename /home/ahuszagh/.rustup/toolchains/bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu
+ toolchain=bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu
+ rustup target add powerpc64le-unknown-linux-gnu --toolchain bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu
error: toolchain 'bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu' does not support components: bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu is a custom toolchain
+ exec rustup target list --toolchain bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu
error: toolchain 'bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu' does not support components: bisector-nightly-2022-06-15-x86_64-unknown-linux-gnu is a custom toolchain We can't add our target for cross-compilation to this toolchain, since it's custom. The reason why it works (spuriously) for me on nightly is because, and to quote their tutorial:
Look at So I guess the bigger question would be: can we support custom toolchains by adding the desired target in this case? |
Maintainer's Note: The original title was "How to use cargo-bisect-rustc with cross?", however, the issue is more general and deals with working with custom toolchains broadly, or at least specifically custom toolchains that are installed from Rust sources.
When running
cargo-bisect-rustc -vv --script=./test.sh
wheretest.sh
is:The
cross
command failed with:If I just run
cargo-bisect-rustc -vv
without usingcross
, then everything runs without problem.Is there any way to fix the problem?
The text was updated successfully, but these errors were encountered: