WIP: [32.x] Backports

bitcoin/bitcoin: PR #36984

Backport verdict: Needs clarification

Fidelity could not be established from the available evidence.

Evidence:

Limitations:

Coverage details

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

The upstream relocation explicitly distinguishes reusable downloaded inputs from checkout-generated snapshots: downloaded archives remain shareable through SOURCES_PATH, while local archives and their checksum stamps belong with the checkout in WORK_PATH. Existing timestamp-based invalidation is intentionally unchanged.

At the pinned base, both local archives and fetched stamps use SOURCES_PATH. The head selects WORK_PATH/local-sources for local packages and derives the fetched-stamp location from the same source directory. This implements the stated cache boundary without changing downloaded-source sharing.

Source 1

Guix's normalized checkout location makes absolute source paths unsuitable as the isolation boundary: the upstream proposal states that each checkout appears at /bitcoin inside its build container, so path-distinguished archives in a shared SOURCES_PATH would still collide there.

WORK_PATH provides isolation through checkout-associated storage rather than through a globally unique pathname. The pinned Guix script downloads sources before entering its network-isolated build environment, making the distinction between shared downloaded inputs and generated local snapshots pertinent to this workflow.

Source 1

The historical cache-invalidation report separates checksum correctness from source-selection correctness. A fetched stamp can correctly hash an archive, and that checksum can correctly affect the build ID, while the archive still represents another checkout. Its stated requirements include coexistence of different trees and equal checksums for identical trees regardless of worktree location.

This explains why archives and fetched stamps must be considered together: a valid stamp is evidence about the selected archive, not independent evidence that it represents the current local directory. The relocation addresses checkout separation; the upstream proposal does not claim to replace timestamp invalidation with complete content-change detection.

Source 1 · Source 2

Ralph's inferences

The retained implementation trades repeated archive generation and hashing for timestamp-based reuse. It regenerates when the archive is absent or a local path is newer, removes the fetched stamp when regenerating, and refreshes that stamp when absent or older than the archive. It normalizes source mtimes and sorts archive entries before creating the tarball.

These mechanics explain the compatibility constraint: reuse assumes that the cached snapshot already belongs to the same source context, and timestamp ordering signals later changes. Normalized mtimes cannot establish ownership of an archive obtained from another checkout. The relocation leaves this reuse mechanism intact.

Source 1

WORK_PATH preserves the documented reuse model under its default checkout-local configuration: repeated builds can reuse one checkout's archive and stamp, while separate checkouts need not share those generated files. This is a storage-isolation guarantee, not a new content-identity or timestamp-invalidation guarantee.

The pinned head defines WORK_PATH as the checkout's depends/work directory and places local archives and stamps beneath it. Thus the same /bitcoin spelling in separate Guix containers need not imply shared local-cache storage. This conclusion is conditional on retaining checkout-local work storage; it does not establish isolation for deliberately shared WORK_PATH configurations or broaden the unchanged mtime contract.

Source 1