Skip to content

Conversation

@ranger-ross
Copy link
Member

@ranger-ross ranger-ross commented Jun 22, 2025

I'd like to revive the Cargo user wide cache project goal from 2024H2.
Many sections remain unchanged, but some have been updated as there was some progress towards this in 2025H1.

Rendered

Comment on lines 55 to 59
* Stabilize Cargo `build-dir` which allows users to move intermediate build artifacts out of `target` (rust-lang/cargo#14125)
* Rework the build directory layout so that we have more easily cacheable "units" (rust-lang/cargo#15010)
* Work towards a user wide build cache that can be reused across projects/workspaces. (rust-lang/cargo#5931)
* Explore possibilities of extending this build cache to support remote storage enabling continuous integration use cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

Something we discussed today in the cargo team meeting is that this seems a little ambitious for a 6-month goal. I'm not sure what changes would be appropriate, but maybe @epage has some ideas.

Copy link
Contributor

Choose a reason for hiding this comment

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

My thought was to scale this down to the build directory layout re-work + experiments with an alternative locking scheme to try to help with r-a today and inform the locking scheme we use on the shared cache.

Copy link
Member Author

@ranger-ross ranger-ross Jul 9, 2025

Choose a reason for hiding this comment

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

Sure, seems reasonable. I suppose nothing is stopping us from continuing towards the shared cache if things go quicker than expected.

I'll update this goal later this week.

Copy link
Member Author

Choose a reason for hiding this comment

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

I scoped the goal down to just build dir layout and locking changes.

@ranger-ross ranger-ross force-pushed the better-cargo-caching branch from 8955102 to 38a88f5 Compare July 13, 2025 13:00
Copy link
Member

@lqd lqd left a comment

Choose a reason for hiding this comment

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

Making CI pass

| Teams | <!-- TEAMS WITH ASKS --> |
| Task owners | <!-- TASK OWNERS --> |
| Status | Proposed |
| Tracking issue | *if this is a continuing goal, add the old tracking issue, else leave blank* |
Copy link
Member

Choose a reason for hiding this comment

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

As the line says, this needs to be blank.

Suggested change
| Tracking issue | *if this is a continuing goal, add the old tracking issue, else leave blank* |
| Tracking issue | |

| Metadata | |
|:-----------------|----------------------------------------------------------------------------------|
| Point of contact | @ranger-ross |
| Teams | <!-- TEAMS WITH ASKS --> |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| Teams | <!-- TEAMS WITH ASKS --> |
| Teams | <!-- TEAMS WITH ASKS --> |

|:-----------------|----------------------------------------------------------------------------------|
| Point of contact | @ranger-ross |
| Teams | &lt;!-- TEAMS WITH ASKS --&gt; |
| Task owners | &lt;!-- TASK OWNERS --&gt; |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| Task owners | &lt;!-- TASK OWNERS --&gt; |
| Task owners | <!-- TASK OWNERS --> |

Comment on lines 23 to 24
* Fine grain locking within the build directory
* Reducing build dir lock contention between Cargo and Rust Analyzer
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Fine grain locking within the build directory
* Reducing build dir lock contention between Cargo and Rust Analyzer
* Fine grain locking within the build directory
* Reducing build dir lock contention between Cargo and Rust Analyzer

@ranger-ross ranger-ross force-pushed the better-cargo-caching branch from 38a88f5 to cddef88 Compare July 19, 2025 04:36
@nikomatsakis nikomatsakis merged commit 7ab1743 into rust-lang:main Jul 21, 2025
2 checks passed
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