Skip to content

Use the current target instead of iterating over all targets - #119548

Merged
bors merged 1 commit into
rust-lang:masterfrom
onur-ozkan:remove-nested-target-iteration
Jan 7, 2024
Merged

Use the current target instead of iterating over all targets#119548
bors merged 1 commit into
rust-lang:masterfrom
onur-ozkan:remove-nested-target-iteration

Conversation

@onur-ozkan

Copy link
Copy Markdown
Contributor

Since we already iterate through targets in StepDescription::maybe_run, there is no need to iterate targets again in the install step for std.

Compared the results before and after applying the changes to install step of std, and there were no differences.

~/devspace/.other/rustc-builds $ sha256sum ./old/usr/local/lib/rustlib/manifest-rust-std-x86_64-*
c2ea86fc25ffac87b0b135f31ba9644ad97549da4c050c3921b437d1e18285fd ./old/usr/local/lib/rustlib/manifest-rust-std-x86_64-pc-windows-gnu
d2f1081a779962e2cbc27f53191783d13428abd0964465547af78ce34c7251dd ./old/usr/local/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-gnu
 ~/devspace/.other/rustc-builds $ sha256sum ./new/usr/local/lib/rustlib/manifest-rust-std-x86_64-*
c2ea86fc25ffac87b0b135f31ba9644ad97549da4c050c3921b437d1e18285fd ./new/usr/local/lib/rustlib/manifest-rust-std-x86_64-pc-windows-gnu
d2f1081a779962e2cbc27f53191783d13428abd0964465547af78ce34c7251dd ./new/usr/local/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-gnu

Fixes#119533

Since we already iterate through targets in StepDescription::maybe_run, there is no need to
iterate targets again in the install step for std.
Compared the results before and after applying the changes to install step of std, and there were no differences.
```sh
 ~/devspace/.other/rustc-builds $ sha256sum ./old/usr/local/lib/rustlib/manifest-rust-std-x86_64-*
c2ea86fc25ffac87b0b135f31ba9644ad97549da4c050c3921b437d1e18285fd ./old/usr/local/lib/rustlib/manifest-rust-std-x86_64-pc-windows-gnu
d2f1081a779962e2cbc27f53191783d13428abd0964465547af78ce34c7251dd ./old/usr/local/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-gnu
 ~/devspace/.other/rustc-builds $ sha256sum ./new/usr/local/lib/rustlib/manifest-rust-std-x86_64-*
c2ea86fc25ffac87b0b135f31ba9644ad97549da4c050c3921b437d1e18285fd ./new/usr/local/lib/rustlib/manifest-rust-std-x86_64-pc-windows-gnu
d2f1081a779962e2cbc27f53191783d13428abd0964465547af78ce34c7251dd ./new/usr/local/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-gnu
```
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@rustbot

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbotrustbot 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 Jan 3, 2024
@onur-ozkanonur-ozkan changed the title Use the current target instead of iterating over all targets.Use the current target instead of iterating over all targetsJan 3, 2024
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 15bb29e has been approved by Mark-Simulacrum

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-review Status: Awaiting review from the assignee but also interested parties. labels Jan 6, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 7, 2024
…mpiler-errors
Rollup of 6 pull requests
Successful merges:
- rust-lang#119252 (rustc_mir_transform: Enforce `rustc::potential_query_instability` lint)
- rust-lang#119548 (Use the current target instead of iterating over all targets)
- rust-lang#119656 (document rounding behavior of rint/nearbyint for ties)
- rust-lang#119657 (Fix typo in docs for slice::split_once, slice::rsplit_once)
- rust-lang#119666 (Populate `yield` and `resume` types in MIR body while body is being initialized)
- rust-lang#119679 (Ask for rustc version in diagnostic reports, remind users to update their toolchain)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 7, 2024
…mpiler-errors
Rollup of 6 pull requests
Successful merges:
- rust-lang#119252 (rustc_mir_transform: Enforce `rustc::potential_query_instability` lint)
- rust-lang#119548 (Use the current target instead of iterating over all targets)
- rust-lang#119656 (document rounding behavior of rint/nearbyint for ties)
- rust-lang#119657 (Fix typo in docs for slice::split_once, slice::rsplit_once)
- rust-lang#119666 (Populate `yield` and `resume` types in MIR body while body is being initialized)
- rust-lang#119679 (Ask for rustc version in diagnostic reports, remind users to update their toolchain)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 20f22ba into rust-lang:masterJan 7, 2024
@rustbotrustbot added this to the 1.77.0 milestone Jan 7, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 7, 2024
Rollup merge of rust-lang#119548 - onur-ozkan:remove-nested-target-iteration, r=Mark-Simulacrum
Use the current target instead of iterating over all targets
Since we already iterate through targets in StepDescription::maybe_run, there is no need to iterate targets again in the install step for std.
Compared the results before and after applying the changes to install step of std, and there were no differences.
```sh
 ~/devspace/.other/rustc-builds $ sha256sum ./old/usr/local/lib/rustlib/manifest-rust-std-x86_64-*
c2ea86fc25ffac87b0b135f31ba9644ad97549da4c050c3921b437d1e18285fd ./old/usr/local/lib/rustlib/manifest-rust-std-x86_64-pc-windows-gnu
d2f1081a779962e2cbc27f53191783d13428abd0964465547af78ce34c7251dd ./old/usr/local/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-gnu
 ~/devspace/.other/rustc-builds $ sha256sum ./new/usr/local/lib/rustlib/manifest-rust-std-x86_64-*
c2ea86fc25ffac87b0b135f31ba9644ad97549da4c050c3921b437d1e18285fd ./new/usr/local/lib/rustlib/manifest-rust-std-x86_64-pc-windows-gnu
d2f1081a779962e2cbc27f53191783d13428abd0964465547af78ce34c7251dd ./new/usr/local/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-gnu
```
Fixesrust-lang#119533
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-bootstrapRelevant 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.

x.py install installs std N^2 times

4 participants

@onur-ozkan@rustbot@Mark-Simulacrum@bors