Skip to content
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

Migrate run-make/compressed-debuginfo to rmake.rs #126629

Merged

Conversation

GuillaumeGomez
Copy link
Member

Part of #121876.

r? @jieyouxu

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs 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 Jun 18, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jun 18, 2024

This PR modifies tests/run-make/. If this PR is trying to port a Makefile
run-make test to use rmake.rs, please update the
run-make port tracking issue
so we can track our progress. You can either modify the tracking issue
directly, or you can comment on the tracking issue and link this PR.

cc @jieyouxu

@lqd
Copy link
Member

lqd commented Jun 18, 2024

The makefile is quite subtle to handle cases where the optional compression type is not compiled in, as it requires enabling them in llvm before hand and readelf must be recent enough to support some as well (ie, it seems possible the translated test can fail because of missing zstd 🤔 )

@GuillaumeGomez
Copy link
Member Author

I found the Makefile really strange and I tried to translate what it was doing as best as possible. Do you see other cases I didn't handle correctly?

@lqd
Copy link
Member

lqd commented Jun 18, 2024

Yes I also find this test too unclear, but maybe we can wait to improve it until enabling zstd unconditionally.

Here, it normalized between unknown and missing cases that I believe was to handle the cases where zstd was missing at build time / present at build time but missing at run time (which is another touchy subtlety of the current implementation), and this may be what’s missing.

We may need to test all the combinations to make sure (but I’m on my phone rn :3). Maybe check that just in case? It’s hard to predict the contributors and CI systems that will execute it, and we wouldn’t want the test to fail for some people.

The lack of directives to help, and reliance on system readelf with unknown compression support also make the test hard to write in general.

Maybe we can make some improvements to the test in #125642 eg use the llvm-readelf so that compression support is known in advance, or maybe add compiletest directives to better check fallback cases with revisions for example.

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

I'm personally fine with the current version for now, but could you please leave a FIXME saying that this check isn't comprehensive or covering all possible combinations, and that readelf here might want to use llvm-readelf in the future?

Comment on lines 9 to 22
let out = rustc()
.crate_name("foo")
.crate_type("lib")
.emit("obj")
.arg("-Cdebuginfo=full")
.arg(&format!("-Zdebuginfo-compression={compression}"))
.input("foo.rs")
.run();
let stderr = out.stderr_utf8();
if stderr.is_empty() {
cmd("readelf").arg("-t").arg(path("foo.o")).run().assert_stdout_contains(to_find);
} else {
assert_contains(&stderr, &format!("unknown debuginfo compression algorithm {compression}"));
}
Copy link
Member

Choose a reason for hiding this comment

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

Discussion: I want to say that you may want to run each check inside run_in_tmpdir to prevent the output artifacts from potentially causing the checks to interfere with each other (at present, I think both check invocations work on the same foo.o). Don't think this is actually happening, but yeah.

@jieyouxu
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 18, 2024
@GuillaumeGomez GuillaumeGomez force-pushed the migrate-run-make-compressed-debuginfo branch from cca9b2e to 62431b7 Compare June 18, 2024 19:32
@GuillaumeGomez
Copy link
Member Author

Added FIXMEs and made test run in run_in_tmpdir.

@GuillaumeGomez
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 19, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks!

@jieyouxu
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 19, 2024

📌 Commit 62431b7 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 Jun 19, 2024
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jun 19, 2024
…mpressed-debuginfo, r=jieyouxu

Migrate `run-make/compressed-debuginfo` to `rmake.rs`

Part of rust-lang#121876.

r? `@jieyouxu`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 19, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#124807 (Migrate `run-make/rustdoc-io-error` to `rmake.rs`)
 - rust-lang#126095 (Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`)
 - rust-lang#126308 (Ban `ArrayToPointer` and `MutToConstPointer` from runtime MIR)
 - rust-lang#126620 (Actually taint InferCtxt when a fulfillment error is emitted)
 - rust-lang#126629 (Migrate `run-make/compressed-debuginfo` to `rmake.rs`)
 - rust-lang#126644 (Rewrite `extern-flag-rename-transitive`. `debugger-visualizer-dep-info`, `metadata-flag-frobs-symbols`, `extern-overrides-distribution` and `forced-unwind-terminate-pof` `run-make` tests to rmake)
 - rust-lang#126650 (Rename a bunch of things in the new solver and `rustc_type_ir`)

r? `@ghost`
`@rustbot` modify labels: rollup
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jun 19, 2024
…mpressed-debuginfo, r=jieyouxu

Migrate `run-make/compressed-debuginfo` to `rmake.rs`

Part of rust-lang#121876.

r? ``@jieyouxu``
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jun 19, 2024
…mpressed-debuginfo, r=jieyouxu

Migrate `run-make/compressed-debuginfo` to `rmake.rs`

Part of rust-lang#121876.

r? ```@jieyouxu```
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 20, 2024
Rollup of 9 pull requests

Successful merges:

 - rust-lang#126095 (Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`)
 - rust-lang#126534 (Migrate `run-make/comment-section` to `rmake.rs`)
 - rust-lang#126620 (Actually taint InferCtxt when a fulfillment error is emitted)
 - rust-lang#126629 (Migrate `run-make/compressed-debuginfo` to `rmake.rs`)
 - rust-lang#126644 (Rewrite `extern-flag-rename-transitive`. `debugger-visualizer-dep-info`, `metadata-flag-frobs-symbols`, `extern-overrides-distribution` and `forced-unwind-terminate-pof` `run-make` tests to rmake)
 - rust-lang#126650 (Rename a bunch of things in the new solver and `rustc_type_ir`)
 - rust-lang#126698 (Migrate `unknown-mod-stdin`, `issue-68794-textrel-on-minimal-lib`, `raw-dylib-cross-compilation` and `used-cdylib-macos` `run-make` tests to rmake)
 - rust-lang#126703 (reword the hint::blackbox non-guarantees)
 - rust-lang#126708 (Minimize `can_begin_literal_maybe_minus` usage)

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

Rollup of 6 pull requests

Successful merges:

 - rust-lang#126095 (Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`)
 - rust-lang#126629 (Migrate `run-make/compressed-debuginfo` to `rmake.rs`)
 - rust-lang#126644 (Rewrite `extern-flag-rename-transitive`. `debugger-visualizer-dep-info`, `metadata-flag-frobs-symbols`, `extern-overrides-distribution` and `forced-unwind-terminate-pof` `run-make` tests to rmake)
 - rust-lang#126735 (collect attrs in const block expr)
 - rust-lang#126737 (Remove `feature(const_closures)` from libcore)
 - rust-lang#126740 (add `needs-unwind` to UI test)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 54e097d into rust-lang:master Jun 20, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 20, 2024
Rollup merge of rust-lang#126629 - GuillaumeGomez:migrate-run-make-compressed-debuginfo, r=jieyouxu

Migrate `run-make/compressed-debuginfo` to `rmake.rs`

Part of rust-lang#121876.

r? ````@jieyouxu````
@GuillaumeGomez GuillaumeGomez deleted the migrate-run-make-compressed-debuginfo branch June 20, 2024 21:19
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 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
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants