The next change split out of #25573, which splits the Guix build into separate Linux, Linux GUI, macOS, macOS GUI and Windows and Windows GUI builds.
Closes #29914.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35537.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| Approach ACK | hebasto |
If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
-static-pie bitcoind by fanquake)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.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
should the issue remain open for macOS and Windows?
There is no difference in build environment for either of those builds, so I'm not sure there is anything to do there?
0 | @@ -0,0 +1,118 @@ 1 | +#!/usr/bin/env bash 2 | +# Copyright (c) The Bitcoin Core developers 3 | +# Distributed under the MIT software license, see the accompanying 4 | +# file COPYING or https://opensource.org/license/mit. 5 | +export LC_ALL=C 6 | +set -e -o pipefail
nit: I still wonder quite often what the short names mean, (especially when exit plausibly could mean -e or -x) and it could make sense to use the longer self-descriptive names? set -o errexit -o pipefail
Sure, switched these over.
Just wondering, maybe the resulting code will even be clearer, smaller, or more consistent?
I've pushed up another commit, to show what this might look like.
We should also be able to move Python out of the non-GUI build env, but we need to workaround us currently having a hard (CMake) error for missing Python.
<!--85328a0da195eb286784d51f73fa0af9-->
🚧 At least one of the CI tasks failed.
<sub>Task lint: https://github.com/bitcoin/bitcoin/actions/runs/27626623050/job/81689876955</sub>
<sub>LLM reason (✨ experimental): CI failed due to lint check errors in contrib/guix/libexec/* (tabs-whitespace and shell/file permission issues flagged by lint-files.py / lint-shell.py).</sub>
<details><summary>Hints</summary>
Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
</details>
<!--9cd9c72976c961c55c7acef8f6ba82cd-->
Just wondering, maybe the resulting code will even be clearer, smaller, or more consistent?
I've pushed up another commit, to show what this might look like.
Approach ACK b407558f5d1ee7a187fe67f2a68ed0fd63a44880.
x86_64
ca0bd516652d5d5b8cb23a7d67eb4d74a86919859531b2ac7e19ea7239e04d73 guix-build-b407558f5d1e/output/aarch64-linux-gnu/SHA256SUMS.part
1f97d0ebcd9e55f9c4ae8c31affb596d9df34822f5b10c8648cb2638fd52bf61 guix-build-b407558f5d1e/output/aarch64-linux-gnu/bitcoin-b407558f5d1e-aarch64-linux-gnu-debug.tar.gz
62229036ea8ce038ffb67d5a78572027707ff8fd7a611c2ae9031e1c2822b592 guix-build-b407558f5d1e/output/aarch64-linux-gnu/bitcoin-b407558f5d1e-aarch64-linux-gnu.tar.gz
1143aa521a35e19ea1e8cc5fbf88227061b9abd65107df9a6ed1cfb7d642a540 guix-build-b407558f5d1e/output/arm-linux-gnueabihf/SHA256SUMS.part
fca825e0287dce71c256fa7a56c64fd5a3f75cae44a5a80b005b00ed3f4bc4b0 guix-build-b407558f5d1e/output/arm-linux-gnueabihf/bitcoin-b407558f5d1e-arm-linux-gnueabihf-debug.tar.gz
cad19ef73839289b705c9b1d14617abbf6047cfcb68b649894cfa96b94e95aad guix-build-b407558f5d1e/output/arm-linux-gnueabihf/bitcoin-b407558f5d1e-arm-linux-gnueabihf.tar.gz
03122dd973d216c1bfcc0fd4f5308968434f45d76e73d817ebded01350aec391 guix-build-b407558f5d1e/output/arm64-apple-darwin/SHA256SUMS.part
a32b1d0da73fc7a8fd312fd86a08fdb07e31ccbb4e1a4e94cec2e9bc9c9122b7 guix-build-b407558f5d1e/output/arm64-apple-darwin/bitcoin-b407558f5d1e-arm64-apple-darwin-codesigning.tar.gz
89b1960ab0bde1397b80f468f867d6313e3e43d129fa782e08941c4b27809971 guix-build-b407558f5d1e/output/arm64-apple-darwin/bitcoin-b407558f5d1e-arm64-apple-darwin-unsigned.tar.gz
caf90674f6f98ed75e9d48c3afda7f21488372cdca93f7f5294f73806628503f guix-build-b407558f5d1e/output/arm64-apple-darwin/bitcoin-b407558f5d1e-arm64-apple-darwin-unsigned.zip
3c365fc39cff78db4eb3cae3b230a3e6db23ac624d4f2dec632c665b734c782d guix-build-b407558f5d1e/output/dist-archive/bitcoin-b407558f5d1e.tar.gz
6e07c886f17afd080f77fddfb7e8df426e249890263e1d212acebd0a05f82a09 guix-build-b407558f5d1e/output/powerpc64-linux-gnu/SHA256SUMS.part
cd60efb529aa45254aa0695f4a3bacc259a80ee016843298faeaccc916f1b371 guix-build-b407558f5d1e/output/powerpc64-linux-gnu/bitcoin-b407558f5d1e-powerpc64-linux-gnu-debug.tar.gz
4b2fef61838246b129adc5c3ee308b6f4e0d260a55162d947513e4e92a98f4e6 guix-build-b407558f5d1e/output/powerpc64-linux-gnu/bitcoin-b407558f5d1e-powerpc64-linux-gnu.tar.gz
724bbadd73a9c124fd20363ad6db42cb1f11059e0937682465e495193b38f697 guix-build-b407558f5d1e/output/riscv64-linux-gnu/SHA256SUMS.part
8dad0c096bd6d5fefa4ac717b1cd0a306b5856d2260878448adfdf98ec499c53 guix-build-b407558f5d1e/output/riscv64-linux-gnu/bitcoin-b407558f5d1e-riscv64-linux-gnu-debug.tar.gz
582ceba95d42dd07afd95843ed49d4de3c1fee1b9c96fb7d0bc047c1fa4aabc8 guix-build-b407558f5d1e/output/riscv64-linux-gnu/bitcoin-b407558f5d1e-riscv64-linux-gnu.tar.gz
2467b6eef500bbdb74ad8ebd6d6b84e6fcdcb9856a5099c4913fe580f62cf848 guix-build-b407558f5d1e/output/x86_64-apple-darwin/SHA256SUMS.part
e0f0d64b4a570e6f85a6270883e5fc9a49b512324b6c686c769f901a86c3c7de guix-build-b407558f5d1e/output/x86_64-apple-darwin/bitcoin-b407558f5d1e-x86_64-apple-darwin-codesigning.tar.gz
590c62f33ba0c82e2ed7ad13d936bd8be339c1d996c150884af85482447f83de guix-build-b407558f5d1e/output/x86_64-apple-darwin/bitcoin-b407558f5d1e-x86_64-apple-darwin-unsigned.tar.gz
9234c91dfba4cbb42d58008a6ef04c7ef48bdbe0e8ae589b191b9f9fd6c08061 guix-build-b407558f5d1e/output/x86_64-apple-darwin/bitcoin-b407558f5d1e-x86_64-apple-darwin-unsigned.zip
ab5bc1f4d291380a93f57581162d21345692b7dd9af8b2d4e0b0c54d8351cdbf guix-build-b407558f5d1e/output/x86_64-linux-gnu/SHA256SUMS.part
56ce2ce0d87e4a01cf09accd07e26ba2033ac694bfcb686db967c83dba4d4cf0 guix-build-b407558f5d1e/output/x86_64-linux-gnu/bitcoin-b407558f5d1e-x86_64-linux-gnu-debug.tar.gz
05d85c56cb2f417489d686c75d0859c772d4827d17f7775608997c9a12107d9c guix-build-b407558f5d1e/output/x86_64-linux-gnu/bitcoin-b407558f5d1e-x86_64-linux-gnu.tar.gz
94e0e4b7453fca41b95deb184efa8e4c04dab141d7f094aeb8929356ff1b3aae guix-build-b407558f5d1e/output/x86_64-w64-mingw32/SHA256SUMS.part
853cc89a312d8a474950b81b4b372a71fc0d2d91646d41a2a46349f218ea5bc7 guix-build-b407558f5d1e/output/x86_64-w64-mingw32/bitcoin-b407558f5d1e-win64-codesigning.tar.gz
4b0b34ec6269e12e0698dff69221a843cf05e94e63ba540599af0257a30da8af guix-build-b407558f5d1e/output/x86_64-w64-mingw32/bitcoin-b407558f5d1e-win64-debug.zip
9e6ec247bec6e8e031552ae565d4b639a59a6a45716a235013d5ea074a3026a3 guix-build-b407558f5d1e/output/x86_64-w64-mingw32/bitcoin-b407558f5d1e-win64-setup-unsigned.exe
31fd89f7e88d2c105847bf0deaf2652f498c857532413d9d11189256c4a68113 guix-build-b407558f5d1e/output/x86_64-w64-mingw32/bitcoin-b407558f5d1e-win64-unsigned.zip
Briefly tested that the (unsigned) macOS GUI and daemon archives still work.
81 | + 82 | + # Install built Bitcoin Core 83 | + cmake --install build 84 | +) 85 | + 86 | +rm -rf "$DISTSRC"/build
b407558f5d1ee7a187fe67f2a68ed0fd63a44880
FWIW, #35098 reused both the depends built artifacts and the CMake build tree for Windows and macOS. I don't see any conceptual incompatibility between these two approaches right now. Also, reusing the build tree makes modifying the add_windows_deploy_target function unnecessary. We can leave that performance improvement for follow-ups, though.
For now, I'll look more closely at the changes in add_windows_deploy_target.
Guix Build (aarch64):
6b74503356ae045f33a3d4e5133120338400fd6528b94af4bfd3b29c1e26b87c guix-build-5b484ec02e12/output/aarch64-linux-gnu/SHA256SUMS.part
b63aa777a841f1fee47cb4a1b5a2d6ff52dc4ef2a378b41399072109bc021521 guix-build-5b484ec02e12/output/aarch64-linux-gnu/bitcoin-5b484ec02e12-aarch64-linux-gnu-debug.tar.gz
f915ce9faf2b65e9d64ff995089b408b5ba338d1a29d282a8ef2adb5fbf28720 guix-build-5b484ec02e12/output/aarch64-linux-gnu/bitcoin-5b484ec02e12-aarch64-linux-gnu.tar.gz
0bb802a4696c7b866eea845d433d1296948846cd94f0d945122c9c5f9401d2d9 guix-build-5b484ec02e12/output/arm-linux-gnueabihf/SHA256SUMS.part
69af7d36b6bd95c3a09374fe644c7fc07aab41d53c9b1024df1dd867d62e3241 guix-build-5b484ec02e12/output/arm-linux-gnueabihf/bitcoin-5b484ec02e12-arm-linux-gnueabihf-debug.tar.gz
b3d8735045bad3fdfb61b90677bfa130beafdb311f3b84ea8b5ba69868888636 guix-build-5b484ec02e12/output/arm-linux-gnueabihf/bitcoin-5b484ec02e12-arm-linux-gnueabihf.tar.gz
2d3090665cb9cd1593a6ea1e0b10aae2a7f02ed9737eb9159b1a88ced05f603a guix-build-5b484ec02e12/output/arm64-apple-darwin/SHA256SUMS.part
2d22de74c61131b3625ae087d01d041e3779643ce4e90925219a566e60baa2d8 guix-build-5b484ec02e12/output/arm64-apple-darwin/bitcoin-5b484ec02e12-arm64-apple-darwin-codesigning.tar.gz
b615073745ca20065cd2199270dd4bbd1a6a9e6b89e8b63cfc9c214209e99f80 guix-build-5b484ec02e12/output/arm64-apple-darwin/bitcoin-5b484ec02e12-arm64-apple-darwin-unsigned.tar.gz
db6926b5c31739a6e91797980757a45944683a29fbe517e5097fe3e63926ec51 guix-build-5b484ec02e12/output/arm64-apple-darwin/bitcoin-5b484ec02e12-arm64-apple-darwin-unsigned.zip
97151a2bf5aad38b1ed24732dae8808f81dc4305b38e8a8b7541270ab744e4d2 guix-build-5b484ec02e12/output/dist-archive/bitcoin-5b484ec02e12.tar.gz
65c7289d75cf68ee63efefe214f65877363d8ad7e4fd1b0b3760bac7a2fa815f guix-build-5b484ec02e12/output/powerpc64-linux-gnu/SHA256SUMS.part
a5f23046b1a0e3ee1de3ddfaaeb585709c1f2baefbd9ac579b9be15823fd1537 guix-build-5b484ec02e12/output/powerpc64-linux-gnu/bitcoin-5b484ec02e12-powerpc64-linux-gnu-debug.tar.gz
6f9d99215b1398607c27758802809d2cb48ddafd30207c08aeb860b9916fa55c guix-build-5b484ec02e12/output/powerpc64-linux-gnu/bitcoin-5b484ec02e12-powerpc64-linux-gnu.tar.gz
be9e9822865f0e4e3801cd644c36a4015b989c911b10f25a10050bf28eb75f3a guix-build-5b484ec02e12/output/riscv64-linux-gnu/SHA256SUMS.part
8911687464175f223d2f97e0a2e948940f50dbb7d8259b75486d4562b0ae6297 guix-build-5b484ec02e12/output/riscv64-linux-gnu/bitcoin-5b484ec02e12-riscv64-linux-gnu-debug.tar.gz
e5ee16c360ba227368eeeabeb8b9c3d7533fcad256bbf8384a1512e0c6d2b729 guix-build-5b484ec02e12/output/riscv64-linux-gnu/bitcoin-5b484ec02e12-riscv64-linux-gnu.tar.gz
7a5c9b09101315409949b10aaed11717921b8c4b4c36b3595859169ff999a177 guix-build-5b484ec02e12/output/x86_64-apple-darwin/SHA256SUMS.part
fac621f837c788660bbf1c5270abd9fd76c2663a34641b8e3b01f8840ad6aa51 guix-build-5b484ec02e12/output/x86_64-apple-darwin/bitcoin-5b484ec02e12-x86_64-apple-darwin-codesigning.tar.gz
39e4fcd86aff464b42ac13c4c18bd458f5b518fcb6230096758cf0e4dac0fbad guix-build-5b484ec02e12/output/x86_64-apple-darwin/bitcoin-5b484ec02e12-x86_64-apple-darwin-unsigned.tar.gz
535238d7d5e1a3467ba1d0024207d7d80566c680a400bb7b2353ac221b9598cb guix-build-5b484ec02e12/output/x86_64-apple-darwin/bitcoin-5b484ec02e12-x86_64-apple-darwin-unsigned.zip
ee5f4e40d200525d7007f35c5e1a21ef12307181a3114a8bf1e7aa89a34c2271 guix-build-5b484ec02e12/output/x86_64-linux-gnu/SHA256SUMS.part
de8eff44477f5b11d51323083dffe0469e13684c96ca30625b8b267fe37c4747 guix-build-5b484ec02e12/output/x86_64-linux-gnu/bitcoin-5b484ec02e12-x86_64-linux-gnu-debug.tar.gz
a37af368c8b514a0e985c6e89f56ea5744fea2b6b1866ca69c5aa11e6068fb02 guix-build-5b484ec02e12/output/x86_64-linux-gnu/bitcoin-5b484ec02e12-x86_64-linux-gnu.tar.gz
318d5e81ee9dcfa9405d37978a9b8e1017b5bcdf99a7dce2659a62594b843b3e guix-build-5b484ec02e12/output/x86_64-w64-mingw32/SHA256SUMS.part
41ff20dd23c5c2cf2c0ec66fe5dc0ef4bdffd16738baaff7a336667a82454b18 guix-build-5b484ec02e12/output/x86_64-w64-mingw32/bitcoin-5b484ec02e12-win64-codesigning.tar.gz
90f1e98294f03cbde978c2401959fda3520f629cd67838bf9ead00874be9fc6e guix-build-5b484ec02e12/output/x86_64-w64-mingw32/bitcoin-5b484ec02e12-win64-debug.zip
37478530de992a604bc12a5048135ff2f871410735458ff12530611407dba8a9 guix-build-5b484ec02e12/output/x86_64-w64-mingw32/bitcoin-5b484ec02e12-win64-setup-unsigned.exe
ae339ea189572f4f0524f734a78954743d1718175652c0e797a3cfe4b4129d16 guix-build-5b484ec02e12/output/x86_64-w64-mingw32/bitcoin-5b484ec02e12-win64-unsigned.zip
28 | + ((string-contains target "-linux-") 29 | + (list bison 30 | + pkg-config)) 31 | + ((string-contains target "darwin") 32 | + (list zip)) 33 | + (else '())))))
I believe we can squeeze this manifest a bit more:
--- a/contrib/guix/manifest_gui.scm
+++ b/contrib/guix/manifest_gui.scm
@@ -4,19 +4,12 @@
((gnu packages installers) #:select (nsis-x86_64))
(gnu packages ninja)
(gnu packages pkg-config)
- ((gnu packages python-xyz) #:select (python-lief))
- (guix build-system python)
- (guix git-download)
- (guix packages))
+ ((gnu packages python-xyz) #:select (python-lief)))
(packages->manifest
(append
(list ;; Compression and archiving
xz
- ;; File(system) inspection
- diffutils
- ;; File transformation
- gawk
;; Build tools
ninja
;; Tests
@@ -27,6 +20,7 @@
nsis-x86_64))
((string-contains target "-linux-")
(list bison
+ gawk
pkg-config))
((string-contains target "darwin")
(list zip))
Pushed this into the final commit.
Looking closely at the following diff:
--- contrib/guix/libexec/build_win.sh
+++ contrib/guix/libexec/build_win_gui.sh
@@ -41,8 +41,7 @@
${SOURCES_PATH+SOURCES_PATH="$SOURCES_PATH"} \
${BASE_CACHE+BASE_CACHE="$BASE_CACHE"} \
${build_CC+build_CC="$build_CC"} \
- ${build_CXX+build_CXX="$build_CXX"} \
- NO_QT=1
+ ${build_CXX+build_CXX="$build_CXX"}
# CFLAGS
HOST_CFLAGS="-O2 -g"
@@ -69,20 +68,25 @@
--toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" \
-Werror=dev \
-DBUILD_BENCH=OFF \
+ -DBUILD_BITCOIN_BIN=OFF \
+ -DBUILD_CLI=OFF \
+ -DBUILD_DAEMON=OFF \
-DBUILD_FUZZ_BINARY=OFF \
- -DBUILD_GUI=OFF \
-DBUILD_GUI_TESTS=OFF \
+ -DBUILD_TESTS=OFF \
+ -DBUILD_TX=OFF \
+ -DBUILD_UTIL=OFF \
+ -DBUILD_WALLET_TOOL=OFF \
-DCMAKE_INSTALL_PREFIX="${INSTALLPATH}" \
-DREDUCE_EXPORTS=ON \
-DWITH_CCACHE=OFF
# Build Bitcoin Core
- cmake --build build -j "$JOBS"
+ cmake --build build -j "$JOBS" --target bitcoin-qt
# Install built Bitcoin Core
- cmake --install build
+ cmake --install build --component bitcoin-qt
)
-rm -rf "$DISTSRC"/build
-
-exit 0
+# shellcheck source=package.sh
+source "$(dirname "${BASH_SOURCE[0]}")/package.sh"
I'd like to suggest considering the following:
We could rely on the default component-specific build options provided by a toolchain file and drop the related ON/OFF options in the cmake invocation.
Since these two scripts are overwhelmingly similar, we could run a single script with a parameter, and execute the diverging code paths conditionally depending on that parameter (as it was implemented in #35098).
We could rely on the default component-specific build options provided by a toolchain file
If we aren't dropping all the options, I'm not sure about introducing more (toolchain) files, to set some options, but not all of them (we could also revert to the prior state of the PR, where we had a shared set of config options inline). I'm also not sure about just doing this for a single host, or do you mean do it for Windows and macOS (even though they have divergent options)?
we could run a single script with a parameter,
We could also revert to the prior state of this PR, where the build was already a single script with a parameter ($host) (prior to the suggestions to split the builds up further).
The new script is parameterized by paths to executables. It can be used
to generate the installer from the install tree rather than the build
tree. This capability will be used by the Guix scripts in subsequent
commits.
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>