Skip to content

fix(opt-dist): respect existing config.toml - #125473

Merged
bors merged 1 commit into
rust-lang:masterfrom
weihanglo:respect-existing-config-toml
May 26, 2024
Merged

fix(opt-dist): respect existing config.toml#125473
bors merged 1 commit into
rust-lang:masterfrom
weihanglo:respect-existing-config-toml

Conversation

@weihanglo

@weihangloweihanglo commented May 24, 2024

Copy link
Copy Markdown
Member

This is another step toward making opt-dist work in sandboxed environments. See also #125465.

opt-dist verifies the final built rustc against a subset of rustc test
suite. However it overwrote the pre-existing config.toml1,
and that results in ./vendor/ directory removed 2.

Instead of overwriting, this patch use --set <config-value> to
override paths to rustc / cargo / llvm-config.

Footnotes

  1. https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77

  2. https://github.com/rust-lang/rust/blob/8679004993f08807289911d9f400f4ac4391d2bc/src/bootstrap/bootstrap.py#L1057

@rustbot

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

@rustbotrustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 24, 2024
@weihanglo

Copy link
Copy Markdown
MemberAuthor

This is marked as draft because I am still fighting with Nix configurations for LLVM PGO and haven't fully tested it 😬.

@weihanglo
weihangloforce-pushed the respect-existing-config-toml branch from 191ba65 to 395024aCompareMay 24, 2024 04:22
@Kobzol

Copy link
Copy Markdown
Member

FYI, if you comment out this and do a try build, it will run the post-optimization tests.

@KobzolKobzol 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.

r? @Kobzol

Feel free to r=me if a try build with tests passes.

Comment threadsrc/tools/opt-dist/src/tests.rs Outdated
@weihanglo
weihangloforce-pushed the respect-existing-config-toml branch from 395024a to 159ccd4CompareMay 24, 2024 14:21
@rustbotrustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels May 24, 2024
@Kobzol

Copy link
Copy Markdown
Member

@bors try

@bors

bors commented May 24, 2024

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 159ccd4 with merge 03cd897...

bors added a commit to rust-lang-ci/rust that referenced this pull request May 24, 2024
…ml, r=<try>
fix(opt-dist): respect existing config.toml
This is another step toward making opt-dist work in sandboxed environments. See also <rust-lang#125465>.
opt-dist verifies the final built rustc against a subset of rustc test
suite. However it overwrote the pre-existing `config.toml` [^1],
and that results in ./vendor/ directory removed [^2].
Instead of overwriting, this patch use `--set <config-value>` to
override paths to rustc / cargo / llvm-config.
[^1]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77
[^2]: https://github.com/rust-lang/rust/blob/8679004993f08807289911d9f400f4ac4391d2bc/src/bootstrap/bootstrap.py#L1057
@rust-log-analyzer

This comment has been minimized.

@bors

bors commented May 24, 2024

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors 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 May 24, 2024
@lqd

lqd commented May 24, 2024

Copy link
Copy Markdown
Member

merging target-specific config is not currently supported

@weihanglo

Copy link
Copy Markdown
MemberAuthor

I can try to make it work, if desired.

@lqd

lqd commented May 24, 2024

Copy link
Copy Markdown
Member

to be clear, that's in bootstrap, not in opt-dist

@weihanglo

weihanglo commented May 24, 2024

Copy link
Copy Markdown
MemberAuthor

Yeah I am aware. Cargo also merges target specific configs (in a quirky way 😆). Let me see if bootstrap can do a similar thing in a separate PR.

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request May 25, 2024
…onur-ozkan
bootstrap: support target specific config overrides
Can't find any previous discussion about not supporting this,
so I get it done.
The motivation of this is from <rust-lang#125473 (comment)>.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 25, 2024
…ur-ozkan
bootstrap: support target specific config overrides
Can't find any previous discussion about not supporting this,
so I get it done.
The motivation of this is from <rust-lang#125473 (comment)>.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 25, 2024
…ur-ozkan
bootstrap: support target specific config overrides
Can't find any previous discussion about not supporting this,
so I get it done.
The motivation of this is from <rust-lang#125473 (comment)>.
@weihanglo

Copy link
Copy Markdown
MemberAuthor

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request May 26, 2024
…ml, r=<try>
fix(opt-dist): respect existing config.toml
This is another step toward making opt-dist work in sandboxed environments. See also <rust-lang#125465>.
opt-dist verifies the final built rustc against a subset of rustc test
suite. However it overwrote the pre-existing `config.toml` [^1],
and that results in ./vendor/ directory removed [^2].
Instead of overwriting, this patch use `--set <config-value>` to
override paths to rustc / cargo / llvm-config.
[^1]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77
[^2]: https://github.com/rust-lang/rust/blob/8679004993f08807289911d9f400f4ac4391d2bc/src/bootstrap/bootstrap.py#L1057
@bors

bors commented May 26, 2024

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 159ccd4 with merge f94950d...

@bors

bors commented May 26, 2024

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: f94950d (f94950d4dfa3b0a971911eb5b99761a21ff4842c)

@weihanglo
weihanglo marked this pull request as ready for review May 26, 2024 03:09
@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/tools/opt-dist

cc @Kobzol

@weihanglo

Copy link
Copy Markdown
MemberAuthor

@rust-timer build f94950d

@rust-timer

This comment has been minimized.

@weihanglo

Copy link
Copy Markdown
MemberAuthor

Oh no forgot to remove the commit

This is another step toward making opt-dist work in sandboxed environments
opt-dist verifies the final built rustc against a subset of rustc test
suite. However it overwrote the pre-existing `config.toml` [^1],
and that results in ./vendor/ directory removed [^2].
Instead of overwriting, this patch use `--set <config-value>` to
override paths to rustc / cargo / llvm-config.
[^1]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77
[^2]: https://github.com/rust-lang/rust/blob/8679004993f08807289911d9f400f4ac4391d2bc/src/bootstrap/bootstrap.py#L1057
@weihanglo
weihangloforce-pushed the respect-existing-config-toml branch from 159ccd4 to c81a40bCompareMay 26, 2024 03:41
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f94950d): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
0.2%[0.2%, 0.2%]3
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)--0

Max RSS (memory usage)

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

Cycles

Results (secondary -2.4%)

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.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
-2.4%[-2.4%, -2.4%]1
All ❌✅ (primary)--0

Binary size

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

Bootstrap: 670.899s -> 672.687s (0.27%)
Artifact size: 315.75 MiB -> 315.61 MiB (-0.04%)

@Kobzol

Copy link
Copy Markdown
Member

Thanks for implementing the bootstrap change!

@bors r+ rollup

@bors

bors commented May 26, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit c81a40b has been approved by Kobzol

It is now in the queue for this repository.

@borsbors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 26, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 26, 2024
…toml, r=Kobzol
fix(opt-dist): respect existing config.toml
This is another step toward making opt-dist work in sandboxed environments. See also <rust-lang#125465>.
opt-dist verifies the final built rustc against a subset of rustc test
suite. However it overwrote the pre-existing `config.toml` [^1],
and that results in ./vendor/ directory removed [^2].
Instead of overwriting, this patch use `--set <config-value>` to
override paths to rustc / cargo / llvm-config.
[^1]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77
[^2]: https://github.com/rust-lang/rust/blob/8679004993f08807289911d9f400f4ac4391d2bc/src/bootstrap/bootstrap.py#L1057
bors added a commit to rust-lang-ci/rust that referenced this pull request May 26, 2024
…iaskrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#125307 (tidy: stop special-casing tests/ui entry limit)
- rust-lang#125375 (Create a triagebot ping group for Rust for Linux)
- rust-lang#125473 (fix(opt-dist): respect existing config.toml)
- rust-lang#125508 (Stop SRoA'ing `DynMetadata` in MIR)
- rust-lang#125530 (cleanup dependence of `ExtCtxt` in transcribe when macro expansion)
- rust-lang#125544 (Also mention my-self for other check-cfg docs changes)
- rust-lang#125559 (Simplify the `unchecked_sh[lr]` ub-checks a bit)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 26, 2024
…iaskrgr
Rollup of 6 pull requests
Successful merges:
- rust-lang#125307 (tidy: stop special-casing tests/ui entry limit)
- rust-lang#125375 (Create a triagebot ping group for Rust for Linux)
- rust-lang#125473 (fix(opt-dist): respect existing config.toml)
- rust-lang#125508 (Stop SRoA'ing `DynMetadata` in MIR)
- rust-lang#125561 (Stabilize `slice_flatten`)
- rust-lang#125571 (f32: use constants instead of reassigning a dummy value as PI)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit c7a1765 into rust-lang:masterMay 26, 2024
@rustbotrustbot added this to the 1.80.0 milestone May 26, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 26, 2024
Rollup merge of rust-lang#125473 - weihanglo:respect-existing-config-toml, r=Kobzol
fix(opt-dist): respect existing config.toml
This is another step toward making opt-dist work in sandboxed environments. See also <rust-lang#125465>.
opt-dist verifies the final built rustc against a subset of rustc test
suite. However it overwrote the pre-existing `config.toml` [^1],
and that results in ./vendor/ directory removed [^2].
Instead of overwriting, this patch use `--set <config-value>` to
override paths to rustc / cargo / llvm-config.
[^1]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77
[^2]: https://github.com/rust-lang/rust/blob/8679004993f08807289911d9f400f4ac4391d2bc/src/bootstrap/bootstrap.py#L1057
@weihanglo
weihanglo deleted the respect-existing-config-toml branch May 26, 2024 15:55
RalfJung pushed a commit to RalfJung/miri that referenced this pull request May 27, 2024
 bootstrap: support target specific config overrides
Can't find any previous discussion about not supporting this,
so I get it done.
The motivation of this is from <rust-lang/rust#125473 (comment)>.
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Jun 28, 2024
 bootstrap: support target specific config overrides
Can't find any previous discussion about not supporting this,
so I get it done.
The motivation of this is from <rust-lang/rust#125473 (comment)>.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testsuiteArea: The testsuite used to check the correctness of rustcS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@weihanglo@rustbot@Kobzol@bors@rust-log-analyzer@lqd@rust-timer@Mark-Simulacrum