Skip to content

bootstrap: actually allow set debuginfo-level to "line-tables-only"#123364

Merged
bors merged 2 commits into
rust-lang:masterfrom
klensy:bs-mixed-types
Apr 19, 2024
Merged

bootstrap: actually allow set debuginfo-level to "line-tables-only"#123364
bors merged 2 commits into
rust-lang:masterfrom
klensy:bs-mixed-types

Conversation

@klensy

@klensy klensy commented Apr 2, 2024

Copy link
Copy Markdown
Contributor

I've tried to set in config.toml rust.debuginfo-level = "line-tables-only", but ended with:

data did not match any variant of untagged enum StringOrInt for key `rust.debuginfo-level`

Also this PR allows to set line-directives-only for debuginfo in config.toml too.

  1. Fixes this. Alternative is remove that Deserialize and use default one:

    // The following is a trimmed version of what serde_derive generates. All parts not relevant
    // for toml deserialization have been removed. This reduces the binary size and improves
    // compile time of rustbuild.
    impl<'de> Deserialize<'de> for $name {

  2. Should line-directives-only be added too?

  3. I've tried to add test to rust/src/bootstrap/src/core/config/tests.rs:

#[test]
fn rust_debuginfo() {
    assert!(matches!(
        parse("rust.debuginfo-level-rustc = 1").rust_debuginfo_level_rustc,
        DebuginfoLevel::Limited
    ));
    assert!(matches!(
        parse("rust.debuginfo-level-rustc = \"line-tables-only\"").rust_debuginfo_level_rustc,
        DebuginfoLevel::LineTablesOnly
    ));
}

But test passes before that PR too; looks like config parse tests checks something wrong? I mean, that tests check something which isn't actual bootstrap behavior.

@rustbot

rustbot commented Apr 2, 2024

Copy link
Copy Markdown
Collaborator

r? @albertlarsan68

rustbot has assigned @albertlarsan68.
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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 2, 2024
@rustbot

rustbot commented Apr 2, 2024

Copy link
Copy Markdown
Collaborator

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@klensy klensy changed the title bootstrap: actually allow set debuginfo-level to "lines-tables-only" bootstrap: actually allow set debuginfo-level to "line-tables-only" Apr 2, 2024
@Noratrieb

Copy link
Copy Markdown
Member

Can we make that the default in the compiler profile?

@klensy

klensy commented Apr 2, 2024

Copy link
Copy Markdown
Contributor Author

Can we make that the default in the compiler profile?

Maybe? I didn't use profiles.
Currently it's 0 for compiler profile, so changing it will make it slower but will give more debug info, for perf tools too.

@workingjubilee

Copy link
Copy Markdown
Member

I do not think changing it will make the actual compiler that much slower for regular execution, as generally debuginfo is not even mapped in at the same time as most code, nevermind actually contending for cache.

@workingjubilee

Copy link
Copy Markdown
Member

I think we can figure out the default in #123337 as what the compiler contributors think would be best as default is up to them but this part of the change is a matter of the bootstrap code per se.

@albertlarsan68 albertlarsan68 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but I think that we should support all levels that are supported by the compilers that are used

@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 Apr 16, 2024
@rustbot

rustbot commented Apr 17, 2024

Copy link
Copy Markdown
Collaborator

This PR modifies config.example.toml.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@klensy

klensy commented Apr 17, 2024

Copy link
Copy Markdown
Contributor 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 Apr 17, 2024

@albertlarsan68 albertlarsan68 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR!

@albertlarsan68

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Apr 19, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 1d929cf has been approved by albertlarsan68

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 Apr 19, 2024
@bors

bors commented Apr 19, 2024

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1d929cf with merge 07d0d7c...

@bors

bors commented Apr 19, 2024

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: albertlarsan68
Pushing 07d0d7c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 19, 2024
@bors bors merged commit 07d0d7c into rust-lang:master Apr 19, 2024
@rustbot rustbot added this to the 1.79.0 milestone Apr 19, 2024
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (07d0d7c): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 673.234s -> 672.208s (-0.15%)
Artifact size: 315.21 MiB -> 315.30 MiB (0.03%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants