{
 "number": 36082,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36082",
 "title": "ci: add Guix builds to CI",
 "author": "willcl-ark",
 "author_association": "MEMBER",
 "created_at": "2026-08-25T17:46:39Z",
 "updated_at": "2026-09-16T12:52:37Z",
 "age_days": 22,
 "draft": false,
 "labels": [
  "Tests"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "a340718c36b1ec96f5ad0d9316efcd02283cb43f",
 "head_ref": "guix-ci-v2",
 "head_repo": "willcl-ark/bitcoin",
 "head_history": [
  {
   "t": "2026-08-26T07:15:40Z",
   "sha": "7b6db589df37c83b9a9757d965b8cbde38e01ecd"
  },
  {
   "t": "2026-08-26T08:58:13Z",
   "sha": "f9568f2914a5d45aa019ac68beb7715425a35133"
  },
  {
   "t": "2026-08-26T12:03:06Z",
   "sha": "b4c694c5aff872a99f35164907bb88e08e6efc37"
  },
  {
   "t": "2026-08-26T12:38:38Z",
   "sha": "aa794bc1ae3e5ff1e404d5bd63a5ce242570cee3"
  },
  {
   "t": "2026-09-15T10:26:48Z",
   "sha": "3434e7f5a8c248c86ace97844dec0d496d2c8401"
  },
  {
   "t": "2026-09-15T11:41:34Z",
   "sha": "cb55b37dca651154a5b97332692662c47fa7d96f"
  },
  {
   "t": "2026-09-15T13:38:57Z",
   "sha": "926f761de5f930c52e1a3517ba0f25d4f6f96f31"
  },
  {
   "t": "2026-09-15T13:45:35Z",
   "sha": "a340718c36b1ec96f5ad0d9316efcd02283cb43f"
  }
 ],
 "additions": 210,
 "deletions": 2,
 "changed_files": 3,
 "commit_count": 3,
 "size_bucket": "M",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "concept_ack": [
     {
      "login": "fanquake",
      "url": "https://github.com/bitcoin/bitcoin/pull/36082#issuecomment-5678757484"
     },
     {
      "login": "sedited",
      "url": "https://github.com/bitcoin/bitcoin/pull/36082#issuecomment-5679654839"
     }
    ]
   },
   "conflicts": [
    {
     "number": 36233,
     "title": "guix: Update time-machine to `60f6956aeffa7f30285745bd0ea615e9acfc74f8`",
     "author": "hebasto"
    },
    {
     "number": 35855,
     "title": "guix: update time-machine",
     "author": "fanquake"
    }
   ]
  }
 },
 "acks_parsed": {
  "fanquake": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-09-15T10:34:15Z",
   "stale": false
  },
  "sedited": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-09-15T11:47:56Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 2,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "fanquake",
   "hebasto",
   "sedited"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-09-15T13:47:02Z",
  "last_reviewer_activity": "2026-09-15T11:47:56Z",
  "last_reviewer": "sedited",
  "author_silent_days": 2,
  "waiting_on_author_days": 0,
  "days_since_update": 1
 },
 "refs": {
  "mentioned": [
   35929,
   36006
  ],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 35929,
    "type": "pull",
    "state": "closed",
    "merged": false,
    "merged_at": null,
    "title": "guix, depends: Drop `GUIX_ENVIRONMENT` from `gen_id` calculations"
   },
   {
    "number": 36006,
    "type": "pull",
    "state": "closed",
    "merged": false,
    "merged_at": null,
    "title": "ci: add Guix builds to CI"
   }
  ],
  "conflicts": [
   36233,
   35855
  ]
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "Adds Guix builds to CI as a standalone workflow for:\n\n- arm64-apple-darwin\n- x86_64-linux-gnu\n- x86_64-w64-mingw32\n\nThe first commit exports the pinned Guix repository URL and time-machine commit from the common prelude so other scripts can reuse them. This workflow uses the commit in its cache key; automated Guix substitute builders can also use it.\n\nThe second commit adds the workflow and Guix installation script, with caches for the Guix bootstrap, time-machine checkouts, depends sources and builds, and macOS SDK.\n\nThe final commit adds a codesign environment test to the Windows and macOS jobs. It builds the environment and runs `true` inside its container, to try and catch manifest errors and broken dependencies without requiring signatures or signing keys.",
 "commits": [
  {
   "sha": "5f83028b4b422c6c39e644695bff456b2c77b0c6",
   "date": "2026-09-15T10:26:34Z",
   "message": "guix: expose time-machine metadata\n\nMake the pinned repository and commit available to callers that source the\nGuix prelude.\n\nA Bitcoin Core-specific substitute server only needs to build the\npackages in the guix closure at a specific time machine commit. It does\nnot need to build the bitcoin core binary applications.\n\nTo facilitate extracting the time-machine commit, export it as a\nvariable, so substitute builders (and anybody else) can re-use it by\nsourcing the prelude, instead of requiring error-prone command string parsing."
  },
  {
   "sha": "788a60798020a4f6f6c11d36946c5c6ef0e25bb0",
   "date": "2026-09-15T13:45:00Z",
   "message": "ci: add Guix build job\n\nRun the single-host Guix build on pull requests and master pushes.\n\nUse the Guix installer with a cached, verified bootstrap and retain\ntime-machine and depends caches to avoid repeated downloads and builds."
  },
  {
   "sha": "a340718c36b1ec96f5ad0d9316efcd02283cb43f",
   "date": "2026-09-15T13:45:01Z",
   "message": "ci: test Guix codesign environments\n\nThe regular Guix builds do not evaluate the codesign manifest, so missing\nimports and broken signing dependencies can go unnoticed until signing.\n\nRealize each signing target's environment before its main build to catch\nthese failures without requiring signatures or signing keys."
  }
 ],
 "timeline": [
  {
   "t": "2026-08-25T17:59:21Z",
   "kind": "comment",
   "who": "willcl-ark",
   "assoc": "MEMBER",
   "text": "#36006 got auto-closed by a linked PR.\n\nMore info on the infra side of things:\n\nI have configured two physically separate bitcoin core substitute servers for better availability (using [this module](https://github.com/willcl-ark/nix/tree/master/modules/bitcoin-core-guix-substitutes). One server evaluates the guix closure and builds it. Then uses `guix copy` to copy store items to the second server via ssh.\n\nWe could include the default substitute servers (https://bordeaux.guix.gnu.org https://ci.guix.gnu.org), but this makes the CI runs noticeably slower as these (slow) servers are queried even when not used/selected. These servers obviously will never include our custom compilers, which are the slowest thing to build, too.\n\nI tested a run with a single substitute server, shutting the server off _part way through_, and Guix didn't like that it _thought_ a substitute should be available but then wasn't and so failed. I think our use of `--fallback` protects us in the case that no substitute servers are available before the run begins; everything is just rebuilt, but have not tested this yet."
  },
  {
   "t": "2026-08-26T07:15:40Z",
   "kind": "force_push",
   "who": "willcl-ark",
   "commit": "7b6db589df37c83b9a9757d965b8cbde38e01ecd"
  },
  {
   "t": "2026-08-26T08:58:13Z",
   "kind": "force_push",
   "who": "willcl-ark",
   "commit": "f9568f2914a5d45aa019ac68beb7715425a35133"
  },
  {
   "t": "2026-08-26T12:03:06Z",
   "kind": "force_push",
   "who": "willcl-ark",
   "commit": "b4c694c5aff872a99f35164907bb88e08e6efc37"
  },
  {
   "t": "2026-08-26T12:38:38Z",
   "kind": "force_push",
   "who": "willcl-ark",
   "commit": "aa794bc1ae3e5ff1e404d5bd63a5ce242570cee3"
  },
  {
   "t": "2026-08-26T13:14:35Z",
   "kind": "comment",
   "who": "willcl-ark",
   "assoc": "MEMBER",
   "text": "@hebasto I think that efbb91102107dd9e758c46b9cd51d7a1de28c38a (the first commit here) and #35929 are duplicating solutions in different ways.\n\nI believe that #35929 is the neater solution, and still covers the multi-toolchain (dual Guix build) scenario via embedding the toolchain info in the build ID as part of:\n\n```\nBASE_CACHE/<host>/<package>/<package>-<version>-<build_id>.tar.gz\n```\n\nDo you agree? If so I think I'll drop efbb91102107dd9e758c46b9cd51d7a1de28c38a from here, and rebase on/review #35929."
  },
  {
   "t": "2026-08-28T09:14:48Z",
   "kind": "comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nI've reviewed and tested efbb91102107dd9e758c46b9cd51d7a1de28c38a. Compared to https://github.com/bitcoin/bitcoin/pull/35929, it manages to fix the first subissue: \"1. All depends are rebuilt when switching to another branch with identical Guix scripts and the depends subdirectory\". Unfortunately, it fails to resolve the second one: \"2. All non-GUI packages are built twice per host (mostly relevant for non-Linux hosts)\".\n\nAnother point worth mentioning: for your commit to work as expected, the `BASE_CACHE` environment variable must be set explicitly.\n\n[quoted text omitted]\nThat sounds good to me."
  },
  {
   "t": "2026-08-28T11:07:30Z",
   "kind": "comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "text": "@willcl-ark\n\nPlease also consider https://github.com/bitcoin/bitcoin/pull/35929#issuecomment-5451743557."
  },
  {
   "t": "2026-08-28T11:08:07Z",
   "kind": "comment",
   "who": "willcl-ark",
   "assoc": "MEMBER",
   "text": "Thanks hebasto, that sounds reasonable to me"
  },
  {
   "t": "2026-09-15T10:26:48Z",
   "kind": "force_push",
   "who": "willcl-ark",
   "commit": "3434e7f5a8c248c86ace97844dec0d496d2c8401"
  },
  {
   "t": "2026-09-15T10:34:15Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "Concept ACK"
  },
  {
   "t": "2026-09-15T11:41:34Z",
   "kind": "force_push",
   "who": "willcl-ark",
   "commit": "cb55b37dca651154a5b97332692662c47fa7d96f"
  },
  {
   "t": "2026-09-15T11:47:56Z",
   "kind": "comment",
   "who": "sedited",
   "assoc": "MEMBER",
   "text": "Concept ACK"
  },
  {
   "t": "2026-09-15T11:52:29Z",
   "kind": "comment",
   "who": "willcl-ark",
   "assoc": "MEMBER",
   "text": "Added a commit to run `true` inside the `guix-codesign` container to try and catch things like https://github.com/bitcoin/bitcoin/pull/36256#discussion_r4014449885\n\nI don't think there's any more we can do when we don't have signatures."
  },
  {
   "t": "2026-09-15T13:38:57Z",
   "kind": "force_push",
   "who": "willcl-ark",
   "commit": "926f761de5f930c52e1a3517ba0f25d4f6f96f31"
  },
  {
   "t": "2026-09-15T13:45:35Z",
   "kind": "force_push",
   "who": "willcl-ark",
   "commit": "a340718c36b1ec96f5ad0d9316efcd02283cb43f"
  },
  {
   "t": "2026-09-15T13:47:02Z",
   "kind": "comment",
   "who": "willcl-ark",
   "assoc": "MEMBER",
   "text": "Marking this as ready for review now as I'd be interested in comments on its current state.\n\nFor me the main open question to be answered is:\n\n- Are we happy to rely on the two (physically distinct) Guix substitute servers I'm operating **as the only enabled ones in these jobs**?\n\nIf we add in other upstream servers (the defaults), the job runtime increases a fair amount (about 5 minutes longer to \"check substitutes\" in all jobs, not to mention that they'll be missing our compiler toolchains as subs so we need to rebuild those anyway which takes ages) but the jobs would become slightly more robust against my two servers being down, or in the case I disappear or whatever.\n\nAnother alternative is to have someone else operate another server. This would be my personal preference, if it were possible."
  }
 ],
 "labels_log": [
  {
   "t": "2026-08-25T17:46:43Z",
   "action": "labeled",
   "label": "Tests",
   "who": "DrahtBot"
  },
  {
   "t": "2026-08-26T08:45:17Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-09-11T09:49:59Z",
   "action": "labeled",
   "label": "Needs rebase",
   "who": "DrahtBot"
  },
  {
   "t": "2026-09-15T11:26:47Z",
   "action": "unlabeled",
   "label": "Needs rebase",
   "who": "DrahtBot"
  },
  {
   "t": "2026-09-15T15:13:25Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [
  {
   "t": "2026-08-26T07:15:48Z",
   "kind": "ready_for_review",
   "who": "willcl-ark"
  },
  {
   "t": "2026-08-26T08:14:15Z",
   "kind": "convert_to_draft",
   "who": "willcl-ark"
  },
  {
   "t": "2026-09-15T13:46:59Z",
   "kind": "ready_for_review",
   "who": "willcl-ark"
  }
 ],
 "text_chars": 5352,
 "text_tokens_estimate": 1338,
 "changed_paths": [
  ".github/install-guix.sh",
  ".github/workflows/guix.yml",
  "contrib/guix/libexec/prelude.bash"
 ],
 "files": [
  {
   "path": ".github/install-guix.sh",
   "add": 34,
   "del": 0
  },
  {
   "path": ".github/workflows/guix.yml",
   "add": 171,
   "del": 0
  },
  {
   "path": "contrib/guix/libexec/prelude.bash",
   "add": 5,
   "del": 2
  }
 ],
 "test_lines": 7,
 "git": {
  "head": "a340718c36b1ec96f5ad0d9316efcd02283cb43f",
  "head_matches_backup": true,
  "base": "51ddab532cb38213e2258c24c492bc8a392ffc90",
  "commits": [
   {
    "sha": "5f83028b4b",
    "subject": "guix: expose time-machine metadata",
    "files": 1,
    "add": 5,
    "del": 2
   },
   {
    "sha": "788a607980",
    "subject": "ci: add Guix build job",
    "files": 2,
    "add": 192,
    "del": 0
   },
   {
    "sha": "a340718c36",
    "subject": "ci: test Guix codesign environments",
    "files": 1,
    "add": 13,
    "del": 0
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "782e2ad17c310a75",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}