-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
error: options -C bitcode-in-rlib=no
and -C lto
are incompatible
#71848
Comments
Is there a reason you're passing LTO via rustflags instead of setting it in Cargo.toml? That's the recommended approach, and should work I believe. |
Reason is that I don't always want LTO when building for release so by using RUSTFLAGS I can configure that without needing to edit source files whenever I want to enable/disable LTO. Some more tangible scenarios in my own codebase:
So the different scripts that power these things either set or don't set certain RUSTFLAGS |
You can set |
Woah thanks never knew about that! I suppose I'll leave the issue open since RUSTFLAGS="-C LTO" no longer works (unless that's intended?) But your answer solves my problems so I'm personally good to go. Thanks! |
cc @alexcrichton @nnethercote -- this is at least to me unexpected fallout but I personally think that just recommending people not set lto via RUSTFLAGS is reasonable (and instead use the environment variable overrides for Cargo). |
While not necessarily intentional it's going to be pretty hard to keep this working given the changes we have to Cargo in the pipeline. You'll likely want to use the profile env vars because Cargo has much more intrusive knowledge of LTO now for compile time speedups. This is definitely a regression but I would hope that we could rely on users moving to the profile env vars for both updated builds and compile time wins. |
I'm going to go ahead and close this as won't fix but cc @XAMPPRocky -- I've tagged this relnotes as a compat note, will it get picked up? |
Currently no, the |
RUSTFLAGS does not always work rust-lang/rust#71848 (comment)
116: Recommend CARGO_PROFILE_RELEASE_DEBUG r=djc a=chinedufn RUSTFLAGS does not always work rust-lang/rust#71848 (comment) Co-authored-by: Chinedu Francis Nwafili <[email protected]>
I recently updated to the latest nightly a couple of days ago and started getting an error when trying to build a crate.
The build command that I'm using is:
Version info (I've tried this on MacOS as well, also fails)
I see that there was some recent work around optimizing bitcode in rlibs (example: #66961 ), so that could be related but I'm not sure.
As far as I can tell I'm not setting
-C bitcode-in-rlib=no
anywhere - unless there's some way that it can be set by default in some scenarios?Minimal Reproduction Steps
Works fine on
nightly-2020-03-01
.(I didn't check any other nightly releases in between March and May)
The text was updated successfully, but these errors were encountered: