Migrate split-debuginfo run-make test to rmake by Oneirical · Pull Request #128754 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation19 Commits1 Checks6 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

Oneirical

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

Possibly the most epic test rewrite yet in this project.

Please try:

try-job: test-various
try-job: aarch64-apple

@rustbot

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-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

Aug 6, 2024

@rustbot

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

The run-make-support library was changed

cc @jieyouxu

@Oneirical

@rustbot rustbot added S-blocked

Status: Blocked on something else such as an RFC or other implementation work.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Aug 6, 2024

@bors

jieyouxu

@jieyouxu jieyouxu added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

and removed S-blocked

Status: Blocked on something else such as an RFC or other implementation work.

labels

Aug 8, 2024

@jieyouxu

I won't have time to review this before our meeting tomorrow, I'll try to get to it tomorrow.

@Oneirical

I won't have time to review this before our meeting tomorrow, I'll try to get to it tomorrow.

Rust maintainers? Sleeping? What is this?

No rush, I am quite sure that there will not be any further test ports dependent on another one, so we can deal with each individual remaining case on its own.

@bors

jieyouxu

Choose a reason for hiding this comment

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

Thanks, I have some interim feedback.

Comment on lines +405 to +570

// Some non-Windows, non-Darwin platforms are not stable, and some are.
fn unstable_rustc() -> Rustc {
let mut compiler = rustc();
if !target().contains("linux") {
compiler.arg("-Zunstable-options");
}

Choose a reason for hiding this comment

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

Question: the impl here is for non-linux, it doesn't quite match up with the comment?

Choose a reason for hiding this comment

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

The comment is from the original Makefile:

# Some non-Windows, non-Darwin platforms are not stable, and some are.
ifeq ($(UNAME),Linux)
  UNSTABLEOPTS :=
else
  UNSTABLEOPTS := -Zunstable-options
endif

I am open to inverting the comment to read "Some non-Linux platforms are not stable, and some are."

@jieyouxu jieyouxu 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

Sep 16, 2024

@Oneirical

@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

Sep 19, 2024

@rust-log-analyzer

This comment has been minimized.

@Oneirical

@bors

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 16, 2025

@bors

tests: Port split-debuginfo to rmake.rs

Part of rust-lang#121876.

Changes

This PR ports tests/run-make/split-debuginfo to rmake.rs. This is an initial port, and certainly could be cleaned up and/or enhanced.

The original Makefile version had several functional problems. I made

  1. The linux/non-linux final branch had a conditional interpolation of UNSTABLE_OPTIONS := -Zunstable-options. However, one of the use sites was -C $(UNSTABLE_OPTIONS) split-debuginfo. This indicates to me that this run-make test is not run in CI under a non-linux + non-windows + non-darwin environment, because that would've failed as this would expand to -C -Zunstable-options split-debuginfo. I fixed this in the rmake.rs version, but I'm not sure if this distinction is worth keeping at all if it's not tested in CI.

  2. There are several comments that were discovered to be wrong. I tried to fix them in the rmake.rs version as well.

  3. The check for path remapping / lack of path remapping through

    objdump -Wi <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>T</mi><mi>M</mi><mi>P</mi><mi>D</mi><mi>I</mi><mi>R</mi><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mi>f</mi><mi>o</mi><mi>o</mi><mi mathvariant="normal">∣</mi><mi>g</mi><mi>r</mi><mi>e</mi><mi>p</mi><mi>D</mi><msub><mi>W</mi><mi>A</mi></msub><msub><mi>T</mi><mi>G</mi></msub><mi>N</mi><msub><mi>U</mi><mi>d</mi></msub><mi>w</mi><msub><mi>o</mi><mi>n</mi></msub><mi>a</mi><mi>m</mi><mi>e</mi><mi mathvariant="normal">∣</mi><mo stretchy="false">(</mo><mo stretchy="false">!</mo><mi>g</mi><mi>r</mi><mi>e</mi><mi>p</mi></mrow><annotation encoding="application/x-tex">(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.13889em;">TMP</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="mclose">)</span><span class="mord">/</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">oo</span><span class="mord">∣</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">re</span><span class="mord mathnormal">p</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">A</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">G</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.10903em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">d</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.02691em;">w</span><span class="mord"><span class="mord mathnormal">o</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">am</span><span class="mord mathnormal">e</span><span class="mord">∣</span><span class="mopen">(</span><span class="mclose">!</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">re</span><span class="mord mathnormal">p</span></span></span></span>(TMPDIR)) || exit 1

    are incorrect, because that looks at the single line of that contains DW_AT_GNU_dwo_name. This is unfortunately wrong because empirical evidence shows that with objdump[^objdump], the check actually needs to look at the attribute value of DW_AT_comp_dir on the previous line not DW_AT_GNU_dwo_name[^gnu-ext]. Example output of objdump:

    <10>   DW_AT_comp_dir    : (indirect string, offset: 0xafb48): /home/joe/repos/rust
    <14>   DW_AT_GNU_dwo_name: (indirect string, offset: 0x5d1b0): foo.foo.fc848df41df7a00d-cgu.0.rcgu.dwo

    In the rmake.rs version

  4. I included a bunch of FIXMEs and ENHANCEMENTs I noticed regarding the test because I didn't want to do them in this initial port[^enhancement].

  5. The Makefile version didn't test anything on Windows (both windows-msvc and windows-gnu). I added some very basic and very sparse checks for windows-msvc, but I am not willing to spend the effort to expand test coverage to windows-gnu in this initial port.

  6. This run-make test is way too big. But I didn't want to expend the effort of breaking this up in this initial port.

[^objdump]: the output format differs between objdump and llvm-objdump, but the same is true for llvm-objdump that this is looking at the wrong line. [^gnu-ext]: AFAICT that is a GNU DWARF attribute extension, since it isn't mentioned in DWARFv5 spec [^enhancement]: For instance, the previous path remapping check could in theory be precisely inspected by inspecting .debug_info section to look for attribute value of DW_AT_comp_dir. But that involves resolving the value of the indirect string, which means you have to: (1) look for offset into string offset table and (2) use that offset to find the string itself in the string table. The split part of "split-debuginfo" makes this murky for me, so I wasn't able to replace llvm-objdump textual output substring matches with more precise object + gimli inspections.

Review advice

[^squash]: I intend to squash these intermediate commits away after the reviewer concludes that the current form of the rmake.rs test is acceptable for merge. Before then, I'll keep them to help with review.


This PR supersedes rust-lang#128754 and is co-authored with @Oneirical.

r? @ghost


try-job: x86_64-msvc try-job: i686-msvc try-job: i686-mingw try-job: x86_64-mingw-1 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: test-various

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 16, 2025

@bors

tests: Port split-debuginfo to rmake.rs

Part of rust-lang#121876.

Changes

This PR ports tests/run-make/split-debuginfo to rmake.rs. This is an initial port, and certainly could be cleaned up and/or enhanced.

The original Makefile version had several functional problems. I made

  1. The linux/non-linux final branch had a conditional interpolation of UNSTABLE_OPTIONS := -Zunstable-options. However, one of the use sites was -C $(UNSTABLE_OPTIONS) split-debuginfo. This indicates to me that this run-make test is not run in CI under a non-linux + non-windows + non-darwin environment, because that would've failed as this would expand to -C -Zunstable-options split-debuginfo. I fixed this in the rmake.rs version, but I'm not sure if this distinction is worth keeping at all if it's not tested in CI.

  2. There are several comments that were discovered to be wrong. I tried to fix them in the rmake.rs version as well.

  3. The check for path remapping / lack of path remapping through

    objdump -Wi <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>T</mi><mi>M</mi><mi>P</mi><mi>D</mi><mi>I</mi><mi>R</mi><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mi>f</mi><mi>o</mi><mi>o</mi><mi mathvariant="normal">∣</mi><mi>g</mi><mi>r</mi><mi>e</mi><mi>p</mi><mi>D</mi><msub><mi>W</mi><mi>A</mi></msub><msub><mi>T</mi><mi>G</mi></msub><mi>N</mi><msub><mi>U</mi><mi>d</mi></msub><mi>w</mi><msub><mi>o</mi><mi>n</mi></msub><mi>a</mi><mi>m</mi><mi>e</mi><mi mathvariant="normal">∣</mi><mo stretchy="false">(</mo><mo stretchy="false">!</mo><mi>g</mi><mi>r</mi><mi>e</mi><mi>p</mi></mrow><annotation encoding="application/x-tex">(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.13889em;">TMP</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="mclose">)</span><span class="mord">/</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">oo</span><span class="mord">∣</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">re</span><span class="mord mathnormal">p</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">A</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">G</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.10903em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">d</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.02691em;">w</span><span class="mord"><span class="mord mathnormal">o</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">am</span><span class="mord mathnormal">e</span><span class="mord">∣</span><span class="mopen">(</span><span class="mclose">!</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">re</span><span class="mord mathnormal">p</span></span></span></span>(TMPDIR)) || exit 1

    are incorrect, because that looks at the single line of that contains DW_AT_GNU_dwo_name. This is unfortunately wrong because empirical evidence shows that with objdump[^objdump], the check actually needs to look at the attribute value of DW_AT_comp_dir on the previous line not DW_AT_GNU_dwo_name[^gnu-ext]. Example output of objdump:

    <10>   DW_AT_comp_dir    : (indirect string, offset: 0xafb48): /home/joe/repos/rust
    <14>   DW_AT_GNU_dwo_name: (indirect string, offset: 0x5d1b0): foo.foo.fc848df41df7a00d-cgu.0.rcgu.dwo

    In the rmake.rs version

  4. I included a bunch of FIXMEs and ENHANCEMENTs I noticed regarding the test because I didn't want to do them in this initial port[^enhancement].

  5. The Makefile version didn't test anything on Windows (both windows-msvc and windows-gnu). I added some very basic and very sparse checks for windows-msvc, but I am not willing to spend the effort to expand test coverage to windows-gnu in this initial port.

  6. This run-make test is way too big. But I didn't want to expend the effort of breaking this up in this initial port.

[^objdump]: the output format differs between objdump and llvm-objdump, but the same is true for llvm-objdump that this is looking at the wrong line. [^gnu-ext]: AFAICT that is a GNU DWARF attribute extension, since it isn't mentioned in DWARFv5 spec [^enhancement]: For instance, the previous path remapping check could in theory be precisely inspected by inspecting .debug_info section to look for attribute value of DW_AT_comp_dir. But that involves resolving the value of the indirect string, which means you have to: (1) look for offset into string offset table and (2) use that offset to find the string itself in the string table. The split part of "split-debuginfo" makes this murky for me, so I wasn't able to replace llvm-objdump textual output substring matches with more precise object + gimli inspections.

Review advice

[^squash]: I intend to squash these intermediate commits away after the reviewer concludes that the current form of the rmake.rs test is acceptable for merge. Before then, I'll keep them to help with review.


This PR supersedes rust-lang#128754 and is co-authored with @Oneirical.

r? @ghost


try-job: x86_64-msvc try-job: i686-msvc try-job: i686-mingw try-job: x86_64-mingw-1 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: test-various

@jieyouxu

Superseded by #135572 w/ attribution, thanks for the PR!

jieyouxu added a commit to jieyouxu/rust that referenced this pull request

Feb 5, 2025

@jieyouxu

…r=davidtwco

tests: Port split-debuginfo to rmake.rs

Part of rust-lang#121876.

This PR supersedes rust-lang#128754 and is co-authored with @Oneirical.

Known limitations

Changes

This PR ports tests/run-make/split-debuginfo to rmake.rs. This is an initial port, and certainly could be cleaned up and/or enhanced.

The original Makefile version had several functional problems. I fixed some of them, but also left some existing issues as-is.

  1. The linux/non-linux final branch had a conditional interpolation of UNSTABLE_OPTIONS := -Zunstable-options. However, one of the use sites was -C $(UNSTABLE_OPTIONS) split-debuginfo. This indicates to me that this run-make test is not run in CI under a non-linux + non-windows + non-darwin environment, because that would've failed as this would expand to -C -Zunstable-options split-debuginfo. I fixed this in the rmake.rs version, but I'm not sure if this distinction is worth keeping at all if it's not tested in CI.

  2. There are several comments that were discovered to be wrong. I tried to fix them in the rmake.rs version as well.

  3. The check for path remapping / lack of path remapping through

    objdump -Wi <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>T</mi><mi>M</mi><mi>P</mi><mi>D</mi><mi>I</mi><mi>R</mi><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mi>f</mi><mi>o</mi><mi>o</mi><mi mathvariant="normal">∣</mi><mi>g</mi><mi>r</mi><mi>e</mi><mi>p</mi><mi>D</mi><msub><mi>W</mi><mi>A</mi></msub><msub><mi>T</mi><mi>G</mi></msub><mi>N</mi><msub><mi>U</mi><mi>d</mi></msub><mi>w</mi><msub><mi>o</mi><mi>n</mi></msub><mi>a</mi><mi>m</mi><mi>e</mi><mi mathvariant="normal">∣</mi><mo stretchy="false">(</mo><mo stretchy="false">!</mo><mi>g</mi><mi>r</mi><mi>e</mi><mi>p</mi></mrow><annotation encoding="application/x-tex">(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.13889em;">TMP</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="mclose">)</span><span class="mord">/</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">oo</span><span class="mord">∣</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">re</span><span class="mord mathnormal">p</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">A</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">G</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.10903em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">d</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.02691em;">w</span><span class="mord"><span class="mord mathnormal">o</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">am</span><span class="mord mathnormal">e</span><span class="mord">∣</span><span class="mopen">(</span><span class="mclose">!</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">re</span><span class="mord mathnormal">p</span></span></span></span>(TMPDIR)) || exit 1

    is incorrect, because that looks at the single line of that contains DW_AT_GNU_dwo_name. This is unfortunately wrong because empirical evidence shows that with objdump[^objdump], the check actually needs to look at the attribute value of DW_AT_comp_dir on the previous line not DW_AT_GNU_dwo_name[^gnu-ext]. Example output of objdump:

    <10>   DW_AT_comp_dir    : (indirect string, offset: 0xafb48): /home/joe/repos/rust
    <14>   DW_AT_GNU_dwo_name: (indirect string, offset: 0x5d1b0): foo.foo.fc848df41df7a00d-cgu.0.rcgu.dwo

    In the rmake.rs version I used a 2-line sliding window to check for DW_AT_comp_dir and DW_AT_GNU_dwo_name, but to look at DW_AT_comp_dir specifically.

  4. I included a bunch of FIXMEs and ENHANCEMENTs I noticed regarding the test because I didn't want to fix them in this initial port[^enhancement].

  5. The Makefile version didn't test anything on Windows (both windows-msvc and windows-gnu). I added some very basic and very sparse checks for windows-msvc, but I am not willing to spend the effort to expand test coverage to windows-gnu in this initial port.

  6. This run-make test is way too big. But I didn't want to expend the effort of breaking this up in this initial port.

[^objdump]: the output format differs between objdump and llvm-objdump, but the same is true for llvm-objdump that this is looking at the wrong line. [^gnu-ext]: AFAICT that is a GNU DWARF attribute extension, since it isn't mentioned in DWARFv5 spec [^enhancement]: For instance, the previous path remapping check could in theory be precisely inspected by inspecting .debug_info section to look for attribute value of DW_AT_comp_dir. But that involves resolving the value of the indirect string, which means you have to: (1) look for offset into string offset table and (2) use that offset to find the string itself in the string table. The split part of "split-debuginfo" makes this murky for me, so I wasn't able to replace llvm-objdump textual output substring matches with more precise object + gimli inspections.

Review advice

[^squash]: I intend to squash these intermediate commits away after the reviewer concludes that the current form of the rmake.rs test is acceptable for merge. Before then, I'll keep them to help with review.


try-job: x86_64-msvc try-job: i686-msvc try-job: i686-mingw try-job: x86_64-mingw-1 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: test-various

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Feb 6, 2025

@rust-timer

Rollup merge of rust-lang#135572 - jieyouxu:migrate-split-debuginfo, r=davidtwco

tests: Port split-debuginfo to rmake.rs

Part of rust-lang#121876.

This PR supersedes rust-lang#128754 and is co-authored with @Oneirical.

Known limitations

Changes

This PR ports tests/run-make/split-debuginfo to rmake.rs. This is an initial port, and certainly could be cleaned up and/or enhanced.

The original Makefile version had several functional problems. I fixed some of them, but also left some existing issues as-is.

  1. The linux/non-linux final branch had a conditional interpolation of UNSTABLE_OPTIONS := -Zunstable-options. However, one of the use sites was -C $(UNSTABLE_OPTIONS) split-debuginfo. This indicates to me that this run-make test is not run in CI under a non-linux + non-windows + non-darwin environment, because that would've failed as this would expand to -C -Zunstable-options split-debuginfo. I fixed this in the rmake.rs version, but I'm not sure if this distinction is worth keeping at all if it's not tested in CI.

  2. There are several comments that were discovered to be wrong. I tried to fix them in the rmake.rs version as well.

  3. The check for path remapping / lack of path remapping through

    objdump -Wi <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>T</mi><mi>M</mi><mi>P</mi><mi>D</mi><mi>I</mi><mi>R</mi><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mi>f</mi><mi>o</mi><mi>o</mi><mi mathvariant="normal">∣</mi><mi>g</mi><mi>r</mi><mi>e</mi><mi>p</mi><mi>D</mi><msub><mi>W</mi><mi>A</mi></msub><msub><mi>T</mi><mi>G</mi></msub><mi>N</mi><msub><mi>U</mi><mi>d</mi></msub><mi>w</mi><msub><mi>o</mi><mi>n</mi></msub><mi>a</mi><mi>m</mi><mi>e</mi><mi mathvariant="normal">∣</mi><mo stretchy="false">(</mo><mo stretchy="false">!</mo><mi>g</mi><mi>r</mi><mi>e</mi><mi>p</mi></mrow><annotation encoding="application/x-tex">(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.13889em;">TMP</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="mclose">)</span><span class="mord">/</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">oo</span><span class="mord">∣</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">re</span><span class="mord mathnormal">p</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">A</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">G</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.10903em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">d</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.02691em;">w</span><span class="mord"><span class="mord mathnormal">o</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">am</span><span class="mord mathnormal">e</span><span class="mord">∣</span><span class="mopen">(</span><span class="mclose">!</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">re</span><span class="mord mathnormal">p</span></span></span></span>(TMPDIR)) || exit 1

    is incorrect, because that looks at the single line of that contains DW_AT_GNU_dwo_name. This is unfortunately wrong because empirical evidence shows that with objdump[^objdump], the check actually needs to look at the attribute value of DW_AT_comp_dir on the previous line not DW_AT_GNU_dwo_name[^gnu-ext]. Example output of objdump:

    <10>   DW_AT_comp_dir    : (indirect string, offset: 0xafb48): /home/joe/repos/rust
    <14>   DW_AT_GNU_dwo_name: (indirect string, offset: 0x5d1b0): foo.foo.fc848df41df7a00d-cgu.0.rcgu.dwo

    In the rmake.rs version I used a 2-line sliding window to check for DW_AT_comp_dir and DW_AT_GNU_dwo_name, but to look at DW_AT_comp_dir specifically.

  4. I included a bunch of FIXMEs and ENHANCEMENTs I noticed regarding the test because I didn't want to fix them in this initial port[^enhancement].

  5. The Makefile version didn't test anything on Windows (both windows-msvc and windows-gnu). I added some very basic and very sparse checks for windows-msvc, but I am not willing to spend the effort to expand test coverage to windows-gnu in this initial port.

  6. This run-make test is way too big. But I didn't want to expend the effort of breaking this up in this initial port.

[^objdump]: the output format differs between objdump and llvm-objdump, but the same is true for llvm-objdump that this is looking at the wrong line. [^gnu-ext]: AFAICT that is a GNU DWARF attribute extension, since it isn't mentioned in DWARFv5 spec [^enhancement]: For instance, the previous path remapping check could in theory be precisely inspected by inspecting .debug_info section to look for attribute value of DW_AT_comp_dir. But that involves resolving the value of the indirect string, which means you have to: (1) look for offset into string offset table and (2) use that offset to find the string itself in the string table. The split part of "split-debuginfo" makes this murky for me, so I wasn't able to replace llvm-objdump textual output substring matches with more precise object + gimli inspections.

Review advice

[^squash]: I intend to squash these intermediate commits away after the reviewer concludes that the current form of the rmake.rs test is acceptable for merge. Before then, I'll keep them to help with review.


try-job: x86_64-msvc try-job: i686-msvc try-job: i686-mingw try-job: x86_64-mingw-1 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: test-various

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-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)