Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uprustbuild: Compile rustc twice, not thrice #38631
Conversation
rust-highfive
assigned
nikomatsakis
Dec 27, 2016
This comment has been minimized.
This comment has been minimized.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
rust-highfive
assigned
brson
and unassigned
nikomatsakis
Dec 27, 2016
brson
referenced this pull request
Dec 27, 2016
Closed
Enable building complete release artifacts on Travis / Appveyor #38531
petrochenkov
reviewed
Dec 27, 2016
| --enable-full-bootstrap | ||
| ENV RUST_CHECK_TARGET "" | ||
| RUN mkdir /tmp/obj | ||
| RUN chmod 777 /tmp/obj |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed the
alexcrichton:supafast
branch
from
74d6815
to
2f5b4ed
Dec 27, 2016
alexcrichton
referenced this pull request
Dec 27, 2016
Open
rustbuild: copy libs for stage1 from stage0 when using incremental and enable-local-rust #38575
alexcrichton
force-pushed the
alexcrichton:supafast
branch
from
2f5b4ed
to
d8fe45f
Dec 27, 2016
alexcrichton
force-pushed the
alexcrichton:supafast
branch
from
d8fe45f
to
7046fea
Dec 28, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
A small PR message nit:
three -> two |
This comment has been minimized.
This comment has been minimized.
|
Oops, indeed! |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Dec 30, 2016
bors
added a commit
that referenced
this pull request
Dec 30, 2016
bors
added a commit
that referenced
this pull request
Dec 30, 2016
bors
added a commit
that referenced
this pull request
Dec 30, 2016
bors
added a commit
that referenced
this pull request
Dec 30, 2016
bors
merged commit 7046fea
into
rust-lang:master
Dec 30, 2016
1 check passed
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
alexcrichton
deleted the
alexcrichton:supafast
branch
Dec 30, 2016
xen0n
referenced this pull request
Dec 31, 2016
Closed
rustbuild: save-analysis inadvertently nuked #38734
alexcrichton
referenced this pull request
Jan 1, 2017
Closed
change of libcompiler_builtins/lib.rs code doesn't retrigger a full rebuild anymore #38744
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
alexcrichton commentedDec 27, 2016
•
edited
This commit switches the rustbuild build system to compiling the
compiler twice for a normal bootstrap rather than the historical three
times.
Rust is a bootstrapped language which means that a previous version of
the compiler is used to build the next version of the compiler. Over
time, however, we change many parts of compiler artifacts such as the
metadata format, symbol names, etc. These changes make artifacts from
one compiler incompatible from another compiler. Consequently if a
compiler wants to be able to use some artifacts then it itself must have
compiled the artifacts.
Historically the rustc build system has achieved this by compiling the
compiler three times:
compiles all the libraries again.
This entire process amounts in compiling the compiler three times.
Additionally, this process always guarantees that the Rust source tree
can compile itself because the stage2 compiler (created by a freshly
created compiler) would successfully compile itself again. This
property, ensuring Rust can compile itself, is quite important!
In general, though, this third compilation is not required for general
purpose development on the compiler. The third compiler (stage2) can
reuse the libraries that were created during the second compile. In
other words, the second compilation can produce both a compiler and the
libraries that compiler will use. These artifacts must be compatible
due to the way plugins work today anyway, and they were created by the
same source code so they should be compatible as well.
So given all that, this commit switches the default build process to
only compile the compiler two times, avoiding this third compilation
by copying artifacts from the previous one. Along the way a new entry in
the Travis matrix was also added to ensure that our full bootstrap can
succeed. This entry does not run tests, though, as it should not be
necessary.
To restore the old behavior of a full bootstrap (three compiles) you can
either pass:
or if you're using config.toml:
Overall this will hopefully be an easy 33% win in build times of the
compiler. If we do 33% less work we should be 33% faster! This in turn
should affect cycle times and such on Travis and AppVeyor positively as
well as making it easier to work on the compiler itself.