mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:44:38 +00:00
depends: keep local source archives in WORK_PATH #35765
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!35765
Loading…
Reference in a new issue
No description provided.
Delete branch "guix-depends-hash-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Local package tarballs are generated from the current checkout, but depends caches them alongside downloaded archives in
SOURCES_PATH. When checkouts share that directory, a cached local tarball can be newer than another checkout's source files, causing depends to build the wrong sources with a valid checksum and build ID.Store local package tarballs and their checksum stamps in
WORK_PATH/local-sourcesinstead.WORK_PATHis per-checkout by default, so generated snapshots stay with their checkout while downloaded sources remain shareable throughSOURCES_PATH. Existing mtime-based invalidation is unchanged.This also handles
contrib/guix/guix-build, which mounts each checkout at/bitcoin. Distinguishing local tarballs by absolute source path cannot isolate those builds whenSOURCES_PATHis shared.Validation: focused checks reproduced the same-path collision with the path-hash approach and verified isolation with this change. Host/container source checksums and build IDs match; archive reuse, refresh after an edit, and downloaded-source paths were also checked. No full Guix build was run.
Addresses #35764.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
No conflicts as of last run.
Not sure if it might be better to set depends mtime to
2000-01-01 12:00:00 UTCas is done bydefault_build_TOUCHalready? Perhaps it could be...Build of this PR:
🐙 This pull request conflicts with the target branch and needs rebase.
Code review ACK
6ea85f57fb. Thanks for the update! Code changes look right, matching the patch from https://github.com/bitcoin/bitcoin/issues/35764#issuecomment-5036720342.I do find the PR description and the
packages.mdaddition a bit confusing though because they both seem focused on internal implementation details, instead of describing visible behavior. The existing Local Packages documentation already says the package is rebuilt when the local directory's contents change, which is what was originally intended and what's fixed by this change. The added text makes it harder to understand I think.Might suggest PR title "depends: give local package tarballs unique filenames per source path" and description more like:
Thanks @ryanofsky I took your title and description wholesale.
I feel like the packages.md change is OK though? It's quite a developer-focused document.
Thanks for the update!
Yeah it's fine. I just think it muddies the description and makes it less clear by describing a problem that the code does not have ("without reusing each others source archives"). The current paragraph ends with a clear takeaway: if you touch the source directory, the package will be rebuilt. Now there are more details about hashes and absolute paths and an interaction with a separate SOURCES_PATH feature which is not well documented itself. It's good for the local packages feature to be compatible with the SOURCES_PATH feature, but it should be a starting assumption that different features are compatible with each other. It is not reassuring for documentation to say if you use this one feature with this other feature the wrong thing won't happen.
I do think the comment would be fine and potentially helpful as code comment in code where the hash is being constructed.
OK you've persuaded me. Dropped the doc comment in latest push.
Code review ACK
22374481a7. Since last review, just dropped the documentation change. Left a comment below suggesting an alternative approach, but this looks good as is.In commit "depends: isolate local archives by source path" (
22374481a7)Looking into this more, I think a simpler alternative could be to store local package tarballs in
WORK_PATHinstead ofSOURCES_PATH, which I implemented in fec2762f18a5020b16db84907b5b12e5fb5f9945 (tag).Files in
SOURCES_PATHare downloaded sources identified by names and hashes fixed in the package definitions, which is what makes it safe to share the directory between checkouts. Local package tarballs are different and depend on files in the current checkout so don't actually make sense to share. If local tarballs are stored inWORK_PATHinstead ofSOURCES_PATHthey are automatically not shared and there is no need to uniquely identify different checkouts with hashes.Other benefits of this approach: This would also mean that building does not need to write to
SOURCES_PATHwhen sources are downloaded beforehand, so a sharedSOURCES_PATHcould be mounted read-only in build containers instead of read-write. And old tarballs would be removed along with their checkouts instead of accumulating inSOURCES_PATH.The current PR is still an improvement and looks fine to merge as is, so this is just a suggestion.
Base:
d4b0e1e4b078dbb4ab57886d288470684dec5718Head:
01491f22b2c77d632e8503cc446140d1ab6ccc21Design and approach
Local snapshot reuse is lost when WORK_PATH is cleaned (depends/funcs.mk:117, head)
The fetched stamp now follows the local source directory, so both it and the generated archive are under WORK_PATH.
make cleanremoves WORK_PATH, while the Guix workflow and CI preserve or cache SOURCES_PATH instead. After cleanup or on a fresh CI runner, local snapshots formerly retained in SOURCES_PATH are regenerated by walking and tarring the local directory. Is this recurring work an intentional tradeoff? If measurements show it is material, a persistent content-addressed snapshot cache could preserve reuse without reusing different contents across checkouts. Otherwise, document and accept the regeneration.Review coverage was incomplete. The adversarial_glm review had incomplete evidence.
Full review report
Code review ACK
01491f22b2. Thanks for picking up theWORK_PATHapproach, and the commit message change is an improvement (WORK_PATHcan be overridden, so "defaults to" is more accurate).Since I wrote this commit, it would be good to get review from someone else before merging. A guix build from two checkouts sharing
SOURCES_PATH, with different libmultiprocess sources in each, would be a useful test if anyone has guix set up, since I only tested this in a simulated container.ACK
01491f22b2Backported this to
32.xin #36984.Backported this to
31.xin #36928.Backported to
30.xin #36929.ralph referenced this pull request2026-11-27 15:17:33 +00:00
ralph referenced this pull request2026-11-27 15:20:35 +00:00
ralph referenced this pull request2026-11-27 15:36:31 +00:00