-
Notifications
You must be signed in to change notification settings - Fork 115
add Relink Don't Rebuild goal #722
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
susitsm
wants to merge
5
commits into
rust-lang:main
Choose a base branch
from
susitsm:relink-dont-rebuild
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
497e111
add Relink Don't Rebuild goal
susitsm de8b33a
Update src/2026/relink-dont-rebuild.md
susitsm 9a5e994
RDR: remove second compiler team ask
susitsm baddcc7
RDR: move time estimates to work item notes, expand on the benefits o…
susitsm a74b97b
RDR: standardize tracking issue and zulip links
susitsm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Relink Don't Rebuild | ||
|
|
||
| | Metadata | | | ||
| | :--------------- | -------------------------------------------------------------------------------- | | ||
| | Point of contact | @susitsm | | ||
| | Status | Proposed | | ||
| | What and why | Massive speedup of rebuilds in large multi-crate projects | | ||
| | Roadmap | Fast Builds | | ||
| | Tracking issue | | | ||
| | Other tracking issues | [https://github.com/rust-lang/rust/issues/158844] | | ||
| | Zulip channel | [https://rust-lang.zulipchat.com/#narrow/channel/604410-t-compiler.2Frelink-dont-rebuild] | | ||
|
|
||
| ## Summary | ||
|
|
||
| Implement the MCP [Relink Don't Rebuild](https://github.com/rust-lang/compiler-team/issues/790), which can give large speedups on [certain edits](https://github.com/rust-lang/cargo/issues/14604#issuecomment-4371471225) when rebuilding large projects with many crates. | ||
|
|
||
| There is an existing implementation waiting for review. The first goal is to get that through the review process, integrate with cargo and get it to nightly users. | ||
|
|
||
|
|
||
| ## Motivation | ||
|
|
||
|
|
||
| ### The status quo | ||
|
|
||
| For a long time, the preferred method for speeding up compilation of large projects was to split them into smaller crates. Today, large projects consist of many crates with a complex dependency graph. When a crate is edited, it causes all dependents to recompile, leading to slow compile times even when the edited crate is small. | ||
|
|
||
| ### What we propose to do about it | ||
|
|
||
| Calculate the public API hash of crates and only recompile dependents when it changes, greatly improving iteration speed for edits not changing the public API of a crate. This is similar to how C compilers only recompile the edited `.c` file then relink the final binary. Other code will not get recompiled unless the header file changes. | ||
|
|
||
| The largest concern of adding such public API hash is maintainability: adding new language features should automatically get added to the public API hash, otherwise RDR can quickly become riddled with silent miscompiles. The proposed implementation solves this problem by building on the metadata ("header") files produced by rustc, automatically integrating any new data added to it. | ||
|
|
||
| ### Work items over the next year | ||
|
|
||
| #### Usable implementation in nightly, with limitations. | ||
| | Task | Owner(s) | Notes | | ||
| | ----------- | -------- | ----- | | ||
| | Split up the existing implementation into smaller PRs, review | @susitsm, reviewer | 2 months | | ||
| | Cargo integration | @susitsm | 1 month | | ||
| | Add a mode that ignores spans | @susitsm | | | ||
|
|
||
| #### Stabilization | ||
| | Task | Owner(s) | Notes | | ||
| | ----------- | -------- | ----- | | ||
| | Restore compiler diagnostics | @susitsm | 1 month | | ||
| | Optimize the implementation | @susitsm | 2 months | | ||
| | Add an "update spans" mode to rustc | @susitsm | 5 months | | ||
| | Integrate with rustdoc | @susitsm | 1 month | | ||
|
|
||
| ## Team asks | ||
|
|
||
| | Team | Support level | Notes | | ||
| | ---------- | ------------- | --------------------------------------- | | ||
| | [cargo] | Small | review cargo integration | | ||
| | [compiler] | Medium | dedicated reviewer | | ||
|
|
||
| ## Funding | ||
|
|
||
| The duration of the project is 12 months. With distinct subgoals which can be funded independently. | ||
|
|
||
| - Month 1-3 (Usable implementation in nightly) | ||
| - This stage could already provide benefits for nightly users, at the cost of possibly incorrect line info in diagnostics and debuginfo of dependents. This would greatly help `cargo check` runs in IDE-s, since debuginfo is not a concern there. | ||
| - Some diagnostics will not be available | ||
| - Lot of the work is already done, needs review. | ||
| - Month 4-12 (Stabilization) | ||
| - Performance optimizations | ||
| - Fixing the holes required for a stable release | ||
|
|
||
| | Purpose | Cost | Funded | Sponsor(s) | | ||
| |---------|------|--------|------------| | ||
| | Contributor - Nightly implementation | Ask | No | | | ||
| | Reviewer - Nightly implementation | Ask | No | | | ||
| | Contributor - Stabilization | Ask | No | | | ||
|
|
||
|
|
||
| ## Frequently asked questions | ||
Oops, something went wrong.
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.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.