Skip to content
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

Ignore incremental when lto is set. #6643

Closed
wants to merge 1 commit into from

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Feb 7, 2019

This makes it so that incremental compilation is forcefully disabled if lto is enabled, instead of failing to compile.

This moves incremental logic into the profile computation, which makes it a little more consistent and helps simplify things a little (such as removing the fingerprint special-case).

This also introduces a small change in behavior with the build.incremental config variable. Previously build.incremental = true was completely ignored. Now, it is treated the same as CARGO_INCREMENTAL=1 environment variable.

Another small change is to move config profile validation to the workspace so that warnings do not appear multiple times (once for each manifest).

Fixes #4255

@rust-highfive
Copy link

r? @dwijnand

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

@dwijnand
Copy link
Member

dwijnand commented Feb 7, 2019

LGTM, but looks like the kind of thing we'd want Alex's eyes on.

r? @alexcrichton

@alexcrichton
Copy link
Member

Thanks for this!

Everything looks great here to me, but would it be possible to hold off on the final change for disabling incremental with LTO for a few days? I think this is something we'll actually want to fix in upstream rustc, especially before turning incremental release mode on by default. I think the fix shouldn't be too hard in theory too!

I was also under the impression that this wasn't coming up too much in practice, but if it is coming up a lot then we should probably go ahead and land anyway

@ehuss
Copy link
Contributor Author

ehuss commented Feb 8, 2019

Absolutely, there is no rush at all. I don't think it's coming up much at all.

Can you say more what rustc would do? Would it also ignore incremental, or is it being changed so that incremental works with lto?

@alexcrichton
Copy link
Member

Oh I'd ideally just like to get incremental working with LTO. The compiler could at least be incremental up to the point that it executes LTO, which is as good of an interpretation as we can make of incremental + LTO

@alexcrichton
Copy link
Member

My intention is that rust-lang/rust#58378 makes the behavior change here obsolete as LTO + incremental should work, but this contains good refactorings regardless and would be good to land!

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 12, 2019
Currently the compiler will produce an error if both incremental
compilation and full fat LTO is requested. With recent changes and the
advent of incremental ThinLTO, however, all the hard work is already
done for us and it's actually not too bad to remove this error!

This commit updates the codegen backend to allow incremental full fat
LTO. The semantics are that the input modules to LTO are all produce
incrementally, but the final LTO step is always done unconditionally
regardless of whether the inputs changed or not. The only real
incremental win we could have here is if zero of the input modules
changed, but that's so rare it's unlikely to be worthwhile to implement
such a code path.

cc rust-lang#57968
cc rust-lang/cargo#6643
Centril added a commit to Centril/rust that referenced this pull request Feb 14, 2019
…haelwoerister

rustc: Implement incremental "fat" LTO

Currently the compiler will produce an error if both incremental
compilation and full fat LTO is requested. With recent changes and the
advent of incremental ThinLTO, however, all the hard work is already
done for us and it's actually not too bad to remove this error!

This commit updates the codegen backend to allow incremental full fat
LTO. The semantics are that the input modules to LTO are all produce
incrementally, but the final LTO step is always done unconditionally
regardless of whether the inputs changed or not. The only real
incremental win we could have here is if zero of the input modules
changed, but that's so rare it's unlikely to be worthwhile to implement
such a code path.

cc rust-lang#57968
cc rust-lang/cargo#6643
@bors
Copy link
Contributor

bors commented Feb 20, 2019

☔ The latest upstream changes (presumably #6687) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton
Copy link
Member

Since rust-lang/rust#58378 ended up landing the functional change here I think is no longer necessary, but the refactorings still look good to me. @ehuss want to rebase and we can merge?

@ehuss
Copy link
Contributor Author

ehuss commented Feb 20, 2019

Closing in favor of #6688.

@ehuss ehuss closed this Feb 20, 2019
bors added a commit that referenced this pull request Feb 20, 2019
Incremental profile cleanup.

Some minor code cleanup, and doc updates regarding incremental compilation.

Move incremental logic into the profile computation, which makes it a little more consistent and helps simplify things a little (such as removing the fingerprint special-case).

This introduces a small change in behavior with the `build.incremental` config variable. Previously `build.incremental = true` was completely ignored. Now, it is treated the same as `CARGO_INCREMENTAL=1` environment variable.

Moves config profile validation to the workspace so that warnings do not appear multiple times (once for each manifest).

Split from #6643.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants