-
Notifications
You must be signed in to change notification settings - Fork 13.5k
forward the bootstrap runner
to run-make
#141856
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
base: master
Are you sure you want to change the base?
forward the bootstrap runner
to run-make
#141856
Conversation
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.
Thanks, one nit
|
||
fn main() { | ||
rustc().input("checkrust.rs").run(); | ||
rustc().input("checkrust.rs").target(target()).run(); |
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.
Remark: this will not be needed if I finish auto-cross #139244
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.
cool!
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.
I removed target(target()
bit now (yay!) and use the new needs-target-std
in that test file.
Do you happen to know which CI jobs? |
3f206ce
to
ab6646a
Compare
I really don't know what cross-compilation actually happens in our CI and would run this |
Let's give it a try. |
…r, r=<try> forward the bootstrap `runner` to `run-make` The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions. The configuration can look like this ```toml # in bootstrap.toml [target.s390x-unknown-linux-gnu] runner = "qemu-s390x -L /usr/s390x-linux-gnu" ``` Any C compilation automatically sets the correct target. Calls to rustc must use `.target(target())`. Then, a command like below will work by cross-compiling to the given target, and using the given runner for that target to execute the binary: ``` ./x test tests/run-make/c-link-to-rust-va-list-fn --target s390x-unknown-linux-gnu ``` The runner can also be used for e.g. running with `valgrind`. This PR also enables its use in the test case that I care about, hopefully that actually does work on the platforms that CI uses. We should probably run some try jobs to be sure? r? `@jieyouxu` try-job: test-various try-job: armhf-gnu
Reminder (for myself): if try job fails, use |
Unknown command "try`". |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
You probably need sth like |
Hmm, that directive is never actually used, and also does not solve the issue for that target. It is a known target, just not one that has |
Yeah, a proper fix is sth like EDIT: opened #141863 |
(Sorry, I wrote |
Apparently you need to explicitly exluce
|
ab6646a
to
e3fee6a
Compare
[WIP] Enable automatic cross-compilation in run-make tests > [!CAUTION] > > Stacked on top of #142414, needs rebase. Supersedes #138066. Blocker for #141856. Based on #138066 with #139242 + #139239 cherry-picked in, plus `rustdoc()` cross-compile changes. r? `@ghost` try-job: armhf-gnu try-job: test-various
[WIP] Enable automatic cross-compilation in run-make tests > [!CAUTION] > > Stacked on top of #142414, needs rebase. Supersedes #138066. Blocker for #141856. Based on #138066 with #139242 + #139239 cherry-picked in, plus `rustdoc()` cross-compile changes. r? `@ghost` try-job: armhf-gnu try-job: test-various
[WIP] Enable automatic cross-compilation in run-make tests > [!CAUTION] > > Stacked on top of #142414, needs rebase. Supersedes #138066. Blocker for #141856. Based on #138066 with #139242 + #139239 cherry-picked in, plus `rustdoc()` cross-compile changes. r? `@ghost` try-job: armhf-gnu try-job: test-various
272dfe8
to
abbf4a9
Compare
Enable automatic cross-compilation in run-make tests Supersedes #138066. Blocker for #141856. Based on #138066 plus `rustdoc()` cross-compile changes. ### Summary This PR automatically specifies `--target` to `rustc()` and `rustdoc()` to have `rustc`/`rustdoc` produce cross-compiled artifacts in run-make tests by default, unless: - `//@ ignore-cross-compile` is used, or - `bare_{rustc,rustdoc}` are used, or - Explicit `.target()` is specified, which overrides the default cross-compile target. Some tests are necessarily modified: - Tests that have `.target(target())` have that incantation removed (since this is now automatically the default). - Some tests have `//@ needs-target-std`, but are a necessary-but-insufficient condition, and are changed to `//@ ignore-cross-compile` instead as host-only tests. - A few tests received `//@ ignore-musl` that fail against `x86_64-unknown-linux-musl` because of inability to find `-lunwind`. AFAICT, they don't *need* to test cross-compiled artifacts. - Some tests are constrained to host-only for now, because the effort to make them pass on cross-compile does not seem worth the complexity, and it's not really *meaningfully* improving test coverage. try-job: armhf-gnu try-job: test-various
Enable automatic cross-compilation in run-make tests Supersedes #138066. Blocker for #141856. Based on #138066 plus `rustdoc()` cross-compile changes. ### Summary This PR automatically specifies `--target` to `rustc()` and `rustdoc()` to have `rustc`/`rustdoc` produce cross-compiled artifacts in run-make tests by default, unless: - `//@ ignore-cross-compile` is used, or - `bare_{rustc,rustdoc}` are used, or - Explicit `.target()` is specified, which overrides the default cross-compile target. Some tests are necessarily modified: - Tests that have `.target(target())` have that incantation removed (since this is now automatically the default). - Some tests have `//@ needs-target-std`, but are a necessary-but-insufficient condition, and are changed to `//@ ignore-cross-compile` instead as host-only tests. - A few tests received `//@ ignore-musl` that fail against `x86_64-unknown-linux-musl` because of inability to find `-lunwind`. AFAICT, they don't *need* to test cross-compiled artifacts. - Some tests are constrained to host-only for now, because the effort to make them pass on cross-compile does not seem worth the complexity, and it's not really *meaningfully* improving test coverage. try-job: dist-various-1 try-job: dist-various-1
Enable automatic cross-compilation in run-make tests Supersedes #138066. Blocker for #141856. Based on #138066 plus `rustdoc()` cross-compile changes. ### Summary This PR automatically specifies `--target` to `rustc()` and `rustdoc()` to have `rustc`/`rustdoc` produce cross-compiled artifacts in run-make tests by default, unless: - `//@ ignore-cross-compile` is used, or - `bare_{rustc,rustdoc}` are used, or - Explicit `.target()` is specified, which overrides the default cross-compile target. Some tests are necessarily modified: - Tests that have `.target(target())` have that incantation removed (since this is now automatically the default). - Some tests have `//@ needs-target-std`, but are a necessary-but-insufficient condition, and are changed to `//@ ignore-cross-compile` instead as host-only tests. - A few tests received `//@ ignore-musl` that fail against `x86_64-unknown-linux-musl` because of inability to find `-lunwind`. AFAICT, they don't *need* to test cross-compiled artifacts. - Some tests are constrained to host-only for now, because the effort to make them pass on cross-compile does not seem worth the complexity, and it's not really *meaningfully* improving test coverage. try-job: dist-various-1
abbf4a9
to
8eef8cf
Compare
@rustbot review |
The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions.
8eef8cf
to
d023fe7
Compare
Enable automatic cross-compilation in run-make tests Supersedes rust-lang/rust#138066. Blocker for rust-lang/rust#141856. Based on rust-lang/rust#138066 plus `rustdoc()` cross-compile changes. ### Summary This PR automatically specifies `--target` to `rustc()` and `rustdoc()` to have `rustc`/`rustdoc` produce cross-compiled artifacts in run-make tests by default, unless: - `//@ ignore-cross-compile` is used, or - `bare_{rustc,rustdoc}` are used, or - Explicit `.target()` is specified, which overrides the default cross-compile target. Some tests are necessarily modified: - Tests that have `.target(target())` have that incantation removed (since this is now automatically the default). - Some tests have `//@ needs-target-std`, but are a necessary-but-insufficient condition, and are changed to `//@ ignore-cross-compile` instead as host-only tests. - A few tests received `//@ ignore-musl` that fail against `x86_64-unknown-linux-musl` because of inability to find `-lunwind`. AFAICT, they don't *need* to test cross-compiled artifacts. - Some tests are constrained to host-only for now, because the effort to make them pass on cross-compile does not seem worth the complexity, and it's not really *meaningfully* improving test coverage. try-job: dist-various-1
@bors2 try |
…r, r=<try> forward the bootstrap `runner` to `run-make` The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions. The configuration can look like this ```toml # in bootstrap.toml [target.s390x-unknown-linux-gnu] runner = "qemu-s390x -L /usr/s390x-linux-gnu" ``` Any C compilation automatically sets the correct target. Calls to rustc must use `.target(target())`. Then, a command like below will work by cross-compiling to the given target, and using the given runner for that target to execute the binary: ``` ./x test tests/run-make/c-link-to-rust-va-list-fn --target s390x-unknown-linux-gnu ``` The runner can also be used for e.g. running with `valgrind`. This PR also enables its use in the test case that I care about, hopefully that actually does work on the platforms that CI uses. We should probably run some try jobs to be sure? r? `@jieyouxu` try-job: test-various try-job: armhf-gnu
@bors r+ rollup=never |
…r, r=jieyouxu forward the bootstrap `runner` to `run-make` The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions. The configuration can look like this ```toml # in bootstrap.toml [target.s390x-unknown-linux-gnu] runner = "qemu-s390x -L /usr/s390x-linux-gnu" ``` Any C compilation automatically sets the correct target. Calls to rustc must use `.target(target())`. Then, a command like below will work by cross-compiling to the given target, and using the given runner for that target to execute the binary: ``` ./x test tests/run-make/c-link-to-rust-va-list-fn --target s390x-unknown-linux-gnu ``` The runner can also be used for e.g. running with `valgrind`. This PR also enables its use in the test case that I care about, hopefully that actually does work on the platforms that CI uses. We should probably run some try jobs to be sure? r? `@jieyouxu` try-job: test-various try-job: armhf-gnu
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
Hmm, https://developer.android.com/ndk/guides/stable_apis#c_library makes me believe that maybe
Should we dig into that, or just ignore android here? (at the moment, most |
The runner was already forwarded to
compiletest
, this just passes it on torun-make
and uses it in therun
functions.The configuration can look like this
Any C compilation automatically sets the correct target. Calls to rustc must use
.target(target())
. Then, a command like below will work by cross-compiling to the given target, and using the given runner for that target to execute the binary:The runner can also be used for e.g. running with
valgrind
.This PR also enables its use in the test case that I care about, hopefully that actually does work on the platforms that CI uses. We should probably run some try jobs to be sure?
r? @jieyouxu
try-job: test-various
try-job: armhf-gnu