Skip to content

[WIP] [WIP] Enable automatic cross-compilation in run-make tests #139244

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

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Apr 2, 2025

WIP for the WIP #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
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: aarch64-apple
try-job: x86_64-apple-1

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 2, 2025
@jieyouxu jieyouxu added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 2, 2025
@jieyouxu
Copy link
Member Author

jieyouxu commented Apr 2, 2025

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 2, 2025
…<try>

[WIP] [WIP] Enable automatic cross-compilation in run-make tests

WIP for the WIP rust-lang#138066.

Based on rust-lang#138066 with rust-lang#139242 + rust-lang#139239 cherry-picked in, plus `rustdoc()` cross-compile changes.

r? `@ghost`

try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: i686-mingw-1
try-job: aarch64-apple
try-job: x86_64-apple-1
@bors
Copy link
Collaborator

bors commented Apr 2, 2025

⌛ Trying commit c09efec with merge a0afa67...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Apr 2, 2025

💔 Test failed - checks-actions

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 2, 2025
@bors
Copy link
Collaborator

bors commented Apr 2, 2025

☔ The latest upstream changes (presumably #139257) made this pull request unmergeable. Please resolve the merge conflicts.

@jieyouxu jieyouxu force-pushed the exp/auto-cross-run-make branch from c09efec to 9140e31 Compare April 4, 2025 03:19
@jieyouxu
Copy link
Member Author

jieyouxu commented Apr 4, 2025

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 4, 2025
…<try>

[WIP] [WIP] Enable automatic cross-compilation in run-make tests

WIP for the WIP rust-lang#138066.

Based on rust-lang#138066 with rust-lang#139242 + rust-lang#139239 cherry-picked in, plus `rustdoc()` cross-compile changes.

r? `@ghost`

try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: i686-mingw-1
try-job: aarch64-apple
try-job: x86_64-apple-1
@bors
Copy link
Collaborator

bors commented Apr 4, 2025

⌛ Trying commit 9140e31 with merge a58362d...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Apr 4, 2025

💔 Test failed - checks-actions

@jieyouxu jieyouxu requested a review from Copilot April 7, 2025 07:05
@jieyouxu
Copy link
Member Author

jieyouxu commented Apr 7, 2025

Aaaaa I accidentally clicked again 💀

@jieyouxu jieyouxu removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 7, 2025
Copilot

This comment was marked as off-topic.

@bors
Copy link
Collaborator

bors commented Apr 12, 2025

☔ The latest upstream changes (presumably #139242) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 12, 2025
@jieyouxu jieyouxu force-pushed the exp/auto-cross-run-make branch from 9140e31 to 520d534 Compare April 13, 2025 02:39
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2025
…=<try>

[WIP] Enable automatic cross-compilation for run-make rustdoc tests

Extracted out of rust-lang#139244.
Helps with rust-lang#138066.

r? `@ghost`

try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: aarch64-apple
try-job: x86_64-apple-1
@jieyouxu
Copy link
Member Author

@bors try

@bors
Copy link
Collaborator

bors commented Apr 13, 2025

⌛ Trying commit 520d534 with merge 8efb167...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2025
…<try>

[WIP] [WIP] Enable automatic cross-compilation in run-make tests

WIP for the WIP rust-lang#138066.

Based on rust-lang#138066 with rust-lang#139242 + rust-lang#139239 cherry-picked in, plus `rustdoc()` cross-compile changes.

r? `@ghost`

try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: aarch64-apple
try-job: x86_64-apple-1
@jieyouxu jieyouxu force-pushed the exp/auto-cross-run-make branch from 676eada to 8d6ff0e Compare April 19, 2025 04:50
@jieyouxu
Copy link
Member Author

@bors try

@bors
Copy link
Collaborator

bors commented Apr 19, 2025

⌛ Trying commit 8d6ff0e with merge 5a77c4a...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 19, 2025
…<try>

[WIP] [WIP] Enable automatic cross-compilation in run-make tests

WIP for the WIP rust-lang#138066.

Based on rust-lang#138066 with rust-lang#139242 + rust-lang#139239 cherry-picked in, plus `rustdoc()` cross-compile changes.

r? `@ghost`

try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: aarch64-apple
try-job: x86_64-apple-1
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Apr 19, 2025

💔 Test failed - checks-actions

@jieyouxu jieyouxu force-pushed the exp/auto-cross-run-make branch from 8d6ff0e to 150c4cc Compare April 19, 2025 05:20
@jieyouxu
Copy link
Member Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 19, 2025
…<try>

[WIP] [WIP] Enable automatic cross-compilation in run-make tests

WIP for the WIP rust-lang#138066.

Based on rust-lang#138066 with rust-lang#139242 + rust-lang#139239 cherry-picked in, plus `rustdoc()` cross-compile changes.

r? `@ghost`

try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: aarch64-apple
try-job: x86_64-apple-1
@bors
Copy link
Collaborator

bors commented Apr 19, 2025

⌛ Trying commit 150c4cc with merge a24bb16...

@bors
Copy link
Collaborator

bors commented Apr 19, 2025

💔 Test failed - checks-actions

@jieyouxu
Copy link
Member Author

💀

@folkertdev
Copy link
Contributor

most of the failing tests are for nvptx not having std, so that's another datapoint in favor of #141863.

Although, given that normal CI does not cross-compile the tests, it's really easy to add a new run-make test, forget to ignore targets without std, and then have that fail later down the line (e.g. in the bors queue).

rust-bors bot added a commit that referenced this pull request Jun 10, 2025
Implement `//@ needs-target-std` compiletest directive

Closes #141863.
Needed to unblock #139244 and #141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](#142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with #139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
try-job: test-various
try-job: armhf-gnu
fmease added a commit to fmease/rust that referenced this pull request Jun 10, 2025
Implement `//@ needs-target-std` compiletest directive

Closes rust-lang#141863.
Needed to unblock rust-lang#139244 and rust-lang#141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](rust-lang#142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang#139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 11, 2025
Implement `//@ needs-target-std` compiletest directive

Closes rust-lang#141863.
Needed to unblock rust-lang#139244 and rust-lang#141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](rust-lang#142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang#139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 11, 2025
Implement `//@ needs-target-std` compiletest directive

Closes rust-lang#141863.
Needed to unblock rust-lang#139244 and rust-lang#141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](rust-lang#142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang#139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 11, 2025
Implement `//@ needs-target-std` compiletest directive

Closes rust-lang#141863.
Needed to unblock rust-lang#139244 and rust-lang#141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](rust-lang#142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang#139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 11, 2025
Implement `//@ needs-target-std` compiletest directive

Closes rust-lang#141863.
Needed to unblock rust-lang#139244 and rust-lang#141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](rust-lang#142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang#139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
rust-timer added a commit that referenced this pull request Jun 11, 2025
Rollup merge of #142297 - jieyouxu:needs-target-std, r=Kobzol

Implement `//@ needs-target-std` compiletest directive

Closes #141863.
Needed to unblock #139244 and #141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](#142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with #139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jun 12, 2025
Implement `//@ needs-target-std` compiletest directive

Closes rust-lang/rust#141863.
Needed to unblock rust-lang/rust#139244 and rust-lang/rust#141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](rust-lang/rust#142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang/rust#139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
rust-bors bot added a commit that referenced this pull request Jun 12, 2025
ignore `run-make` tests that need `std` on targets without `std`

In particular, anything that includes `none` in the target triple, and `nvptx64-nvidia-cuda`. Right now we don't cross-compile the `run-make` tests, but we want to in the future.

This uses `//@ needs-target-std` introduced in #142297.

Useful for #139244 and #141856.

The modified files are based on running #141856 locally. It might be that #139244 uncovers some additional files, but that PR needs to be rebased (though actually I'd advice to rebase the non-test changes onto this PR, probably faster that way).

r? `@jieyouxu`

<details>
  <summary>vim notes for future me</summary>

Make a file with lines like this

```
/home/folkertdev/rust/rust/tests/run-make/export/disambiguator/rmake.rs:1:1
/home/folkertdev/rust/rust/tests/run-make/invalid-so/rmake.rs:1:1
/home/folkertdev/rust/rust/tests/run-make/no-builtins-attribute/rmake.rs:1:1
/home/folkertdev/rust/rust/tests/run-make/export/extern-opt/rmake.rs:1:1
/home/folkertdev/rust/rust/tests/run-make/link-dedup/rmake.rs:1:1
```

then

```
:set errorformat=%f:%l:%c
:cfile /tmp/files-to-fix.txt
```
```
:copen
:cnext
:cprev
```

are your friends

</details>

try-job: test-various
try-job: armhf-gnu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants