use precompiled rustc for non-dist builders by onur-ozkan · Pull Request #122709 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation196 Commits12 Checks6 Files changed

Conversation

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

[ Show hidden characters]({{ revealButtonHref }})

onur-ozkan

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make rust.download-rustc=if-unchanged default option with #119899, we need to make sure if-unchanged logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for #119899

try-job: x86_64-gnu-nopt
try-job: aarch64-apple

@rustbot rustbot added A-testsuite

Area: The testsuite used to check the correctness of rustc

S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-infra

Relevant to the infrastructure team, which will review and decide on the PR/issue.

labels

Mar 18, 2024

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-bootstrap

Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

label

Apr 2, 2024

@rust-log-analyzer

This comment has been minimized.

@onur-ozkan

bors added a commit to rust-lang-ci/rust that referenced this pull request

Apr 4, 2024

@bors

…default, r=

prefer precompiled rustc for x86_64-gnu

-to be filled-

blocker for rust-lang#119899 r? ghost

@bors

@bors

☀️ Try build successful - checks-actions
Build commit: 9ec5616 (9ec5616fdf20bd5f5381043eccffbe26506a80ff)

@onur-ozkan

@bors

bors added a commit to rust-lang-ci/rust that referenced this pull request

Apr 4, 2024

@bors

…default, r=

prefer precompiled rustc for x86_64-gnu

-to be filled-

blocker for rust-lang#119899 r? ghost

@bors bors added the S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

label

Oct 8, 2024

@bors

@bors

@onur-ozkan onur-ozkan deleted the use-precompiled-rustc-by-default branch

October 8, 2024 20:45

This was referenced

Oct 8, 2024

@rust-timer

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

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

Cycles

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

Binary size

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

Bootstrap: 775.795s -> 775.772s (-0.00%)
Artifact size: 329.57 MiB -> 329.50 MiB (-0.02%)

@lqd

Member

lqd commented

Oct 8, 2024

• Loading

It may be unrelated, but it seems the test added here is failing on some of PR CI eg #131418 (comment) ?

lqd

@jieyouxu

@onur-ozkan

It may be unrelated, but it seems the test added here is failing on some of PR CI eg #131418 (comment) ?

It seems to be related. I will look into it today.

@onur-ozkan

bors added a commit to rust-lang-ci/rust that referenced this pull request

Oct 9, 2024

@bors

…onur-ozkan

fix ci_rustc_if_unchanged_logic test

Kind a typo from rust-lang#122709, which makes ci_rustc_if_unchanged_logic test to fail in any PR that has a change in "library" tree (e.g., rust-lang#131418 (comment)). This fixes that.

r? ghost

RalfJung

@RalfJung

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

It will save CI time if there is no change in the compiler or the library. Which is to say, hardly ever.

Is there some issue with further discussion or so? I am a bit surprised about this change since the trade-off does not seem worth it for me.

@RalfJung

There's some discussion hidden away above by github, but sadly I could not find a summary and the PR description is apparently not up-to-date. Anyway, let's move this to an issue: #131658.

@Kobzol

It will save CI time if there is no change in the compiler or the library. Which is to say, hardly ever.

Here are some brief stats of commits for the last year:

Total merge/rollup commits: 2825
Merge/rollup PRs that had no change in library nor compiler: 627 (22%)

Total % of commits that contain a change in the given directory
compiler: 1843 (65.24%)
tests: 1676 (59.33%)
library: 992 (35.12%)
src/bootstrap: 424 (15.01%)
src/librustdoc: 353 (12.50%)
src/ci: 190 (6.73%)
: 1404 (49.70%)

I'm too worried about the fragility of this code, but I'd also like to see how much CI time can this save us.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 13, 2025

@bors

redesign stage 0 std

This is intended to update bootstrap to use the beta standard library on stage 0, rather than compiling it from source (see the motivation at rust-lang/compiler-team#619).

~~Blocked on rust-lang#122709

try-job: mingw-check

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 13, 2025

@bors

redesign stage 0 std

This is intended to update bootstrap to use the beta standard library on stage 0, rather than compiling it from source (see the motivation at rust-lang/compiler-team#619).

~~Blocked on rust-lang#122709

try-job: mingw-check

bors added a commit to rust-lang-ci/rust that referenced this pull request

Apr 2, 2025

@bors

redesign stage 0 std

Summary

This PR changes how bootstrap builds the stage 1 compiler by switching to precompiled stage 0 standard library instead of building the in-tree one. The goal was to update bootstrap to use the beta standard library at stage 0 rather than compiling it from source (see the motivation at rust-lang/compiler-team#619).

Previously, to build a stage 1 compiler bootstrap followed this path:

download stage0 compiler -> build in-tree std -> compile stage1 compiler with in-tree std

With this PR, the new path is:

download stage0 compiler -> compile stage1 compiler with precompiled stage0 std

This also means that cfg(bootstrap)/cfg(not(bootstrap)) is no longer needed for library development.

Building "library"

Since stage0 std is no longer in-tree x build/test/check library --stage 0 is now no-op. The minimum supported stage to build std is now 1. For the same reason, default stage values in the library profile is no longer 0.

Because building the in-tree library now requires a stage1 compiler, I highly recommend library developers to enable download-rustc to speed up compilation time.


If you encounter a bug or unexpected results please open a topic in the #t-infra/bootstrap Zulip channel or create a bootstrap issue.

(Review thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Review.20thread.3A.20stage.200.20redesign.20PR/with/508271433)

~~Blocked on rust-lang#122709

bors added a commit to rust-lang-ci/rust that referenced this pull request

Apr 3, 2025

@bors

redesign stage 0 std

Summary

This PR changes how bootstrap builds the stage 1 compiler by switching to precompiled stage 0 standard library instead of building the in-tree one. The goal was to update bootstrap to use the beta standard library at stage 0 rather than compiling it from source (see the motivation at rust-lang/compiler-team#619).

Previously, to build a stage 1 compiler bootstrap followed this path:

download stage0 compiler -> build in-tree std -> compile stage1 compiler with in-tree std

With this PR, the new path is:

download stage0 compiler -> compile stage1 compiler with precompiled stage0 std

This also means that cfg(bootstrap)/cfg(not(bootstrap)) is no longer needed for library development.

Building "library"

Since stage0 std is no longer in-tree x build/test/check library --stage 0 is now no-op. The minimum supported stage to build std is now 1. For the same reason, default stage values in the library profile is no longer 0.

Because building the in-tree library now requires a stage1 compiler, I highly recommend library developers to enable download-rustc to speed up compilation time.


If you encounter a bug or unexpected results please open a topic in the #t-infra/bootstrap Zulip channel or create a bootstrap issue.

(Review thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Review.20thread.3A.20stage.200.20redesign.20PR/with/508271433)

~~Blocked on rust-lang#122709

bors added a commit to rust-lang-ci/rust that referenced this pull request

Apr 3, 2025

@bors

redesign stage 0 std

Summary

This PR changes how bootstrap builds the stage 1 compiler by switching to precompiled stage 0 standard library instead of building the in-tree one. The goal was to update bootstrap to use the beta standard library at stage 0 rather than compiling it from source (see the motivation at rust-lang/compiler-team#619).

Previously, to build a stage 1 compiler bootstrap followed this path:

download stage0 compiler -> build in-tree std -> compile stage1 compiler with in-tree std

With this PR, the new path is:

download stage0 compiler -> compile stage1 compiler with precompiled stage0 std

This also means that cfg(bootstrap)/cfg(not(bootstrap)) is no longer needed for library development.

Building "library"

Since stage0 std is no longer in-tree x build/test/check library --stage 0 is now no-op. The minimum supported stage to build std is now 1. For the same reason, default stage values in the library profile is no longer 0.

Because building the in-tree library now requires a stage1 compiler, I highly recommend library developers to enable download-rustc to speed up compilation time.


If you encounter a bug or unexpected results please open a topic in the #t-infra/bootstrap Zulip channel or create a bootstrap issue.

(Review thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Review.20thread.3A.20stage.200.20redesign.20PR/with/508271433)

~~Blocked on rust-lang#122709

try-job: dist-x86_64-linux try-job: dist-x86_64-msvc

bors added a commit to rust-lang-ci/rust that referenced this pull request

Apr 10, 2025

@bors

redesign stage 0 std

Summary

This PR changes how bootstrap builds the stage 1 compiler by switching to precompiled stage 0 standard library instead of building the in-tree one. The goal was to update bootstrap to use the beta standard library at stage 0 rather than compiling it from source (see the motivation at rust-lang/compiler-team#619).

Previously, to build a stage 1 compiler bootstrap followed this path:

download stage0 compiler -> build in-tree std -> compile stage1 compiler with in-tree std

With this PR, the new path is:

download stage0 compiler -> compile stage1 compiler with precompiled stage0 std

This also means that cfg(bootstrap)/cfg(not(bootstrap)) is no longer needed for library development.

Building "library"

Since stage0 std is no longer in-tree x build/test/check library --stage 0 is now no-op. The minimum supported stage to build std is now 1. For the same reason, default stage values in the library profile is no longer 0.

Because building the in-tree library now requires a stage1 compiler, I highly recommend library developers to enable download-rustc to speed up compilation time.


If you encounter a bug or unexpected results please open a topic in the #t-infra/bootstrap Zulip channel or create a bootstrap issue.

(Review thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Review.20thread.3A.20stage.200.20redesign.20PR/with/508271433)

~~Blocked on rust-lang#122709

try-job: dist-x86_64-linux

bors added a commit to rust-lang-ci/rust that referenced this pull request

Apr 10, 2025

@bors

redesign stage 0 std

Summary

This PR changes how bootstrap builds the stage 1 compiler by switching to precompiled stage 0 standard library instead of building the in-tree one. The goal was to update bootstrap to use the beta standard library at stage 0 rather than compiling it from source (see the motivation at rust-lang/compiler-team#619).

Previously, to build a stage 1 compiler bootstrap followed this path:

download stage0 compiler -> build in-tree std -> compile stage1 compiler with in-tree std

With this PR, the new path is:

download stage0 compiler -> compile stage1 compiler with precompiled stage0 std

This also means that cfg(bootstrap)/cfg(not(bootstrap)) is no longer needed for library development.

Building "library"

Since stage0 std is no longer in-tree x build/test/check library --stage 0 is now no-op. The minimum supported stage to build std is now 1. For the same reason, default stage values in the library profile is no longer 0.

Because building the in-tree library now requires a stage1 compiler, I highly recommend library developers to enable download-rustc to speed up compilation time.


If you encounter a bug or unexpected results please open a topic in the #t-infra/bootstrap Zulip channel or create a bootstrap issue.

(Review thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Review.20thread.3A.20stage.200.20redesign.20PR/with/508271433)

~~Blocked on rust-lang#122709

try-job: dist-x86_64-linux

Labels

A-testsuite

Area: The testsuite used to check the correctness of rustc

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)

T-infra

Relevant to the infrastructure team, which will review and decide on the PR/issue.