Repository navigation
ci: add Guix builds to CI - #36082
willcl-ark wants to merge 5 commits into
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
#36006 got auto-closed by a linked PR. More info on the infra side of things: I have configured two physically separate bitcoin core substitute servers for better availability (using this module. One server evaluates the guix closure and builds it. Then uses We 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. I 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 |
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
b4c694c to
aa794bc
Compare
|
@hebasto I think that efbb911 (the first commit here) and #35929 are duplicating solutions in different ways. I 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: Do you agree? If so I think I'll drop efbb911 from here, and rebase on/review #35929. |
I've reviewed and tested efbb911. Compared to #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)". Another point worth mentioning: for your commit to work as expected, the
That sounds good to me. |
|
Please also consider #35929 (comment). |
|
Thanks hebasto, that sounds reasonable to me |
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
|
If we start shipping fully static (glibc-based) linux binaries it would seem prudent to have a CI job testing them. This PR would cover x64 linux in that regard. We could probably add aarch64 too, or even start with just those two jobs. An alternative would be to add a non-Guix job which built the static toolchain(s) and binary (re-inventing the Guix build in the process though). |
I think that is a good reason. Mind including the goal/motivation in the pull description, so that it is easier to follow? Currently it just repeats what the code changes are, but this is visible from looking at the commits already. |
|
Thanks I've updated the description as you suggest. I'd gone for linux + windows + mac here to cover as many bases as possible in the fewest number of jobs, but perhaps aarch64-linux is worth covering too post-#25573, or could replace the windows or macos job? I'll rebase and push a few tidy-ups to the top two commits which were LLM-written as a PoC/test. |
90b16eb to
ccdda14
Compare
ccdda14 to
cc8149b
Compare
|
Could you rebase again, post #36193? |
Make the pinned repository and commit available to callers that source the Guix prelude. A Bitcoin Core-specific substitute server only needs to build the packages in the guix closure at a specific time machine commit. It does not need to build the bitcoin core binary applications. To facilitate extracting the time-machine commit, export it as a variable, so substitute builders (and anybody else) can re-use it by sourcing the prelude, instead of requiring error-prone command string parsing.
4bac9a4 to
f14dc8b
Compare
|
Rebased with a small depends sources cache fixup range-diff 1: b0807c964c0 = 182: 95e52e18b5e guix: expose time-machine metadata
2: 25f3e5fc8e1 ! 183: 31daf63b454 ci: add Guix build job
@@ .github/workflows/guix.yml (new)
+ with:
+ provider: ${{ github.repository == 'bitcoin/bitcoin' && 'warp' || 'gha' }}
+ path: ${{ env.SOURCES_PATH }}
-+ key: guix-depends-sources-${{ hashFiles('depends/**') }}
-+ restore-keys: guix-depends-sources-
++ key: guix-depends-sources-${{ matrix.host }}-${{ hashFiles('depends/**') }}
++ restore-keys: guix-depends-sources-${{ matrix.host }}-
+
+ - name: Restore built depends cache
+ id: built-depends-cache
3: e088de7527f = 184: 6ab622eaec3 ci: test Guix codesign environments
4: 69adb897849 = 185: 8233281ada8 guix: copy config.ini before deleting build dir
5: cc8149b24f3 ! 186: f14dc8b180f ci: test Guix release binaries
@@ .github/ci-guix-test.py (new)
+ with (workspace / "test" / "config.ini").open("w", encoding="utf-8") as file:
+ config.write(file)
+
++ sanitizer_template = (workspace / "test" / "with_sanitizer_env.py.in").read_text(encoding="utf-8")
++ (workspace / "test" / "with_sanitizer_env.py").write_text(
++ sanitizer_template.replace("@PROJECT_SOURCE_DIR@", workspace.as_posix()), encoding="utf-8",
++ )
++
+ env = os.environ.copy()
+ binaries = {
+ "BITCOIN_BIN": "bitcoin",
@@ .github/workflows/guix.yml: jobs:
+ }
+ & $venvPython -m pip install pyzmq
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
++ if (!$IsWindows) {
++ & $venvPython -m pip install pycapnp
++ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
++ }
+ & $venvPython .github/ci-guix-test.py
+ exit $LASTEXITCODE
+
6: 4bac9a480fc < -: ----------- fixup! ci: test Guix release binaries |
f14dc8b to
b000dd5
Compare
|
Added the fail-fast cleanup guard and the existing Also selected Python 3.14 for the native test jobs to fix the CI failure: macOS picked up Python 3.15, which forced a pycapnp source build that failed against the runner’s OpenSSL headers. Python 3.14 has a prebuilt macOS ARM64 wheel. range-diff |
b000dd5 to
bd386ea
Compare
bd386ea to
6c86e5b
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
|
Run single-host Guix builds on pull requests and branch pushes. Cache the prepared Guix image as well as depends sources, built dependencies, and the macOS SDK so fresh runners can reuse the pinned build environment. Pass channel metadata from the Guix prelude to the image build. Preserve its authenticated time-machine profile and store closure, refreshing the profile timestamp at startup so older cached images remain usable. Keep container orchestration in one CI script. Copy the read-only checkout and restored caches into a private build directory, then export outputs and updated caches as the host user. This avoids changing ownership of the host checkout. Allow Guix's namespace and personality operations during image preparation and runtime builds.
The regular Guix builds do not evaluate the codesign manifest, so missing imports and broken signing dependencies can go unnoticed until signing. Realize each signing target's environment before its main build to catch these failures without requiring signatures or signing keys.
This allows us to use the build config.ini in later testing as it's not deleted.
Test x64, windows and macOS binaries on native runners.
6c86e5b to
d9e9d95
Compare

Currently there is limited continuous testing of our exact release binaries. This is acceptable today as we use many similar toolchain configurations in CI which has most/everything we use in Guix pretty much covered. Many PRs also see Guix builds, although few of those probably run tests against the Guix-built binaries.
This PR would continuously exercise the Guix building process itself, but also, in the event that we start shipping some fully-static Linux builds (x64 and aarch64) as per current revision of #25573, our entire custom-built static glibc and compiler toolchain would be relatively untested by current CI jobs, and that would also be tested here.
This adds Guix builds for the following platforms:
The resulting binaries are then tested in a subsequent job.