{
 "number": 35765,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35765",
 "title": "depends: hash local source contents",
 "author": "willcl-ark",
 "author_association": "MEMBER",
 "created_at": "2026-07-21T14:40:17Z",
 "updated_at": "2026-08-25T17:51:31Z",
 "age_days": 58,
 "draft": true,
 "labels": [
  "Build system",
  "Needs rebase"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "b1f79c9fa6dd2ec9072a6a622b0298573c69bd26",
 "head_ref": "guix-depends-hash-check",
 "head_repo": "willcl-ark/bitcoin",
 "head_history": [],
 "additions": 38,
 "deletions": 15,
 "changed_files": 3,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "dirty",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {},
   "conflicts": [
    {
     "number": 36006,
     "title": "ci: add Guix builds to CI",
     "author": "willcl-ark"
    },
    {
     "number": 35618,
     "title": "depends: Make tarball creation from local directory reproducible",
     "author": "hebasto"
    }
   ]
  }
 },
 "acks_parsed": {},
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": []
 },
 "signals": {
  "needs_rebase": true,
  "ci_failed": false,
  "mergeable_state": "dirty",
  "last_author_activity": "2026-07-22T07:34:43Z",
  "last_reviewer_activity": null,
  "last_reviewer": null,
  "author_silent_days": 57,
  "waiting_on_author_days": 0,
  "days_since_update": 22
 },
 "refs": {
  "mentioned": [
   35764
  ],
  "depends_on": [],
  "fixes": [
   35764
  ],
  "linked_issues": [
   {
    "number": 35764,
    "type": "issue",
    "state": "open",
    "merged": false,
    "merged_at": null,
    "title": "depends: `local_dir` cache invalidation can miss source changes"
   }
  ],
  "references": [
   {
    "number": 35764,
    "type": "issue",
    "state": "open",
    "merged": false,
    "merged_at": null,
    "title": "depends: `local_dir` cache invalidation can miss source changes"
   }
  ],
  "conflicts": [
   36006,
   35618
  ]
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "Fixes #35764.\n\nCreate a normalized temporary archive on each evaluation using the existing CMake dependency, then publish it under a content-addressed filename. This replaces mtime-based invalidation and allows different worktrees to coexist in\na shared `SOURCES_PATH`.\n\nCMake provides a consistent archive implementation across supported build hosts and allows the archive mtime to be fixed.\n\nCMake/libarchive records the invoking uid/gid, so cross-user archive reproducibility remains a separate consideration. The reported shared-worktree failure was the same user and host, and I'd expect this to be the most-common case by far.",
 "commits": [
  {
   "sha": "b1f79c9fa6dd2ec9072a6a622b0298573c69bd26",
   "date": "2026-07-21T13:31:43Z",
   "message": "depends: hash local source contents\n\nTimestamp comparisons can reuse an archive produced by another worktree, causing Depends to build stale local sources.\n\nSpecifically, depends caches packages using `$(package)_local_dir` as a tarball in `SOURCES_PATH`. The tarball is currently recreated only when `find -newer` reports a path newer than the cached archive.\n\nThis does not reliably identify directory contents:\n\n- Two worktrees sharing `SOURCES_PATH` can contain different source trees.\n- A tarball created by one worktree may be newer than every path in another.\n- Deleting a file leaves no path whose mtime can be checked.\n- Changed or restored files may have older or equal mtimes.\n- Timestamp granularity and clock differences make ordering unreliable.\n\n`native_libmultiprocess` is currently the only package using `local_dir`.\n\nLocal source identity should change when any of the following changes:\n\n- A file is added, removed, or modified.\n- File permissions, including the executable bit, change.\n- A symlink target changes.\n- An empty directory is added or removed.\n\nFilesystem timestamps, ownership paths, and absolute worktree locations should not determine the identity. Identical trees in separate worktrees should produce the same archive checksum.\n\nDifferent trees using the same shared `SOURCES_PATH` must be able to coexist.\n\n---\n\nGenerate normalized archives with CMake and key them by SHA256 so distinct trees can coexist safely in a shared source cache.\n\nKeep the archive hash as the recipe input so existing package and dependent build ID propagation remains unchanged."
  }
 ],
 "timeline": [
  {
   "t": "2026-07-21T14:41:07Z",
   "kind": "comment",
   "who": "willcl-ark",
   "assoc": "MEMBER",
   "text": "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..."
  },
  {
   "t": "2026-07-22T07:34:43Z",
   "kind": "comment",
   "who": "willcl-ark",
   "assoc": "MEMBER",
   "text": "Build of this PR:\n\n```\nx86_64\neb548f6197dee88a0e125c04f7c43b7e3360f963c5b62d6dd7096def4d25ae82  guix-build-b1f79c9fa6dd/output/aarch64-linux-gnu/SHA256SUMS.part\n30109d042a7a31893422649b11b5ac54fc2702d27dabedb9e286dc740e475cc4  guix-build-b1f79c9fa6dd/output/aarch64-linux-gnu/bitcoin-b1f79c9fa6dd-aarch64-linux-gnu-debug.tar.gz\n04c50689d60f5f2d17631a7443cbd4ae5084f31de1934f22d488cdc630721816  guix-build-b1f79c9fa6dd/output/aarch64-linux-gnu/bitcoin-b1f79c9fa6dd-aarch64-linux-gnu.tar.gz\n0a7a24fdf440a63382f1abf83c4a4cd4700bc68e14dbbb2d51ea98c8a0a65ac6  guix-build-b1f79c9fa6dd/output/arm-linux-gnueabihf/SHA256SUMS.part\n9d1383085f267a8bf57842330ef856c4e1f0fd4efa899705a0e6b8e0f82e7144  guix-build-b1f79c9fa6dd/output/arm-linux-gnueabihf/bitcoin-b1f79c9fa6dd-arm-linux-gnueabihf-debug.tar.gz\ne5bc8d5e63a299e64434dce0bcd0d1a953de77d0c12ea87dea1fe4af529f20b9  guix-build-b1f79c9fa6dd/output/arm-linux-gnueabihf/bitcoin-b1f79c9fa6dd-arm-linux-gnueabihf.tar.gz\nda82d78e01c0cd69e6033633dabf3f4ab0fcb5c9d746ea68607f4f4e56bcedb8  guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/SHA256SUMS.part\n13488634f71b849eea3f0ed70fcb96a4c08b7614ed22cd53c17a35030debbd01  guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/bitcoin-b1f79c9fa6dd-arm64-apple-darwin-codesigning.tar.gz\nf7cadfe8ec4e02a569751fefa1a0a257c25cf6edcf9af69dcb73f6c697495e4f  guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/bitcoin-b1f79c9fa6dd-arm64-apple-darwin-unsigned.tar.gz\n2a3f133c5ad11a657286c9f1b377fac100bfb6335f52a7ac0da565ebed7e8ce7  guix-build-b1f79c9fa6dd/output/arm64-apple-darwin/bitcoin-b1f79c9fa6dd-arm64-apple-darwin-unsigned.zip\n0210d6fad3c23629dd44259a318a098ab1d40cd2f614211323da423e00dbd6e2  guix-build-b1f79c9fa6dd/output/dist-archive/bitcoin-b1f79c9fa6dd.tar.gz\n4ff5751126abad7c077158cdc5eae9d8826f61752cb73254ce2d718a5bae841f  guix-build-b1f79c9fa6dd/output/powerpc64-linux-gnu/SHA256SUMS.part\n4b587f04770cb8fb1676de1ac47b2ff7a19dbb28296b6c86e4ead11cca74c103  guix-build-b1f79c9fa6dd/output/powerpc64-linux-gnu/bitcoin-b1f79c9fa6dd-powerpc64-linux-gnu-debug.tar.gz\n627972cee5ff34f41d04fa051a171e9674b28bcc18ec8c2a3224e0aab8265c35  guix-build-b1f79c9fa6dd/output/powerpc64-linux-gnu/bitcoin-b1f79c9fa6dd-powerpc64-linux-gnu.tar.gz\n54cd74d473f49f8bda4b198a8db4bb239b9b2b31dcd604072c9067e15e7676cd  guix-build-b1f79c9fa6dd/output/riscv64-linux-gnu/SHA256SUMS.part\n0309b1be6f6a95e4a577ce4706bc658b150a6114341b260d6239833909f0a2d3  guix-build-b1f79c9fa6dd/output/riscv64-linux-gnu/bitcoin-b1f79c9fa6dd-riscv64-linux-gnu-debug.tar.gz\nd3df748ea3e86ca0a60763955469b92ef496a6f1355c57618aee6ae32f421b4d  guix-build-b1f79c9fa6dd/output/riscv64-linux-gnu/bitcoin-b1f79c9fa6dd-riscv64-linux-gnu.tar.gz\n20b826775a5bc1076e7dbb7b2d3025a98442463642e8e3ca22b736bd048feb14  guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/SHA256SUMS.part\n8771f090263129505d2bc2aa333ba243439532713b54bfa792b79172513ca2fc  guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/bitcoin-b1f79c9fa6dd-x86_64-apple-darwin-codesigning.tar.gz\n9fe8f90b64df1a86a0eeda61d3ef25c30c752ff3f3b41f00bf526c181c07339e  guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/bitcoin-b1f79c9fa6dd-x86_64-apple-darwin-unsigned.tar.gz\n18b6ad45aed36993f4c296e79b04de8591bf325b793b7e797ce1819ae9fa6205  guix-build-b1f79c9fa6dd/output/x86_64-apple-darwin/bitcoin-b1f79c9fa6dd-x86_64-apple-darwin-unsigned.zip\n06bfebb2f8d63caa53587e4612bb75da416740fb52b9cec7aeac75b8378718b1  guix-build-b1f79c9fa6dd/output/x86_64-linux-gnu/SHA256SUMS.part\nbd5a7d537ee343f37eac47aa4b6ce2b762ba11564a8f455993f2ddf673c06e27  guix-build-b1f79c9fa6dd/output/x86_64-linux-gnu/bitcoin-b1f79c9fa6dd-x86_64-linux-gnu-debug.tar.gz\naa4b4dd950669df51fdb0b0cf0ed555cacc13878416390cc8a6a0258eb1490d3  guix-build-b1f79c9fa6dd/output/x86_64-linux-gnu/bitcoin-b1f79c9fa6dd-x86_64-linux-gnu.tar.gz\n8f5052762e1f72be1c98b334a8cfdcc91a4f96e9fb4468259225347aec6f44f4  guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/SHA256SUMS.part\na534e9c6bf9165c1c093fd9e2a55c2cda1e6a8cfd076beba6ee8717ea61d9168  guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-codesigning.tar.gz\n783ab6083576c93e74301574d326a07d36953249e17a90bcebb46d436c99d618  guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-debug.zip\n2a5f744b0eeaccf29ad367b5b1cb32c75f5013792a9ca264894569fce6b3c6e5  guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-setup-unsigned.exe\n1d2450834b8e53295b9e1317a817e9dddf7a48a5a3352b70fa2e92158a3a8d69  guix-build-b1f79c9fa6dd/output/x86_64-w64-mingw32/bitcoin-b1f79c9fa6dd-win64-unsigned.zip\n```"
  }
 ],
 "labels_log": [
  {
   "t": "2026-07-21T14:40:21Z",
   "action": "labeled",
   "label": "Build system",
   "who": "DrahtBot"
  },
  {
   "t": "2026-08-25T17:51:30Z",
   "action": "labeled",
   "label": "Needs rebase",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 6959,
 "text_tokens_estimate": 1739,
 "changed_paths": [
  "depends/funcs.mk",
  "depends/local_source.cmake",
  "depends/packages.md"
 ],
 "files": [
  {
   "path": "depends/funcs.mk",
   "add": 24,
   "del": 14
  },
  {
   "path": "depends/local_source.cmake",
   "add": 12,
   "del": 0
  },
  {
   "path": "depends/packages.md",
   "add": 2,
   "del": 1
  }
 ],
 "test_lines": 0,
 "git": {
  "head": "b1f79c9fa6dd2ec9072a6a622b0298573c69bd26",
  "head_matches_backup": true,
  "base": "d673ca765a5a05b0f16b3b6d62047deda092da9b",
  "commits": [
   {
    "sha": "b1f79c9fa6",
    "subject": "depends: hash local source contents",
    "files": 3,
    "add": 38,
    "del": 15
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "6d55b271d25420e6",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}