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

Support overriding initial rustc and cargo paths #102266

Merged
merged 1 commit into from
Sep 25, 2022

Conversation

Mark-Simulacrum
Copy link
Member

This restores functionality broken by #98483. Unfortunately, it doesn't add a test to verify this works, but in this case we notice pretty quickly as perf uses this functionality and so reports breakage immediately after merging.

r? @jyn514

cc https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/rustc.20and.20cargo.20option.20broken.20in.20config.2Etoml, https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Rustc.20benchmark.20broken

This restores functionality broken by rust-lang#98483. Unfortunately, it doesn't
add a test to verify this works, but in this case we notice pretty
quickly as perf uses this functionality and so reports breakage
immediately after merging.
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Sep 25, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 25, 2022
@@ -912,10 +910,14 @@ impl Config {
config.out = crate::util::absolute(&config.out);
}

if !has_custom_rustc && !config.initial_rustc.starts_with(&config.out) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't really understand what this check was trying to accomplish -- it seems pretty odd to me that config.out matters here. The new logic just trusts build.rustc or build.cargo, and falls back to the stage0 path as before.

Copy link
Member

Choose a reason for hiding this comment

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

I don't quite understand why this behavior is different than before; don't we set initial_rustc on line 906 above? I think the bug is that I forgot the same check for initial_cargo.

That said, I agree the new logic is simpler and easier to understand, so 👍 for using it for initial_rustc as well.

I don't really understand what this check was trying to accomplish -- it seems pretty odd to me that config.out matters

I was trying to be conservative and only change the behavior when bootstrap was downloaded from CI (i.e. config.out wasn't a parent of the RUSTC env variable bootstrap was built with). But I think your approach is fine too and easier to maintain - ideally we wouldn't set RUSTC in the build script at all.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think the build-script set RUSTC matters at all at this point? It's not getting read by config.rs anyway, so I would hope it doesn't :)

Copy link
Member

@jyn514 jyn514 Sep 25, 2022

Choose a reason for hiding this comment

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

Oh you're right, I'd forgotten I'd completely removed that: https://github.com/rust-lang/rust/pull/98483/files#diff-7eddc76f1be9eca2599a9ae58c65ffe247fbdff9b02ef687439894cab9afe749L781

Yes, this is absolutely the right fix then if there's no default for initial_rustc. I think we can go ahead and remove bootstrap's build script too, I'll make a follow-up PR for that :)

@@ -912,10 +910,14 @@ impl Config {
config.out = crate::util::absolute(&config.out);
}

if !has_custom_rustc && !config.initial_rustc.starts_with(&config.out) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't quite understand why this behavior is different than before; don't we set initial_rustc on line 906 above? I think the bug is that I forgot the same check for initial_cargo.

That said, I agree the new logic is simpler and easier to understand, so 👍 for using it for initial_rustc as well.

I don't really understand what this check was trying to accomplish -- it seems pretty odd to me that config.out matters

I was trying to be conservative and only change the behavior when bootstrap was downloaded from CI (i.e. config.out wasn't a parent of the RUSTC env variable bootstrap was built with). But I think your approach is fine too and easier to maintain - ideally we wouldn't set RUSTC in the build script at all.

@jyn514
Copy link
Member

jyn514 commented Sep 25, 2022

@bors r+ p=25 (fixes perf)

@bors
Copy link
Contributor

bors commented Sep 25, 2022

📌 Commit 439597b has been approved by jyn514

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 Sep 25, 2022
@bors
Copy link
Contributor

bors commented Sep 25, 2022

⌛ Testing commit 439597b with merge f3fafbb...

@bors
Copy link
Contributor

bors commented Sep 25, 2022

☀️ Test successful - checks-actions
Approved by: jyn514
Pushing f3fafbb to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 25, 2022
@bors bors merged commit f3fafbb into rust-lang:master Sep 25, 2022
@rustbot rustbot added this to the 1.66.0 milestone Sep 25, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f3fafbb): 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)

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) - - 0

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-3.4%, -2.1%] 2
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@Mark-Simulacrum Mark-Simulacrum deleted the fix-custom-rustc branch September 25, 2022 21:45
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this pull request Sep 26, 2022
…k-Simulacrum

Don't set RUSTC in the bootstrap build script

We no longer use this for anything since https://github.com/rust-lang/rust/pull/98483/files#diff-7eddc76f1be9eca2599a9ae58c65ffe247fbdff9b02ef687439894cab9afe749L781. Remove it, so that we spuriously rebuild bootstrap fewer times on Windows (where PATH changes often).

Helps with rust-lang#92369. cc rust-lang#102266

r? `@Mark-Simulacrum`
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this pull request Sep 26, 2022
…k-Simulacrum

Don't set RUSTC in the bootstrap build script

We no longer use this for anything since https://github.com/rust-lang/rust/pull/98483/files#diff-7eddc76f1be9eca2599a9ae58c65ffe247fbdff9b02ef687439894cab9afe749L781. Remove it, so that we spuriously rebuild bootstrap fewer times on Windows (where PATH changes often).

Helps with rust-lang#92369. cc rust-lang#102266

r? ``@Mark-Simulacrum``
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.

6 participants