Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 26, 2024

Conversation

weihanglo
Copy link
Member

@weihanglo weihanglo commented May 24, 2024

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

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
Collaborator

rustbot commented May 24, 2024

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

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

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

@weihanglo weihanglo force-pushed the respect-existing-config-toml branch from 191ba65 to 395024a Compare May 24, 2024 04:22
@Kobzol
Copy link
Contributor

Kobzol commented May 24, 2024

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

Copy link
Contributor

@Kobzol Kobzol left a comment

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.

src/tools/opt-dist/src/tests.rs Outdated Show resolved Hide resolved
@rustbot rustbot assigned Kobzol and unassigned Mark-Simulacrum May 24, 2024
@weihanglo weihanglo force-pushed the respect-existing-config-toml branch from 395024a to 159ccd4 Compare May 24, 2024 14:21
@rustbot rustbot 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
Contributor

Kobzol commented May 24, 2024

@bors try

@bors
Copy link
Contributor

bors commented May 24, 2024

⌛ 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
Copy link
Contributor

bors commented May 24, 2024

💔 Test failed - checks-actions

@bors bors 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
Copy link
Member

lqd commented May 24, 2024

merging target-specific config is not currently supported

@weihanglo
Copy link
Member Author

I can try to make it work, if desired.

@lqd
Copy link
Member

lqd commented May 24, 2024

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

@weihanglo
Copy link
Member Author

weihanglo commented May 24, 2024

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
Member Author

@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
Copy link
Contributor

bors commented May 26, 2024

⌛ Trying commit 159ccd4 with merge f94950d...

@bors
Copy link
Contributor

bors commented May 26, 2024

☀️ 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
Collaborator

rustbot commented May 26, 2024

Some changes occurred in src/tools/opt-dist

cc @Kobzol

@weihanglo
Copy link
Member Author

@rust-timer build f94950d

@rust-timer

This comment has been minimized.

@weihanglo
Copy link
Member Author

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 weihanglo force-pushed the respect-existing-config-toml branch from 159ccd4 to c81a40b Compare May 26, 2024 03:41
@rust-timer
Copy link
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.

mean range count
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.

mean range count
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
Contributor

Kobzol commented May 26, 2024

Thanks for implementing the bootstrap change!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 26, 2024

📌 Commit c81a40b has been approved by Kobzol

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-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:master May 26, 2024
6 checks passed
@rustbot rustbot 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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-infra Relevant 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.

None yet

8 participants