Implement -Z embed-source (DWARFv5 source code embedding extension) by Mrmaxmeier · Pull Request #126985 · 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

Conversation30 Commits3 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 }})

Mrmaxmeier

@rustbot

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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 S-waiting-on-review

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

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Jun 26, 2024

tgross35

tgross35

tgross35

@tgross35

This should also get a test in tests/debuginfo/ to make sure it is doing what is expected

@Mrmaxmeier Mrmaxmeier changed the titleImplement -C embed-source (DWARFv5 source code embedding extension) Implement -Z embed-source (DWARFv5 source code embedding extension)

Jun 26, 2024

bjorn3

bjorn3

@rust-log-analyzer

This comment has been minimized.

klensy

@Mrmaxmeier

This should also get a test in tests/debuginfo/ to make sure it is doing what is expected

Both LLDB and GDB doesn't support this proposal yet, so there's not a great way to test for it. I guess something similar to the llvm-dwarfdump-based tests in tests/run-make/remap-path-prefix-dwarf might be the way to go.

Edit: Looks like support was added somewhat recently in LLDB, but looking at the DWARF is probably still easier. I didn't find a (non-horrible) way to differentiate between embedded source code and code loaded from disk. (settings set target.source-map will fall back to the original paths if the mapped ones don't exist)

@tgross35

@bors

This comment was marked as resolved.

@rustbot rustbot added A-run-make

Area: port run-make Makefiles to rmake.rs

T-bootstrap

Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

labels

Jun 28, 2024

@Mrmaxmeier

I've added a run-make test that depends on a new release of gimli which includes support for the relevant DWARF tags.
I'll update the draft PR once the relevant update is available on crates.io. This PR will fail tidy with invalid source: "git+https://github.com/gimli-rs/[...] in the mean time.

@tgross35

You can probably ask for a minor release on your Gimli PR, then open a separate PR to bump the versions in this repo once it is released.

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

Jul 16, 2024

@bors

run-make-support: update gimli to 0.31.0

This version bump is required for the tests in rust-lang#126985 as suggested [here](rust-lang#126985 (comment)).

r​? tgross35 (^ that didn't work. cc @tgross35)

try-job: x86_64-msvc try-job: x86_64-mingw try-job: aarch64-apple try-job: test-various try-job: armhf-gnu try-job: dist-x86_64-linux

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

Jul 16, 2024

@matthiaskrgr

…jieyouxu

run-make-support: update gimli to 0.31.0

This version bump is required for the tests in rust-lang#126985 as suggested [here](rust-lang#126985 (comment)).

r​? tgross35 (^ that didn't work. cc @tgross35)

try-job: x86_64-msvc try-job: x86_64-mingw try-job: aarch64-apple try-job: test-various try-job: armhf-gnu try-job: dist-x86_64-linux

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

Jul 16, 2024

@rust-timer

Rollup merge of rust-lang#127805 - Mrmaxmeier:run-make-bump-gimli, r=jieyouxu

run-make-support: update gimli to 0.31.0

This version bump is required for the tests in rust-lang#126985 as suggested [here](rust-lang#126985 (comment)).

r​? tgross35 (^ that didn't work. cc @tgross35)

try-job: x86_64-msvc try-job: x86_64-mingw try-job: aarch64-apple try-job: test-various try-job: armhf-gnu try-job: dist-x86_64-linux

@rust-log-analyzer

This comment has been minimized.

@Mrmaxmeier

Status update:
The MCP got accepted (cc @davidtwco) and I've added a run-make test for the new functionality.

It turns out that LLVM 17 is not compatible with the way I'm emitting source code with each file. The proposed DWARF v6 spec was only implemented somewhat recently (llvm/llvm-project@87e22bd).

There does not seem to be an easy way to gate -Zembed-source to LLVM 18+, and I'm tempted to just ignore the issue. (llvm_util::get_version is not exposed outside of rustc_codegen_llvm and I'd like to not plumb it though the target features functionality.)

Is rustc going to be used with LLVM 17 for nightly builds anywhere? (I guess people might be able to run into this with RUSTC_BOOTSTRAP=1 on distro builds?)

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

Aug 22, 2024

@matthiaskrgr

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

Aug 22, 2024

@bors

…iaskrgr

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

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

Aug 22, 2024

@matthiaskrgr

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

Aug 22, 2024

@matthiaskrgr

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

Aug 23, 2024

@bors

…iaskrgr

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

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

Aug 23, 2024

@tgross35

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

Aug 23, 2024

@bors

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

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

Aug 23, 2024

@jieyouxu

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

Aug 23, 2024

@bors

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

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

Aug 23, 2024

@jieyouxu

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

Aug 23, 2024

@bors

Rollup of 5 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

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

Aug 25, 2024

@tgross35

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

Aug 25, 2024

@bors

Rollup of 8 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request

Aug 27, 2024

@workingjubilee

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

Aug 27, 2024

@bors

…kingjubilee

Rollup of 9 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

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

Aug 27, 2024

@bors

Rollup of 9 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

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

Aug 27, 2024

@rust-timer

Labels

A-run-make

Area: port run-make Makefiles to rmake.rs

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)

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.