Skip to content

Add bridge between incrementals #367

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

blyxyas
Copy link
Member

@blyxyas blyxyas commented Jul 27, 2025

@nikomatsakis Could I submit this late? I read August 18 instead of July 18 in your email. I think it's still worth but obviously no worries if it messes up the project's timeline.


This Project goal would create a bridge (i.e. compatibility layer) between all compiler-adjacent activities in order to reuse compilation cache between cargo check, build, clippy and any other tool (So it would also be useful for tools like cargo-semver-checks, iinm). The end goal would be to unify workflows, and:

  • In CI machines, reduce compilation-checking-testing time,
  • And for user's machines reduce target directory size and shrink the DX feedback loop.

Again, sorry for the late submission. I'm still very confident that it's a good goal.

Rendered

@blyxyas blyxyas force-pushed the bridge_between_incrementals branch from 391b852 to 3e6af69 Compare July 27, 2025 19:10
Comment on lines 20 to 21
Redoing work between `cargo check`, `cargo build` and other commands such as `cargo clippy` is one of the greatest pain
points in the realm of compiler performance. Being able to reuse this information would speed up by a lot both
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, this comes across as a pretty strong statement and yet it doesn't match my experience or those I've talked to.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might come across as stronger than I expected. But I've heard multiple people complain before about having to recheck everything after a cargo check for a cargo build and similar.

`cargo check`, `cargo build`, and any other external tool that might benefit from sharing incremental information
such as `cargo clippy`.

## Motivation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure where this might fit but our issue for this is rust-lang/cargo#3501

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the same effort but I've tried this: rust-lang/cargo#15627. And @bjorn3 pointed out an issue that is needed to be address:

A check and regular build will produce a different crate hash, so if you do cargo check; cargo build -p some_dep; cargo check you are now forced to rebuild everything that depends on some_dep as the crate hash of some_dep changed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this model, cargo build -p some_dep would have the atomic bits "emit-bin", mark red all emit-exclusive queries, rerun those, and save them into the "emit-bin" atomic response (along with other emit-exclusive metadata)

Any activity looking for some_dep's "emit-bin" information would request that, but if they do not request it, they'll be met with the information produced by cargo check.

So for the second cargo check, it would be like if some_dep was never built in the first place.

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.

3 participants