fix(hardlink): name the mutable set directly, under both build-dir layouts #16

Merged
claude merged 4 commits from fix/layout-v2-selection into main 2026-08-27 20:03:41 +00:00
2 changed files with 13 additions and 7 deletions
Showing only changes of commit fb3c72aa28 - Show all commits
+9 -4
View File
@@ -523,10 +523,15 @@ unshare_mutable_paths() {
# Measured 2026-08-27 on cargo 1.93.1 stable, 1.96.0-nightly, 1.98.0-nightly # Measured 2026-08-27 on cargo 1.93.1 stable, 1.96.0-nightly, 1.98.0-nightly
# (layout v1) and 1.100.0-nightly (e8cb624d5, layout v2), mold and the # (layout v1) and 1.100.0-nightly (e8cb624d5, layout v2), mold and the
# default linker alike: a `cargo test --no-run` binary in a `cp -al` clone # default linker alike: a `cargo test --no-run` binary in a `cp -al` clone
# rewrote the SOURCE's copy of itself in place, under both layouts. Hardlink # rewrote the SOURCE's copy of itself in place, under both layouts.
# count at link time is NOT what decides it — measured 2 in both a rewritten #
# and an intact case, and two test binaries of one crate at `nlink == 1` # What separates that from the executables measured INTACT is not
# behaved differently from each other. See gitdan-actions#17. # established. Every intact case observed was one Cargo has to re-create
# anyway to maintain an uplift hardlink — a bin target's
# `deps/<bin>-<hash>`, twinned at `<profile>/<bin>`. Whether the twin is the
# mechanism or a correlate of it was not determined, and the rule below does
# not depend on the answer: exempting twinned executables would recover no
# bytes this function newly copies. See gitdan-actions#17.
# #
# The executable bit is the discriminator because it is the linker's own # The executable bit is the discriminator because it is the linker's own
# output that is at risk, not the directory it happens to land in — `.rlib`, # output that is at risk, not the directory it happens to land in — `.rlib`,
+4 -3
View File
@@ -587,9 +587,10 @@ echo "=== a linked TEST binary, which nothing uplifts and nothing replaces ==="
# dep-info mutations the previous scenario already covers, and the scenario # dep-info mutations the previous scenario already covers, and the scenario
# pinned nothing. A bin-only crate with a unit test does exhibit the rewrite, # pinned nothing. A bin-only crate with a unit test does exhibit the rewrite,
# on cargo 1.93.1 stable and on 1.98.0-nightly and 1.100.0-nightly, so that is # on cargo 1.93.1 stable and on 1.98.0-nightly and 1.100.0-nightly, so that is
# what this builds. `nlink` does not predict which is which — two test binaries # what this builds. The shape is chosen by measurement rather than derived:
# of one crate, both at 1, behaved differently — so the shape is chosen by # what separates a rewritten executable from an intact one is not established,
# measurement rather than derived. # so the only crate shape this scenario may rest on is one observed to exhibit
# the rewrite.
mkbincrate() { mkbincrate() {
local dir="$1" marker="$2" local dir="$1" marker="$2"
mkdir -p "$dir/src" mkdir -p "$dir/src"