Skip to content

Preserve non-UTF-8 paths in build-cache GC records - #530

Open
charliermarsh wants to merge 1 commit into
charlie/ordered-postcard-lockfrom
charlie/non-utf8-gc-identities
Open

charliermarsh wants to merge 1 commit into
charlie/ordered-postcard-lockfrom
charlie/non-utf8-gc-identities

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A non-UTF-8 path to rustc or its driver prevented Cargo from recording which toolchain owned a shared build. A later cargo gc --max-age 365d could remove a registry artifact that a warm cargo check had just used.

Cargo records UTF-8 paths as JSON strings and other Unix paths as their original bytes. A warm check can register a previously untracked build, and removing the driver still lets GC retire it. The regression exercises the actual filename on filesystems that accept it and checks the byte representation on macOS even when APFS rejects that name.

In the combined Linux SDK, cargo gc retained the warm registry artifact with either 0xff or 0xfe in the driver directory name. Removing the driver made the next collection delete the artifact in both cases. Packaged SDK replay

Closes #529.

@charliermarsh
charliermarsh force-pushed the charlie/non-utf8-gc-identities branch from 78a5546 to 131e969 Compare November 10, 2026 12:03
@charliermarsh
charliermarsh marked this pull request as ready for review November 10, 2026 12:14
@charliermarsh
charliermarsh force-pushed the charlie/non-utf8-gc-identities branch from 131e969 to bf2f799 Compare November 10, 2026 12:27
charliermarsh added a commit to astral-experiments/ohm that referenced this pull request Nov 10, 2026
## Summary

Ohm 1.99.0-31 lets optimized Rust libraries reuse a checked LLVM object
before optimization. LLVM can also reuse an object after bounded source
edits when every observed line has an unambiguous destination. These
paths target incremental O1 builds on x86-64 Linux. [LLVM
stack](astral-experiments/ohm-llvm#22) · [Rust
compiler
change](astral-experiments/ohm-rust#397)

Rustc preserves caller locations across worktrees, indexes consecutive
procedural-macro spans directly, and retains the joined span of
type-relative struct paths. Clippy uses those paths when checking
patterns and expressions. [Rust span
changes](astral-experiments/ohm-rust#400) ·
[Clippy
companion](astral-experiments/ohm-rust-clippy#83)

Cargo documents libraries with names up to 242 bytes and retains active
shared builds whose compiler or driver path contains non-UTF-8 bytes.
Its checked-in lockfile also matches dependency resolution in a
read-only checkout. [Cargo
stack](astral-experiments/ohm-cargo#530)
@charliermarsh
charliermarsh force-pushed the charlie/non-utf8-gc-identities branch from bf2f799 to 0e91fb8 Compare November 17, 2026 06:26
@charliermarsh
charliermarsh removed this pull request from stack #524 November 17, 2026 06:28
@charliermarsh
charliermarsh added this pull request to stack #544 November 17, 2026 06:33
@charliermarsh
charliermarsh force-pushed the charlie/non-utf8-gc-identities branch from 0e91fb8 to 39b50e1 Compare November 17, 2026 07:02
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.

1 participant