-
Notifications
You must be signed in to change notification settings - Fork 390
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
add CROSS_CUSTOM_TOOLCHAIN
to disable automatic target component downloading
#803
Conversation
ping @NobodyXu does this work for you? I've been trying to replicate your errors but I can't manage to do it. That to me means its either an indication of me not understanding the issue, something being fishy with our implementation of PPCle or something sometimes working and sometimes not. Anyway, this should solve the issue of using cross with a custom toolchain (that is rustup compatible) |
ea52082
to
e84d948
Compare
CROSS_CUSTOM_TOOLCHAIN
to disable certain rustup commandsCROSS_CUSTOM_TOOLCHAIN
to disable automatic target component downloading
I don't think this will work because the custom toolchains are installed dynamically and won't necessarily have the desired target added for cross-compiling. This would work if the custom toolchain was installed by the user with every feature desired already, but For |
I think I've tried it enough, it works |
The way to use this with #!/usr/bin/env bash
export CROSS_CUSTOM_TOOLCHAIN=1
exec cross run --target powerpc64le-unknown-linux-gnu |
Let me have a try. |
Once I finish a few commits, I'll try as well with a guaranteed failing command and see how it works. |
Worked on my machine: $ cargo bisect-rustc -vv --script=./test.sh --target powerpc64le-unknown-linux-gnu
installing nightly-2022-06-16
testing...
+ export CROSS_CUSTOM_TOOLCHAIN=1
+ CROSS_CUSTOM_TOOLCHAIN=1
+ exec cross run -vv --target powerpc64le-unknown-linux-gnu
+ "/home/nobodyxu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo" "metadata" "--format-version=1" "--filter-platform" "powerpc64le-unknown-linux-gnu"
+ "rustc" "--print" "sysroot"
+ "rustup" "toolchain" "list"
+ "/usr/bin/docker" "--help"
+ "/usr/bin/docker" "run" "--userns" "host" "-e" "PKG_CONFIG_ALLOW_CROSS=1" "-e" "XARGO_HOME=/xargo" "-e" "CARGO_HOME=/cargo" "-e" "CARGO_TARGET_DIR=/target" "-e" "CROSS_RUNNER=" "-e" "USER=nobodyxu" "--rm" "--user" "1000:1000" "-v" "/home/nobodyxu/.xargo:/xargo:Z" "-v" "/home/nobodyxu/.cargo:/cargo:Z" "-v" "/cargo/bin" "-v" "/home/nobodyxu/tests:/project:Z" "-v" "/home/nobodyxu/.rustup/toolchains/bisector-nightly-2022-06-16-x86_64-unknown-linux-gnu:/rust:Z,ro" "-v" "/home/nobodyxu/tests/target-bisector-nightly-2022-06-16-x86_64-unknown-linux-gnu:/target:Z" "-w" "/project" "ghcr.io/cross-rs/powerpc64le-unknown-linux-gnu:main" "sh" "-c" "PATH=$PATH:/rust/bin cargo run -vv --target powerpc64le-unknown-linux-gnu"
Compiling tests v0.1.0 (/project)
Running `CARGO=/rust/bin/cargo CARGO_BIN_NAME=tests CARGO_CRATE_NAME=tests CARGO_MANIFEST_DIR=/project CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=tests CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/target/debug/deps:/rust/lib' rustc --crate-name tests --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=1eaf9da53e7e178c -C extra-filename=-1eaf9da53e7e178c --out-dir /target/powerpc64le-unknown-linux-gnu/debug/deps --target powerpc64le-unknown-linux-gnu -C linker=powerpc64le-linux-gnu-gcc -C incremental=/target/powerpc64le-unknown-linux-gnu/debug/incremental -L dependency=/target/powerpc64le-unknown-linux-gnu/debug/deps -L dependency=/target/debug/deps`
Finished dev [unoptimized + debuginfo] target(s) in 0.55s
Running `/linux-runner powerpc64le /target/powerpc64le-unknown-linux-gnu/debug/tests`
3.2
-inf
RESULT: nightly-2022-06-16, ===> No
uninstalling nightly-2022-06-16 and my
|
Awesome, however the interesting part is when it installs an "non-normal" toolchain, e.g one that rustup reports as a custom toolchain (i.e installed with In an unrelated note to this specific pr, I can't replicate the behaviour you suggest in your rustc issue, e.g I can't find a date which reproduces the issue of |
Nevermind this does work as long as you provide the |
don't think you need to add it, I've filed rust-lang/cargo-bisect-rustc#159 which would fix it automagically (with #804) |
This was a Qemu error 🙃. This was actually the exact bug for the exact target I started contributing to this repository in the first place. |
Oops Never thought it was a Qemu error... Edit: If so, then why does it succeeded after I upgraded the nightly toolchain but yet failed again after some upgrade? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. I'm assuming we want to just check if the envvar is set, rather than it's truthy?
the specific qemu error was fixed as part of #609 there might have been a mix of qemu errors and alignment errors on rustc, hard to say for sure without knowing exactly what was done |
The old releases for cross used a much older Qemu version. We (as in I, I'll accept that mistake) then pinned it to Qemu 3.x because of a similar bug, but this causes other issues that were fixed in 4.x. We now installed off-of-main use 5.x, which fixes all these issues. |
I think (hope) no one sets it when not needed, worst case that happens when it's set is that the user doesn't get easy downloading of needed components lets ship it bors r=Alexhuszagh |
It totally didn't occur to me that it involves Qemu bugs |
;) do note also that cross, while using newer qemu, doesn't still use the newest, for that we need #587 |
Build succeeded: |
This adds an environment variable
CROSS_CUSTOM_TOOLCHAIN
to disable some rustup commands.The way to use this with
cargo-bisect-rustc
iscargo bisect-rustc --script=./bisect.sh --target powerpc64le-unknown-linux-gnu
and the script isI've filed rust-lang/cargo-bisect-rustc#159 to avoid the pitfall that was discovered when not specifying
--target
resolves #699