Skip to content

Rewrite core-no-oom-handling, issue-24445 and issue-38237 run-make tests to new rmake.rs format #125421

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
May 23, 2024

Conversation

Oneirical
Copy link
Contributor

Part of #121876 and the associated Google Summer of Code project.

The test which is now called non-pie-thread-local has an unexplained "only-linux" flag. Could it be worth trying to remove it and changing the CI to test non-Linux platforms on it?

@rustbot
Copy link
Collaborator

rustbot commented May 22, 2024

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 22, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 22, 2024

Some changes occurred in run-make tests.

cc @jieyouxu

The run-make-support library was changed

cc @jieyouxu

@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the bundle-them-yet-again branch from 701cb37 to 670e401 Compare May 22, 2024 20:06
Comment on lines 1 to 2
// This test checks that the core library can still compile correctly
// when the no_global_oom_handling feature is turned on.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: it only tests that compilation succeeds, it does not check for correctness.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote that exact "correctly" terminology in a couple of similar tests to this one, so I have changed them as well. Thanks!

Comment on lines +1 to +5
// A very specific set of circumstances (mainly, implementing Deref, and
// having a procedural macro and a Debug derivation in external crates) caused
// an internal compiler error (ICE) when trying to use rustdoc. This test
// reproduces the exact circumstances which caused the bug and checks
// that it does not happen again.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not-a-review-comment: this is very specific... it must've been a pain to figure out lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, right? I find it especially hilarious that the fix for all this, in the linked PR, is literally just adding a single line of code.

@jieyouxu
Copy link
Member

One minor nit for a test comment, then r=me after CI is green
@bors delegate+

@bors
Copy link
Collaborator

bors commented May 22, 2024

✌️ @Oneirical, you can now approve this pull request!

If @jieyouxu told you to "r=me" after making some further change, please make that change, then do @bors r=@jieyouxu

@Oneirical Oneirical force-pushed the bundle-them-yet-again branch from 670e401 to aa9ef5c Compare May 22, 2024 20:40
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the bundle-them-yet-again branch from aa9ef5c to 1676d84 Compare May 22, 2024 22:04
@rust-log-analyzer

This comment has been minimized.

.arg("--gc-sections")
.arg("-lpthread")
.arg("-ldl")
.out_exe(tmp_dir().join("foo"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC out_exe tries to construct the executable path under tmp_dir() already, so you just need to pass the exe name, i.e. "foo" here.

@Oneirical Oneirical force-pushed the bundle-them-yet-again branch from 844a2bc to 33f08fa Compare May 22, 2024 23:42
@jieyouxu
Copy link
Member

Thanks, r=me after CI is green
@bors delegate+ rollup

@bors
Copy link
Collaborator

bors commented May 23, 2024

✌️ @Oneirical, you can now approve this pull request!

If @jieyouxu told you to "r=me" after making some further change, please make that change, then do @bors r=@jieyouxu

@rust-log-analyzer

This comment has been minimized.

@Oneirical
Copy link
Contributor Author

cc: error: unrecognized command-line option ‘-Wl’; did you mean ‘-W’?
cc: error: unrecognized command-line option ‘--gc-sections’; did you mean ‘--data-sections’?

Well, that's an unexpected error. Here is what I think I understand: there are multiple C compilers, and we want to use GCC, as it is the one that has the -Wl and --gc-sections flags. However, a different compiler was used in the CI, such as Clang?

I also notice how this test has only-linux activated, which may indicate that it wants some specificity.

Is it possible that, in the past where this test was written, the GNU/Linux CI was using GCC by default, and that changed? But then, how could the Makefile version of the test keep passing?

I may need your help on this one.

@jieyouxu
Copy link
Member

jieyouxu commented May 23, 2024

Well, that's an unexpected error. Here is what I think I understand: there are multiple C compilers, and we want to use GCC, as it is the one that has the -Wl and --gc-sections flags. However, a different compiler was used in the CI, such as Clang?

Not quite: clang and gcc has similar CLI interfaces on this one (e.g. https://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-Wl-args). The catch here is that the cli flag takes the form

$CC -Wl,<args> // <- notice the comma `,` and `<args>` **immediately** after comma, no whitespace

So they're actually taking <args> and forwarding it to the linker...

That is,

$CC -Wl --gc-sections

is different from

$CC -Wl,--gc-sections

lol.

You needed to write .arg("-Wl,--gc-sections") instead of .arg("-Wl").arg("--gc-sections").

@Oneirical Oneirical force-pushed the bundle-them-yet-again branch from 33f08fa to 1f17e27 Compare May 23, 2024 02:49
@Oneirical
Copy link
Contributor Author

Oneirical commented May 23, 2024

You needed to write .arg("-Wl,--gc-sections") instead of .arg("-Wl").arg("--gc-sections").

I think the run-make House of Horror just claimed a new guest...

Thank you so much for figuring this out, I was digging a serious rabbit hole in obscure documentation...

Well, no victory just yet, let's see what the CI has to say about it.

@Oneirical
Copy link
Contributor Author

@bors r=@jieyouxu

@bors
Copy link
Collaborator

bors commented May 23, 2024

📌 Commit 1f17e27 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 23, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 23, 2024
…=jieyouxu

Rewrite `core-no-oom-handling`, `issue-24445` and `issue-38237` `run-make` tests to new `rmake.rs` format

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

The test which is now called `non-pie-thread-local` has an unexplained "only-linux" flag. Could it be worth trying to remove it and changing the CI to test non-Linux platforms on it?
bors added a commit to rust-lang-ci/rust that referenced this pull request May 23, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#125165 (Migrate `run-make/pgo-branch-weights` to `rmake`)
 - rust-lang#125210 (Cleanup: Fix up some diagnostics)
 - rust-lang#125224 (Migrate `run-make/issue-53964` to `rmake`)
 - rust-lang#125227 (Migrate `run-make/issue-30063` to `rmake`)
 - rust-lang#125383 (Rewrite `emit`, `mixing-formats` and `bare-outfile` `run-make` tests in `rmake.rs` format)
 - rust-lang#125401 (Migrate `run-make/rustdoc-scrape-examples-macros` to `rmake.rs`)
 - rust-lang#125409 (Rename `FrameworkOnlyWindows` to `RawDylibOnlyWindows`)
 - rust-lang#125416 (Use correct param-env in `MissingCopyImplementations`)
 - rust-lang#125421 (Rewrite `core-no-oom-handling`, `issue-24445` and `issue-38237` `run-make` tests to new `rmake.rs` format)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 23, 2024
…=jieyouxu

Rewrite `core-no-oom-handling`, `issue-24445` and `issue-38237` `run-make` tests to new `rmake.rs` format

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

The test which is now called `non-pie-thread-local` has an unexplained "only-linux" flag. Could it be worth trying to remove it and changing the CI to test non-Linux platforms on it?
bors added a commit to rust-lang-ci/rust that referenced this pull request May 23, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#125210 (Cleanup: Fix up some diagnostics)
 - rust-lang#125224 (Migrate `run-make/issue-53964` to `rmake`)
 - rust-lang#125227 (Migrate `run-make/issue-30063` to `rmake`)
 - rust-lang#125383 (Rewrite `emit`, `mixing-formats` and `bare-outfile` `run-make` tests in `rmake.rs` format)
 - rust-lang#125401 (Migrate `run-make/rustdoc-scrape-examples-macros` to `rmake.rs`)
 - rust-lang#125409 (Rename `FrameworkOnlyWindows` to `RawDylibOnlyWindows`)
 - rust-lang#125416 (Use correct param-env in `MissingCopyImplementations`)
 - rust-lang#125421 (Rewrite `core-no-oom-handling`, `issue-24445` and `issue-38237` `run-make` tests to new `rmake.rs` format)
 - rust-lang#125438 (Remove unneeded string conversion)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 23, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#124297 (Allow coercing functions whose signature differs in opaque types in their defining scope into a shared function pointer type)
 - rust-lang#124516 (Allow monomorphization time const eval failures if the cause is a type layout issue)
 - rust-lang#124976 (rustc: Use `tcx.used_crates(())` more)
 - rust-lang#125210 (Cleanup: Fix up some diagnostics)
 - rust-lang#125409 (Rename `FrameworkOnlyWindows` to `RawDylibOnlyWindows`)
 - rust-lang#125416 (Use correct param-env in `MissingCopyImplementations`)
 - rust-lang#125421 (Rewrite `core-no-oom-handling`, `issue-24445` and `issue-38237` `run-make` tests to new `rmake.rs` format)
 - rust-lang#125438 (Remove unneeded string conversion)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit eb1b9b0 into rust-lang:master May 23, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 23, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 23, 2024
Rollup merge of rust-lang#125421 - Oneirical:bundle-them-yet-again, r=jieyouxu

Rewrite `core-no-oom-handling`, `issue-24445` and `issue-38237` `run-make` tests to new `rmake.rs` format

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

The test which is now called `non-pie-thread-local` has an unexplained "only-linux" flag. Could it be worth trying to remove it and changing the CI to test non-Linux platforms on it?
@Oneirical Oneirical deleted the bundle-them-yet-again branch May 23, 2024 19:08
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants