depends: keep local source archives in WORK_PATH #35765

Manually merged
willcl-ark merged 1 commit from guix-depends-hash-check into master 2026-11-25 20:30:00 +00:00 AGit
willcl-ark commented 2026-07-21 14:40:17 +00:00 (Migrated from github.com)

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-sources instead. WORK_PATH is per-checkout by default, so generated snapshots stay with their checkout while downloaded sources remain shareable through SOURCES_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 when SOURCES_PATH is 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.

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-sources` instead. `WORK_PATH` is per-checkout by default, so generated snapshots stay with their checkout while downloaded sources remain shareable through `SOURCES_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 when `SOURCES_PATH` is 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.
DrahtBot commented 2026-07-21 14:40:25 +00:00 (Migrated from github.com)

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.

Type Reviewers
ACK ryanofsky, fanquake

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.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/35765 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/35765.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/35765#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [ryanofsky](https://github.com/bitcoin/bitcoin/pull/35765#pullrequestreview-5529992415), [fanquake](https://github.com/bitcoin/bitcoin/pull/35765#issuecomment-7173695947) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts No conflicts as of last run. <!--5faf32d7da4f0f540f40219e4f7537a3-->
willcl-ark commented 2026-07-21 14:41:07 +00:00 (Migrated from github.com)

Not sure if it might be better to set depends mtime to 2000-01-01 12:00:00 UTC as is done by default_build_TOUCH already? Perhaps it could be...

Not sure if it might be better to set depends mtime to `2000-01-01 12:00:00 UTC` as is done by `default_build_TOUCH` already? Perhaps it could be...
willcl-ark commented 2026-07-22 07:34:43 +00:00 (Migrated from github.com)

Build of this PR:

x86_64
eb548f6197dee88a0e125c04f7c43b7e3360f963c5b62d6dd7096def4d25ae82  guix-build-b1f79c9fa6dd/output/aarch64-linux-gnu/SHA256SUMS.part
30109d042a7a31893422649b11b5ac54fc2702d27dabedb9e286dc740e475cc4  guix-build-b1f79c9fa6dd/output/aarch64-linux-gnu/bitcoin-b1f79c9fa6dd-aarch64-linux-gnu-debug.tar.gz
04c50689d60f5f2d17631a7443cbd4ae5084f31de1934f22d488cdc630721816  guix-build-b1f79c9fa6dd/output/aarch64-linux-gnu/bitcoin-b1f79c9fa6dd-aarch64-linux-gnu.tar.gz
0a7a24fdf440a63382f1abf83c4a4cd4700bc68e14dbbb2d51ea98c8a0a65ac6  guix-build-b1f79c9fa6dd/output/arm-linux-gnueabihf/SHA256SUMS.part
9d1383085f267a8bf57842330ef856c4e1f0fd4efa899705a0e6b8e0f82e7144  guix-build-b1f79c9fa6dd/output/arm-linux-gnueabihf/bitcoin-b1f79c9fa6dd-arm-linux-gnueabihf-debug.tar.gz
e5bc8d5e63a299e64434dce0bcd0d1a953de77d0c12ea87dea1fe4af529f20b9  guix-build-b1f79c9fa6dd/output/arm-linux-gnueabihf/bitcoin-b1f79c9fa6dd-arm-linux-gnueabihf.tar.gz
da82d78e01c0cd69e6033633dabf3f4ab0fcb5c9d746ea68607f4f4e56bcedb8  guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/SHA256SUMS.part
13488634f71b849eea3f0ed70fcb96a4c08b7614ed22cd53c17a35030debbd01  guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/bitcoin-b1f79c9fa6dd-arm64-apple-darwin-codesigning.tar.gz
f7cadfe8ec4e02a569751fefa1a0a257c25cf6edcf9af69dcb73f6c697495e4f  guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/bitcoin-b1f79c9fa6dd-arm64-apple-darwin-unsigned.tar.gz
2a3f133c5ad11a657286c9f1b377fac100bfb6335f52a7ac0da565ebed7e8ce7  guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/bitcoin-b1f79c9fa6dd-arm64-apple-darwin-unsigned.zip
0210d6fad3c23629dd44259a318a098ab1d40cd2f614211323da423e00dbd6e2  guix-build-b1f79c9fa6dd/output/dist-archive/bitcoin-b1f79c9fa6dd.tar.gz
4ff5751126abad7c077158cdc5eae9d8826f61752cb73254ce2d718a5bae841f  guix-build-b1f79c9fa6dd/output/powerpc64-linux-gnu/SHA256SUMS.part
4b587f04770cb8fb1676de1ac47b2ff7a19dbb28296b6c86e4ead11cca74c103  guix-build-b1f79c9fa6dd/output/powerpc64-linux-gnu/bitcoin-b1f79c9fa6dd-powerpc64-linux-gnu-debug.tar.gz
627972cee5ff34f41d04fa051a171e9674b28bcc18ec8c2a3224e0aab8265c35  guix-build-b1f79c9fa6dd/output/powerpc64-linux-gnu/bitcoin-b1f79c9fa6dd-powerpc64-linux-gnu.tar.gz
54cd74d473f49f8bda4b198a8db4bb239b9b2b31dcd604072c9067e15e7676cd  guix-build-b1f79c9fa6dd/output/riscv64-linux-gnu/SHA256SUMS.part
0309b1be6f6a95e4a577ce4706bc658b150a6114341b260d6239833909f0a2d3  guix-build-b1f79c9fa6dd/output/riscv64-linux-gnu/bitcoin-b1f79c9fa6dd-riscv64-linux-gnu-debug.tar.gz
d3df748ea3e86ca0a60763955469b92ef496a6f1355c57618aee6ae32f421b4d  guix-build-b1f79c9fa6dd/output/riscv64-linux-gnu/bitcoin-b1f79c9fa6dd-riscv64-linux-gnu.tar.gz
20b826775a5bc1076e7dbb7b2d3025a98442463642e8e3ca22b736bd048feb14  guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/SHA256SUMS.part
8771f090263129505d2bc2aa333ba243439532713b54bfa792b79172513ca2fc  guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/bitcoin-b1f79c9fa6dd-x86_64-apple-darwin-codesigning.tar.gz
9fe8f90b64df1a86a0eeda61d3ef25c30c752ff3f3b41f00bf526c181c07339e  guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/bitcoin-b1f79c9fa6dd-x86_64-apple-darwin-unsigned.tar.gz
18b6ad45aed36993f4c296e79b04de8591bf325b793b7e797ce1819ae9fa6205  guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/bitcoin-b1f79c9fa6dd-x86_64-apple-darwin-unsigned.zip
06bfebb2f8d63caa53587e4612bb75da416740fb52b9cec7aeac75b8378718b1  guix-build-b1f79c9fa6dd/output/x86_64-linux-gnu/SHA256SUMS.part
bd5a7d537ee343f37eac47aa4b6ce2b762ba11564a8f455993f2ddf673c06e27  guix-build-b1f79c9fa6dd/output/x86_64-linux-gnu/bitcoin-b1f79c9fa6dd-x86_64-linux-gnu-debug.tar.gz
aa4b4dd950669df51fdb0b0cf0ed555cacc13878416390cc8a6a0258eb1490d3  guix-build-b1f79c9fa6dd/output/x86_64-linux-gnu/bitcoin-b1f79c9fa6dd-x86_64-linux-gnu.tar.gz
8f5052762e1f72be1c98b334a8cfdcc91a4f96e9fb4468259225347aec6f44f4  guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/SHA256SUMS.part
a534e9c6bf9165c1c093fd9e2a55c2cda1e6a8cfd076beba6ee8717ea61d9168  guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-codesigning.tar.gz
783ab6083576c93e74301574d326a07d36953249e17a90bcebb46d436c99d618  guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-debug.zip
2a5f744b0eeaccf29ad367b5b1cb32c75f5013792a9ca264894569fce6b3c6e5  guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-setup-unsigned.exe
1d2450834b8e53295b9e1317a817e9dddf7a48a5a3352b70fa2e92158a3a8d69  guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-unsigned.zip
Build of this PR: ``` x86_64 eb548f6197dee88a0e125c04f7c43b7e3360f963c5b62d6dd7096def4d25ae82 guix-build-b1f79c9fa6dd/output/aarch64-linux-gnu/SHA256SUMS.part 30109d042a7a31893422649b11b5ac54fc2702d27dabedb9e286dc740e475cc4 guix-build-b1f79c9fa6dd/output/aarch64-linux-gnu/bitcoin-b1f79c9fa6dd-aarch64-linux-gnu-debug.tar.gz 04c50689d60f5f2d17631a7443cbd4ae5084f31de1934f22d488cdc630721816 guix-build-b1f79c9fa6dd/output/aarch64-linux-gnu/bitcoin-b1f79c9fa6dd-aarch64-linux-gnu.tar.gz 0a7a24fdf440a63382f1abf83c4a4cd4700bc68e14dbbb2d51ea98c8a0a65ac6 guix-build-b1f79c9fa6dd/output/arm-linux-gnueabihf/SHA256SUMS.part 9d1383085f267a8bf57842330ef856c4e1f0fd4efa899705a0e6b8e0f82e7144 guix-build-b1f79c9fa6dd/output/arm-linux-gnueabihf/bitcoin-b1f79c9fa6dd-arm-linux-gnueabihf-debug.tar.gz e5bc8d5e63a299e64434dce0bcd0d1a953de77d0c12ea87dea1fe4af529f20b9 guix-build-b1f79c9fa6dd/output/arm-linux-gnueabihf/bitcoin-b1f79c9fa6dd-arm-linux-gnueabihf.tar.gz da82d78e01c0cd69e6033633dabf3f4ab0fcb5c9d746ea68607f4f4e56bcedb8 guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/SHA256SUMS.part 13488634f71b849eea3f0ed70fcb96a4c08b7614ed22cd53c17a35030debbd01 guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/bitcoin-b1f79c9fa6dd-arm64-apple-darwin-codesigning.tar.gz f7cadfe8ec4e02a569751fefa1a0a257c25cf6edcf9af69dcb73f6c697495e4f guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/bitcoin-b1f79c9fa6dd-arm64-apple-darwin-unsigned.tar.gz 2a3f133c5ad11a657286c9f1b377fac100bfb6335f52a7ac0da565ebed7e8ce7 guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/bitcoin-b1f79c9fa6dd-arm64-apple-darwin-unsigned.zip 0210d6fad3c23629dd44259a318a098ab1d40cd2f614211323da423e00dbd6e2 guix-build-b1f79c9fa6dd/output/dist-archive/bitcoin-b1f79c9fa6dd.tar.gz 4ff5751126abad7c077158cdc5eae9d8826f61752cb73254ce2d718a5bae841f guix-build-b1f79c9fa6dd/output/powerpc64-linux-gnu/SHA256SUMS.part 4b587f04770cb8fb1676de1ac47b2ff7a19dbb28296b6c86e4ead11cca74c103 guix-build-b1f79c9fa6dd/output/powerpc64-linux-gnu/bitcoin-b1f79c9fa6dd-powerpc64-linux-gnu-debug.tar.gz 627972cee5ff34f41d04fa051a171e9674b28bcc18ec8c2a3224e0aab8265c35 guix-build-b1f79c9fa6dd/output/powerpc64-linux-gnu/bitcoin-b1f79c9fa6dd-powerpc64-linux-gnu.tar.gz 54cd74d473f49f8bda4b198a8db4bb239b9b2b31dcd604072c9067e15e7676cd guix-build-b1f79c9fa6dd/output/riscv64-linux-gnu/SHA256SUMS.part 0309b1be6f6a95e4a577ce4706bc658b150a6114341b260d6239833909f0a2d3 guix-build-b1f79c9fa6dd/output/riscv64-linux-gnu/bitcoin-b1f79c9fa6dd-riscv64-linux-gnu-debug.tar.gz d3df748ea3e86ca0a60763955469b92ef496a6f1355c57618aee6ae32f421b4d guix-build-b1f79c9fa6dd/output/riscv64-linux-gnu/bitcoin-b1f79c9fa6dd-riscv64-linux-gnu.tar.gz 20b826775a5bc1076e7dbb7b2d3025a98442463642e8e3ca22b736bd048feb14 guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/SHA256SUMS.part 8771f090263129505d2bc2aa333ba243439532713b54bfa792b79172513ca2fc guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/bitcoin-b1f79c9fa6dd-x86_64-apple-darwin-codesigning.tar.gz 9fe8f90b64df1a86a0eeda61d3ef25c30c752ff3f3b41f00bf526c181c07339e guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/bitcoin-b1f79c9fa6dd-x86_64-apple-darwin-unsigned.tar.gz 18b6ad45aed36993f4c296e79b04de8591bf325b793b7e797ce1819ae9fa6205 guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/bitcoin-b1f79c9fa6dd-x86_64-apple-darwin-unsigned.zip 06bfebb2f8d63caa53587e4612bb75da416740fb52b9cec7aeac75b8378718b1 guix-build-b1f79c9fa6dd/output/x86_64-linux-gnu/SHA256SUMS.part bd5a7d537ee343f37eac47aa4b6ce2b762ba11564a8f455993f2ddf673c06e27 guix-build-b1f79c9fa6dd/output/x86_64-linux-gnu/bitcoin-b1f79c9fa6dd-x86_64-linux-gnu-debug.tar.gz aa4b4dd950669df51fdb0b0cf0ed555cacc13878416390cc8a6a0258eb1490d3 guix-build-b1f79c9fa6dd/output/x86_64-linux-gnu/bitcoin-b1f79c9fa6dd-x86_64-linux-gnu.tar.gz 8f5052762e1f72be1c98b334a8cfdcc91a4f96e9fb4468259225347aec6f44f4 guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/SHA256SUMS.part a534e9c6bf9165c1c093fd9e2a55c2cda1e6a8cfd076beba6ee8717ea61d9168 guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-codesigning.tar.gz 783ab6083576c93e74301574d326a07d36953249e17a90bcebb46d436c99d618 guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-debug.zip 2a5f744b0eeaccf29ad367b5b1cb32c75f5013792a9ca264894569fce6b3c6e5 guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-setup-unsigned.exe 1d2450834b8e53295b9e1317a817e9dddf7a48a5a3352b70fa2e92158a3a8d69 guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-unsigned.zip ```
DrahtBot commented 2026-08-25 17:51:31 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
ryanofsky (Migrated from github.com) approved these changes 2026-09-21 18:54:47 +00:00
ryanofsky (Migrated from github.com) left a comment

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.md addition 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:

Problem: Depends Local Packages cache the sources for a package built from a local directory as a tarball in SOURCES_PATH, named only after the source directory's relative path. When multiple depends directories share one SOURCES_PATH, two different source directories can end up with the same tarball name. If one directory's tarball happens to be newer than every file in the other directory's sources, that directory silently builds from the wrong sources: the checksum and build ID are calculated correctly, but for the wrong content.

Solution: Include a hash of the absolute source directory path in the tarball filename, so each source directory gets its own tarball within a shared SOURCES_PATH. The existing mtime-based rebuild check is unchanged.

Code review ACK 6ea85f57fbe33c047d951f7e940007771aeb4547. 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.md` addition a bit confusing though because they both seem focused on internal implementation details, instead of describing visible behavior. The existing [Local Packages](https://github.com/bitcoin/bitcoin/blob/master/depends/packages.md#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: > Problem: Depends [Local Packages](https://github.com/bitcoin/bitcoin/blob/master/depends/packages.md#local-packages) cache the sources for a package built from a local directory as a tarball in `SOURCES_PATH`, named only after the source directory's relative path. When multiple depends directories share one `SOURCES_PATH`, two different source directories can end up with the same tarball name. If one directory's tarball happens to be newer than every file in the other directory's sources, that directory silently builds from the wrong sources: the checksum and build ID are calculated correctly, but for the wrong content. > > Solution: Include a hash of the absolute source directory path in the tarball filename, so each source directory gets its own tarball within a shared `SOURCES_PATH`. The existing mtime-based rebuild check is unchanged.
willcl-ark commented 2026-09-22 09:22:44 +00:00 (Migrated from github.com)

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 @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.
ryanofsky commented 2026-09-22 14:58:31 +00:00 (Migrated from github.com)

Thanks for the update!

I feel like the packages.md change is OK though? It's quite a developer-focused document.

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.

Thanks for the update! > I feel like the _packages.md_ change is OK though? It's quite a developer-focused document. 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.
willcl-ark commented 2026-09-23 10:05:48 +00:00 (Migrated from github.com)

OK you've persuaded me. Dropped the doc comment in latest push.

OK you've persuaded me. Dropped the doc comment in latest push.
ryanofsky (Migrated from github.com) approved these changes 2026-09-30 00:15:35 +00:00
ryanofsky (Migrated from github.com) left a comment

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.

Code review ACK 22374481a7e977bba5aa87462d097c49fb529a6c. Since last review, just dropped the documentation change. Left a comment below suggesting an alternative approach, but this looks good as is.
Lines 112-115
ryanofsky (Migrated from github.com) commented 2026-09-30 00:05:08 +00:00

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_PATH instead of SOURCES_PATH, which I implemented in fec2762f18a5020b16db84907b5b12e5fb5f9945 (tag).

Files in SOURCES_PATH are 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 in WORK_PATH instead of SOURCES_PATH they 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_PATH when sources are downloaded beforehand, so a shared SOURCES_PATH could be mounted read-only in build containers instead of read-write. And old tarballs would be removed along with their checkouts instead of accumulating in SOURCES_PATH.

The current PR is still an improvement and looks fine to merge as is, so this is just a suggestion.

In commit "depends: isolate local archives by source path" (22374481a7e977bba5aa87462d097c49fb529a6c) Looking into this more, I think a simpler alternative could be to store local package tarballs in `WORK_PATH` instead of `SOURCES_PATH`, which I implemented in fec2762f18a5020b16db84907b5b12e5fb5f9945 ([tag](https://github.com/ryanofsky/bitcoin/commits/pr/deplocal.1)). Files in `SOURCES_PATH` are 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 in `WORK_PATH` instead of `SOURCES_PATH` they 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_PATH` when sources are downloaded beforehand, so a shared `SOURCES_PATH` could be mounted read-only in build containers instead of read-write. And old tarballs would be removed along with their checkouts instead of accumulating in `SOURCES_PATH`. The current PR is still an improvement and looks fine to merge as is, so this is just a suggestion.
First-time contributor

Base: d4b0e1e4b078dbb4ab57886d288470684dec5718
Head: 01491f22b2c77d632e8503cc446140d1ab6ccc21

Design 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 clean removes 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

<!-- forgejo-review-bot:bitcoin/bitcoin --> Base: `d4b0e1e4b078dbb4ab57886d288470684dec5718` Head: `01491f22b2c77d632e8503cc446140d1ab6ccc21` ##### Design 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 clean` removes 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](<https://review.fish.foo/traces/35765-01491f22b2c77d632e8503cc446140d1ab6ccc21-173-3.html>)
ryanofsky (Migrated from github.com) approved these changes 2026-10-15 08:07:38 +00:00
ryanofsky (Migrated from github.com) left a comment

Code review ACK 01491f22b2. Thanks for picking up the WORK_PATH approach, and the commit message change is an improvement (WORK_PATH can 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.

Code review ACK 01491f22b2c77d632e8503cc446140d1ab6ccc21. Thanks for picking up the `WORK_PATH` approach, and the commit message change is an improvement (`WORK_PATH` can 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.
fanquake commented 2026-11-25 20:27:18 +00:00 (Migrated from github.com)
ACK 01491f22b2c77d632e8503cc446140d1ab6ccc21
fanquake commented 2026-11-25 20:35:57 +00:00 (Migrated from github.com)

Backported this to 32.x in #36984.

Backported this to `32.x` in #36984.
fanquake commented 2026-11-25 20:38:27 +00:00 (Migrated from github.com)

Backported this to 31.x in #36928.

Backported this to `31.x` in #36928.
fanquake commented 2026-11-25 20:41:27 +00:00 (Migrated from github.com)

Backported to 30.x in #36929.

Backported to `30.x` in #36929.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!35765
No description provided.