fix: pass -C debuginfo after weakening if explicitly set#12165
Merged
bors merged 1 commit intorust-lang:masterfrom May 22, 2023
Merged
fix: pass -C debuginfo after weakening if explicitly set#12165bors merged 1 commit intorust-lang:masterfrom
-C debuginfo after weakening if explicitly set#12165bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
The weakening of debuginfo for build script shouldn't turn debuginfo to `DebugInfo::None`. That will result in not passing `-C debuginfo=0` to rustc, leading to build artifact cache miss.
Contributor
|
Thanks! @bors r+ Do you think this needs to be backported to beta? |
Contributor
Contributor
Member
Author
Feel like the bug shouldn't affect too many people, as you need to have both a crate in normal and build dependencies and switch back-and-forth between builds with different dependency resolutions. That said, no harm for a backport I guess? I do one then. |
Contributor
|
☀️ Test successful - checks-actions |
This was referenced May 22, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 23, 2023
Update cargo 10 commits in 09276c703a473ab33daaeb94917232e80eefd628..64fb38c97ac4d3a327fc9032c862dd28c8833b17 2023-05-16 21:43:35 +0000 to 2023-05-23 18:53:23 +0000 - Consider rust-version when selecting packages for cargo add (rust-lang/cargo#12078) - fix(lints): Switch to -Zlints so stable projects can experiment (rust-lang/cargo#12168) - Automatically inherit workspace fields when running cargo new/init (rust-lang/cargo#12069) - ci: check if any version bump needed for member crates (rust-lang/cargo#12126) - feat: `lints` feature (rust-lang/cargo#12148) - fix: pass `-C debuginfo` after weakening if explicitly set (rust-lang/cargo#12165) - Tweak build help to clarify role of --bin (rust-lang/cargo#12157) - fix: Pass CI on nightly (rust-lang/cargo#12160) - docs(source): doc comments for Source and its impls (rust-lang/cargo#12159) - docs(source): doc comments for `Source` and friends (rust-lang/cargo#12153) r? `@ghost`
saethlin
pushed a commit
to saethlin/miri
that referenced
this pull request
May 26, 2023
Update cargo 10 commits in 09276c703a473ab33daaeb94917232e80eefd628..64fb38c97ac4d3a327fc9032c862dd28c8833b17 2023-05-16 21:43:35 +0000 to 2023-05-23 18:53:23 +0000 - Consider rust-version when selecting packages for cargo add (rust-lang/cargo#12078) - fix(lints): Switch to -Zlints so stable projects can experiment (rust-lang/cargo#12168) - Automatically inherit workspace fields when running cargo new/init (rust-lang/cargo#12069) - ci: check if any version bump needed for member crates (rust-lang/cargo#12126) - feat: `lints` feature (rust-lang/cargo#12148) - fix: pass `-C debuginfo` after weakening if explicitly set (rust-lang/cargo#12165) - Tweak build help to clarify role of --bin (rust-lang/cargo#12157) - fix: Pass CI on nightly (rust-lang/cargo#12160) - docs(source): doc comments for Source and its impls (rust-lang/cargo#12159) - docs(source): doc comments for `Source` and friends (rust-lang/cargo#12153) r? `@ghost`
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
The weakening of debuginfo for build script shouldn't turn debuginfo
to
DebugInfo::None. That will result in not passing-C debuginfo=0to rustc, leading to build artifact cache miss.
Fixes #12163
How should we test and review this PR?
The existing test cases should cover this change.
You can also follow the reproducer in #12163.
I don't think we need more new test cases, since #12163 is not really a new scenario. See #12163 (comment).
Additional information
Will it introduce more cache miss? The following table shows whether
-C debuginfois passed to rustc:(before/after means before/after this pull request)
devdefault-C debuginfo=0-C debuginfo=2dev.debug=0-C debuginfo=0-C debuginfo=0dev.build-override.debug=0-C debuginfo=0-C debuginfo=0-C debuginfo=2releasedefaultrelease.debug=0-C debuginfo=0-C debuginfo=0release.build-override.debug=0-C debuginfo=0-C debuginfo=0-C debuginfo=2We can see that even with
debug=0set explicitly, some build-deps were weakened to no flag passed at all. I am still not sure if there is any cache miss, but at least we can potentially reuse artifacts between build-deps and normal-deps whendev.debug=0.(Artifacts cannot be reused for
release.debug=0because other flags likeopt-levelmay have different values)