-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add support for -Cembed-bitcode=no
#8066
Conversation
r? @ehuss (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -41,6 +41,8 @@ pub struct TargetInfo { | |||
pub rustflags: Vec<String>, | |||
/// Extra flags to pass to `rustdoc`, see `env_args`. | |||
pub rustdocflags: Vec<String>, | |||
/// REmove this when it hits stable (1.44) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: extraneous upper-case 'E'.
This commit is the Cargo half of support necessary for rust-lang/rust#70458. Today the compiler emits embedded bytecode in rlibs by default, but compresses it. This is both extraneous disk space and wasted build time for almost all builds, so the PR in question there is changing rustc to have a `-Cembed-bitcode` flag which, when enabled, places the bitcode in the object file rather than an auxiliary file (no extra compression), but also enables `-Cembed-bitcode=no` to disable bitcode emission entirely. This Cargo support changes Cargo to pass `-Cembed-bitcode=no` for almost all compilations. Cargo will keep `lto = true` and such working by not passing this flag (and thus allowing bitcode to get embedded), but by default `cargo build` and `cargo build --release` will no longer have any bitcode in rlibs which should result in speedier builds! Most of the changes here were around the test suite and various assertions about the `rustc` command lines we spit out. One test was hard-disabled until we can get `-Cembed-bitcode=no` into nightly, and then we can make it a nightly-only test. The test will then be stable again once `-Cembed-bitcode=no` hits stable. Note that this is intended to land before the upstream `-Cembed-bitcode` change. The thinking is that we'll land everything in rust-lang/rust all at once so there's no build time regressions for anyone. If we were to land the `-Cembed-bitcode` PR first then there would be a build time regression until we land Cargo changes because rustc would be emitting uncompressed bitcode by default and Cargo wouldn't be turning it off.
38133eb
to
bac300b
Compare
@bors r+ It would be nice to have a better way to check compiler flags. |
📌 Commit bac300b has been approved by |
☀️ Test successful - checks-azure |
Update cargo 4 commits in 6e07d2dfb7fc87b1c9489de41da4dafa239daf03..390e8f245ef2cd7ac698b8a76abf029f9abcab0d 2020-03-31 03:22:39 +0000 to 2020-04-07 17:46:45 +0000 - Compatibility for rust-lang#69926 (rust-lang/cargo#8080) - Add note about converting triple case in environment variables (rust-lang/cargo#8079) - Add support for `-Cembed-bitcode=no` (rust-lang/cargo#8066) - Add triagebot configuration (rust-lang/cargo#8059)
Update cargo 4 commits in 6e07d2dfb7fc87b1c9489de41da4dafa239daf03..390e8f245ef2cd7ac698b8a76abf029f9abcab0d 2020-03-31 03:22:39 +0000 to 2020-04-07 17:46:45 +0000 - Compatibility for rust-lang#69926 (rust-lang/cargo#8080) - Add note about converting triple case in environment variables (rust-lang/cargo#8079) - Add support for `-Cembed-bitcode=no` (rust-lang/cargo#8066) - Add triagebot configuration (rust-lang/cargo#8059)
This commit is the Cargo half of support necessary for
rust-lang/rust#70458. Today the compiler emits embedded bytecode in
rlibs by default, but compresses it. This is both extraneous disk space
and wasted build time for almost all builds, so the PR in question there
is changing rustc to have a
-Cembed-bitcode
flag which, when enabled,places the bitcode in the object file rather than an auxiliary file (no
extra compression), but also enables
-Cembed-bitcode=no
to disablebitcode emission entirely.
This Cargo support changes Cargo to pass
-Cembed-bitcode=no
for almostall compilations. Cargo will keep
lto = true
and such working by notpassing this flag (and thus allowing bitcode to get embedded), but by
default
cargo build
andcargo build --release
will no longer haveany bitcode in rlibs which should result in speedier builds!
Most of the changes here were around the test suite and various
assertions about the
rustc
command lines we spit out. One test washard-disabled until we can get
-Cembed-bitcode=no
into nightly, andthen we can make it a nightly-only test. The test will then be stable
again once
-Cembed-bitcode=no
hits stable.Note that this is intended to land before the upstream
-Cembed-bitcode
change. The thinking is that we'll land everything in rust-lang/rust all
at once so there's no build time regressions for anyone. If we were to
land the
-Cembed-bitcode
PR first then there would be a build timeregression until we land Cargo changes because rustc would be emitting
uncompressed bitcode by default and Cargo wouldn't be turning it off.