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 }})
Part of #121876 and the associated Google Summer of Code project.
Possibly the most epic test rewrite yet in this project.
- Documentation-wise, this may need to be improved? The original test had many repeated comments, but I feel like the struct form of this rewrite makes it self-documenting in that aspect (example: lines like
.dwo never created
). Tell me if anything should get explanatory comments, especially in the massiverun_test
function.- Maybe at least the name of the various Makefile sections could be interesting.
Please try:
try-job: test-various
try-job: aarch64-apple
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 added A-run-make
Area: port run-make Makefiles to rmake.rs
Area: The testsuite used to check the correctness of rustc
Status: Awaiting review from the assignee but also interested parties.
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
labels
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
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
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
I won't have time to review this before our meeting tomorrow, I'll try to get to it tomorrow.
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.
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 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
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
This comment has been minimized.
bors added a commit to rust-lang-ci/rust that referenced this pull request
…
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
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.There are several comments that were discovered to be wrong. I tried to fix them in the rmake.rs version as well.
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 withobjdump
[^objdump], the check actually needs to look at the attribute value ofDW_AT_comp_dir
on the previous line notDW_AT_GNU_dwo_name
[^gnu-ext]. Example output ofobjdump
:<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 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].
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.
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
- I'm sorry for how long the rmake.rs test ended up, but a lot of it is comments and just vertical space due to formatting.
- This PR intentionally introduces several intermediate commits for the
Makefile
, mostly to illustrate the problems I discovered when looking at the originalMakefile
version. This is intended to highlight the existing problems in theMakefile
version for the reviewer[^squash].- There are several intentional non-functional commits:
- Reindent the
Makefile
to make the platform conditional gating more obvious. - Collapse nested if-else branches into an else if construct, which is not supported by GNU Make 3.80.
- Remove all redundant
-C debuginfo=2
when-g
is already specified.
- Reindent the
- There are several intentional non-functional commits:
- This PR is best reviewed commit-by-commit.
[^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
…
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
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.There are several comments that were discovered to be wrong. I tried to fix them in the rmake.rs version as well.
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 withobjdump
[^objdump], the check actually needs to look at the attribute value ofDW_AT_comp_dir
on the previous line notDW_AT_GNU_dwo_name
[^gnu-ext]. Example output ofobjdump
:<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 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].
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.
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
- I'm sorry for how long the rmake.rs test ended up, but a lot of it is comments and just vertical space due to formatting.
- This PR intentionally introduces several intermediate commits for the
Makefile
, mostly to illustrate the problems I discovered when looking at the originalMakefile
version. This is intended to highlight the existing problems in theMakefile
version for the reviewer[^squash].- There are several intentional non-functional commits:
- Reindent the
Makefile
to make the platform conditional gating more obvious. - Collapse nested if-else branches into an else if construct, which is not supported by GNU Make 3.80.
- Remove all redundant
-C debuginfo=2
when-g
is already specified.
- Reindent the
- There are several intentional non-functional commits:
- This PR is best reviewed commit-by-commit.
[^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
Superseded by #135572 w/ attribution, thanks for the PR!
jieyouxu added a commit to jieyouxu/rust that referenced this pull request
…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
- In general, like the
Makefile
version, this test in its present form is also somewhat funny because for the most part it merely checks for existence/absence of output artifacts but makes no attempt to actually check if the debuginfo is at all usable.
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.
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.There are several comments that were discovered to be wrong. I tried to fix them in the rmake.rs version as well.
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 withobjdump
[^objdump], the check actually needs to look at the attribute value ofDW_AT_comp_dir
on the previous line notDW_AT_GNU_dwo_name
[^gnu-ext]. Example output ofobjdump
:<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
andDW_AT_GNU_dwo_name
, but to look atDW_AT_comp_dir
specifically.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].
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.
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
- I'm sorry for how long the rmake.rs test ended up, but a lot of it is comments and just vertical space due to formatting. If there's any ways to make this test less long / convoluted, advice would be appreciated.
- This PR intentionally introduces several intermediate commits for the
Makefile
, mostly to illustrate the problems I discovered when looking at the originalMakefile
version. This is intended to highlight the existing problems in theMakefile
version for the reviewer[^squash].- There are several intentional non-functional commits:
- Reindent the
Makefile
to make the platform conditional gating more obvious. - Collapse nested if-else branches into an else if construct, which is not supported by GNU Make 3.80.
- Remove all redundant
-C debuginfo=2
when-g
is already specified.
- Reindent the
- There are several intentional non-functional commits:
- This PR is best reviewed commit-by-commit.
[^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
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
- In general, like the
Makefile
version, this test in its present form is also somewhat funny because for the most part it merely checks for existence/absence of output artifacts but makes no attempt to actually check if the debuginfo is at all usable.
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.
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.There are several comments that were discovered to be wrong. I tried to fix them in the rmake.rs version as well.
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 withobjdump
[^objdump], the check actually needs to look at the attribute value ofDW_AT_comp_dir
on the previous line notDW_AT_GNU_dwo_name
[^gnu-ext]. Example output ofobjdump
:<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
andDW_AT_GNU_dwo_name
, but to look atDW_AT_comp_dir
specifically.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].
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.
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
- I'm sorry for how long the rmake.rs test ended up, but a lot of it is comments and just vertical space due to formatting. If there's any ways to make this test less long / convoluted, advice would be appreciated.
- This PR intentionally introduces several intermediate commits for the
Makefile
, mostly to illustrate the problems I discovered when looking at the originalMakefile
version. This is intended to highlight the existing problems in theMakefile
version for the reviewer[^squash].- There are several intentional non-functional commits:
- Reindent the
Makefile
to make the platform conditional gating more obvious. - Collapse nested if-else branches into an else if construct, which is not supported by GNU Make 3.80.
- Remove all redundant
-C debuginfo=2
when-g
is already specified.
- Reindent the
- There are several intentional non-functional commits:
- This PR is best reviewed commit-by-commit.
[^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
Area: port run-make Makefiles to rmake.rs
Area: The testsuite used to check the correctness of rustc
Status: Awaiting review from the assignee but also interested parties.
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)