Skip to content

Support Cargo 1.100 in the Rust workspace cache - #59

Merged
charliermarsh merged 10 commits into
mainfrom
charlie/rust-workspace-cache-cargo-1.100
Nov 16, 2026
Merged

charliermarsh merged 10 commits into
mainfrom
charlie/rust-workspace-cache-cargo-1.100

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Cargo 1.100 moves intermediate artifacts from target/<profile>/.fingerprint/<package>-<hash> and deps into target/<profile>/build/<package>/<hash>. The workspace cache currently fails during post-job pruning because .fingerprint no longer exists, and its input restoration cannot invalidate build-script outputs in the new layout.

We now prune Cargo 1.100 build units and invalidate their complete outputs when tracked inputs change, while retaining support for the older layout. Pruning retains package names shared by workspace members and dependencies, since the artifact path cannot distinguish their versions or sources. Input invalidation conservatively rebuilds same-name units to avoid stale output. We also reject deletion paths outside the configured target or reached through symlinks. The smoke test runs against Rust 1.99 and 1.100 on Linux, macOS, and Windows.

@ewdurbin ewdurbin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

codex assisted review surfaced a few findings.

Comment thread rust-workspace-cache/prune/prune.py Outdated

# Cargo 1.100 stores each compilation unit, including its outputs, under
# build/<package>/<hash>. Do not follow symlinks supplied by a cache.
if not build_root.is_symlink() and build_root.is_dir():

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this appears to be pre-existing, but is_symlink() misses NTFS junctions, so this may traverse outside of the expected directory. similar handling needs to be done for the inputs as well.

reproduction test: c4cf367

if unit.is_symlink() or not unit.is_dir():
protected_fingerprints.add(unit.name)
continue
record(package_directory.name, unit.name, unit / "fingerprint")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

on a case-insensitive filesystem, this may misattribute a dependency's unit to the workspace crate and prune it.

reproduction test: 18898b6

Comment thread rust-workspace-cache/prune/prune.py Outdated
# a dependency with that name, so retain both when the lockfile is ambiguous.
with (Path(metadata["workspace_root"]) / "Cargo.lock").open("rb") as lockfile:
locked = tomllib.load(lockfile)
counts = Counter(package["name"] for package in locked.get("package", ()))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should entries from legacy lockfiles with [root] be included here? if not some members may be dropped from being eligible for pruning.

reproduction test: abdcfcf

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would personally remove this file entirely, IMO the benefit is small 🙂

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(Same for this file.)

@charliermarsh
charliermarsh merged commit ef53ab3 into main Nov 16, 2026
6 checks passed
@charliermarsh
charliermarsh deleted the charlie/rust-workspace-cache-cargo-1.100 branch November 16, 2026 21:43
charliermarsh added a commit to astral-sh/uv that referenced this pull request Nov 16, 2026
## Summary

Rust 1.100 is now stable. We update the default Rust toolchains to
1.100.0 and raise the MSRV to 1.98.0 under our N−2 support policy. We
also upgrade Hawk to 0.1.18, which supports Rust 1.100.

We update the trampoline to the first Rust 1.98 nightly and regenerate
its six Windows executables. We also resolve new Cargo and Clippy
warnings, update macOS test signing for Cargo 1.100’s build layout, and
pin the workspace cache to the compatible action from
astral-sh/github-actions#59.

---------

Co-authored-by: Charlie Marsh <charliemarsh@openai.com>
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.

4 participants