This PR:
- Switches Windows release binaries to UCRT.
- Update docs.
- Drops MSVCRT workarounds.
Closes #30210.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33593.
See the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.
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.
122@@ -123,6 +123,104 @@ desirable for building Bitcoin Core release binaries."
123 (package-with-extra-patches mingw-w64-x86_64-winpthreads
124 (search-our-patches "winpthreads-remap-guix-store.patch")))
125
126+
127+;; While mingw-w64 is packaged in Guix, we maintain our own package,
128+;; to use UCRT runtime.
0 ;; XXX: A new target to use UCRT can be introduced as
1 ;; the MSYS2 project does, e.g: x86_64-w64-ucrt-mingw32.
2 "--with-default-msvcrt=msvcrt")
I’ve added a new configure flag to set the default MSVCRT to MSVCRT as the default now is UCRT. This default is also changed by Debian, other projects like MSYS2 use a different target triplet for UCRT which is now the default and could be introduced if necessary on GNU Guix.
122@@ -123,6 +123,104 @@ desirable for building Bitcoin Core release binaries."
123 (package-with-extra-patches mingw-w64-x86_64-winpthreads
124 (search-our-patches "winpthreads-remap-guix-store.patch")))
125
126+
127+;; While mingw-w64 is packaged in Guix, we maintain our own package,
128+;; to use UCRT runtime.
129+(define* (make-mingw-w64/implementation machine
we maintain our own package
If we are going to copy-paste this from Guix, and maintain it outself, seems like we should simplify it for our usage? i.e we know we are building winpthreads.
with-winpthreads? argument, as during the recursive invocation it is unset:https://github.com/bitcoin/bitcoin/blob/f380e6251021cc7aa0c47f564147abea922dc050/contrib/guix/manifest.scm#L154-L157
It should be possible to inherit the Guix package and then modify arguments to replace `"–with-default-msvcrt=msvcrt" with “”–with-default-msvcrt=ucrt"
0(use-modules
1 (guix packages)
2 (guix gexp)
3 (guix utils)
4 (gnu packages mingw)
5 (srfi srfi-1))
6
7(define (override-mingw base-pkg)
8 (package
9 (inherit base-pkg)
10 (name "mingw-ucrt") ; fix this
11 (arguments
12 (substitute-keyword-arguments (package-arguments base-pkg)
13 ((#:configure-flags flags)
14 #~(cons "--with-default-msvcrt=ucrt" (drop-right #$flags 1)))))))
15
16(define-public mingw-x86_64-ucrt (override-mingw mingw-w64-x86_64-winpthreads))
17(define-public mingw-i686-ucrt (override-mingw mingw-w64-i686-winpthreads))
Would it work with the recursion in make-mingw-w64/implementation?
Forgot about that, so no🤦🏻♂️. Will be much better when that PR lands. (See below)
@hebasto This builds correctly with guix build -f [save below to tmp file]. The native-inputs override solves the issue with recursion.
0(use-modules
1 (guix packages)
2 (guix gexp)
3 (guix utils)
4 (guix build-system gnu)
5 (gnu packages mingw))
6
7(define (override-msvcrt pkg)
8 (package
9 (inherit pkg)
10 (name (string-append (package-name pkg) "-ucrt"))
11 (arguments
12 (substitute-keyword-arguments (package-arguments pkg)
13 ((#:configure-flags flags)
14 #~(map (lambda (flag)
15 (if (string-prefix? "--with-default-msvcrt" flag)
16 "--with-default-msvcrt=ucrt"
17 flag))
18 #$flags))))))
19
20(define (make-mingw-ucrt winpthreads-pkg sans-pkg)
21 (override-msvcrt
22 (package
23 (inherit winpthreads-pkg)
24 (native-inputs
25 (modify-inputs (package-native-inputs winpthreads-pkg)
26 (replace "xlibc" (override-msvcrt sans-pkg)))))))
27
28(define-public mingw-x86_64-ucrt
29 (make-mingw-ucrt mingw-w64-x86_64-winpthreads mingw-w64-x86_64-sans-winpthreads))
30
31(define-public mingw-i686-ucrt
32 (make-mingw-ucrt mingw-w64-i686-winpthreads mingw-w64-i686-sans-winpthreads))
33
34mingw-x86_64-ucrt
0successfully built /gnu/store/97knb394q69xs0swb9imax4zqfc8vhnb-mingw-w64-x86_64-winpthreads-ucrt-13.0.0.drv
1/gnu/store/y5w87r0sj59c7ga23r69ln4mvy4ibff9-mingw-w64-x86_64-winpthreads-ucrt-13.0.0
136+specified, recurse and return a mingw-w64 with support for winpthreads."
137+ (let* ((triplet (string-append machine "-" "w64-mingw32")))
138+ (package
139+ (name (string-append "mingw-w64" "-" machine
140+ (if with-winpthreads? "-winpthreads" "")))
141+ (version "12.0.0")
Rebased. Some of the feedback has been addressed.
My Guix build:
0x86_64
1366c53942430c0f310fc42445693e7ba1ff5dce25f2df8e42d3c4b044747f385 guix-build-4d31ddc6dfe6/output/dist-archive/bitcoin-4d31ddc6dfe6.tar.gz
21b0c2e70c8f85650a4b4238c74dd22b960b2f4036042d2f8c6b302dbc50ae3b7 guix-build-4d31ddc6dfe6/output/x86_64-w64-mingw32/SHA256SUMS.part
3ed292458da2126949ee0a35495ba59272066364d7b458b28576dcd229ed984b5 guix-build-4d31ddc6dfe6/output/x86_64-w64-mingw32/bitcoin-4d31ddc6dfe6-win64-codesigning.tar.gz
49cf21d10a8c63edd81f43360dd39b0f38c38fc7ac632b96243838c980fd8abe2 guix-build-4d31ddc6dfe6/output/x86_64-w64-mingw32/bitcoin-4d31ddc6dfe6-win64-debug.zip
57e402681080ca6e0e4c5c8c9113bc3c6f9ac2a0f878a8e253c9c8a91756cf065 guix-build-4d31ddc6dfe6/output/x86_64-w64-mingw32/bitcoin-4d31ddc6dfe6-win64-setup-unsigned.exe
6feaa36c5edf9b9e30bd2e1c3523d2f1b445cb6bf96c40a87c250c37343d8d6bd guix-build-4d31ddc6dfe6/output/x86_64-w64-mingw32/bitcoin-4d31ddc6dfe6-win64-unsigned.zip
What is the plan for adding CI, as that blocks everything here?
I’m working on it. I have issues with the sqlite package that are not reproducible neither in the nightly builds nor locally.
UPDATE. See #33764.
My Guix build:
0aarch64
14e80325f9cba1c286a999eeaa6fb5f06bb56ba03f118cfb6eaa86c8443318ccc guix-build-dbb835956abf/output/dist-archive/bitcoin-dbb835956abf.tar.gz
27557b85092d69ac4f6ebeb4881a41fe808ee684b1b2f87efde97a616f1d1b213 guix-build-dbb835956abf/output/x86_64-w64-mingw32/SHA256SUMS.part
33cf561ff53f83f822fd451b2f83161908daad89598d286de916a641640abe747 guix-build-dbb835956abf/output/x86_64-w64-mingw32/bitcoin-dbb835956abf-win64-codesigning.tar.gz
4f607587780890278ffcc9c4b346bcecc9998951d99fb6d3e8a075c5f2ad76cc6 guix-build-dbb835956abf/output/x86_64-w64-mingw32/bitcoin-dbb835956abf-win64-debug.zip
5dd5c910c4a46b1fba7fe2dd3c1747c99cd23d24c832768b3d7abc2c3a3aa7598 guix-build-dbb835956abf/output/x86_64-w64-mingw32/bitcoin-dbb835956abf-win64-setup-unsigned.exe
62c9f04917c10cf52151aeac6276f94c6b3229d80ca72ee980c987282cd26a471 guix-build-dbb835956abf/output/x86_64-w64-mingw32/bitcoin-dbb835956abf-win64-unsigned.zip
Guix Build (aarch64):
0451630ecff800ab320a9d5ad8062758df9d700310690110e764c916ae4c8121e guix-build-527acc5ee497/output/dist-archive/bitcoin-527acc5ee497.tar.gz
1bf19a3b8e9e9cf609102c38cd6c00dca4d2645f66ae3af591f29fdeceef7b6cf guix-build-527acc5ee497/output/x86_64-w64-mingw32/SHA256SUMS.part
2b69dc956f6fd6bb9b4e20e5f4d29eb4ef74e450d250346bf0450cc051b5cfa95 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-codesigning.tar.gz
39e44c7635597430ee32fb26dff8fcd3261fe747ca66b78ed3bc1fb6c6a0efad8 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-debug.zip
48527ebfe0d7849b3182c9c2f71b6be616e3c8fd38a6f10878c2fadf165ed8764 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-setup-unsigned.exe
5ee9437a08668555adaa1cfa30d6a87b5cbdd6d20c4b7b456dd7dc99f78a0f03d guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-unsigned.zip
My Guix build:
0aarch64
1451630ecff800ab320a9d5ad8062758df9d700310690110e764c916ae4c8121e guix-build-527acc5ee497/output/dist-archive/bitcoin-527acc5ee497.tar.gz
2bf19a3b8e9e9cf609102c38cd6c00dca4d2645f66ae3af591f29fdeceef7b6cf guix-build-527acc5ee497/output/x86_64-w64-mingw32/SHA256SUMS.part
3b69dc956f6fd6bb9b4e20e5f4d29eb4ef74e450d250346bf0450cc051b5cfa95 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-codesigning.tar.gz
49e44c7635597430ee32fb26dff8fcd3261fe747ca66b78ed3bc1fb6c6a0efad8 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-debug.zip
58527ebfe0d7849b3182c9c2f71b6be616e3c8fd38a6f10878c2fadf165ed8764 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-setup-unsigned.exe
6ee9437a08668555adaa1cfa30d6a87b5cbdd6d20c4b7b456dd7dc99f78a0f03d guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-unsigned.zip
UPDATE: Hashes on x86_64 are the same.
Guix Build:
0x86_64
1451630ecff800ab320a9d5ad8062758df9d700310690110e764c916ae4c8121e guix-build-527acc5ee497/output/dist-archive/bitcoin-527acc5ee497.tar.gz
2bf19a3b8e9e9cf609102c38cd6c00dca4d2645f66ae3af591f29fdeceef7b6cf guix-build-527acc5ee497/output/x86_64-w64-mingw32/SHA256SUMS.part
3b69dc956f6fd6bb9b4e20e5f4d29eb4ef74e450d250346bf0450cc051b5cfa95 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-codesigning.tar.gz
49e44c7635597430ee32fb26dff8fcd3261fe747ca66b78ed3bc1fb6c6a0efad8 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-debug.zip
58527ebfe0d7849b3182c9c2f71b6be616e3c8fd38a6f10878c2fadf165ed8764 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-setup-unsigned.exe
6ee9437a08668555adaa1cfa30d6a87b5cbdd6d20c4b7b456dd7dc99f78a0f03d guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-unsigned.zip
Here is my Guix build on RISC-V machine:
0riscv64
1451630ecff800ab320a9d5ad8062758df9d700310690110e764c916ae4c8121e guix-build-527acc5ee497/output/dist-archive/bitcoin-527acc5ee497.tar.gz
2bf19a3b8e9e9cf609102c38cd6c00dca4d2645f66ae3af591f29fdeceef7b6cf guix-build-527acc5ee497/output/x86_64-w64-mingw32/SHA256SUMS.part
3b69dc956f6fd6bb9b4e20e5f4d29eb4ef74e450d250346bf0450cc051b5cfa95 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-codesigning.tar.gz
49e44c7635597430ee32fb26dff8fcd3261fe747ca66b78ed3bc1fb6c6a0efad8 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-debug.zip
58527ebfe0d7849b3182c9c2f71b6be616e3c8fd38a6f10878c2fadf165ed8764 guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-setup-unsigned.exe
6ee9437a08668555adaa1cfa30d6a87b5cbdd6d20c4b7b456dd7dc99f78a0f03d guix-build-527acc5ee497/output/x86_64-w64-mingw32/bitcoin-527acc5ee497-win64-unsigned.zip
Shouldn’t this be removing the other CI (#33764):
MSVCRT-related CI jobs should be removed from the CI framework once the migration to UCRT is complete.
Shouldn’t this be removing the other CI (#33764):
MSVCRT-related CI jobs should be removed from the CI framework once the migration to UCRT is complete.
Removed.
Co-authored-by: Trevor Arjeski <tmarjeski@gmail.com>
My Guix build:
0x86_64
1e96b2d1529bba5b3d98c05c4cb017c2c4e4b204e868a2b7f657827075dcd9a16 guix-build-fece4625de26/output/aarch64-linux-gnu/SHA256SUMS.part
2bd9de4050712e8fb7c70b3f86110ed6a53e07fd0e89c486379d77354f78165f4 guix-build-fece4625de26/output/aarch64-linux-gnu/bitcoin-fece4625de26-aarch64-linux-gnu-debug.tar.gz
3fca84a6885fbb660d702faa0a6b278667fa3fbc48ceecc3ee61d5de93f553bfc guix-build-fece4625de26/output/aarch64-linux-gnu/bitcoin-fece4625de26-aarch64-linux-gnu.tar.gz
42b18a357f5124e5c4e9544ccdf3c1ea32e1999b74c771649e7bd901f761b54e4 guix-build-fece4625de26/output/arm-linux-gnueabihf/SHA256SUMS.part
58d022bc485e2d54504dcd7652a5be3922827de951b8632168bcb0ffba8aa783d guix-build-fece4625de26/output/arm-linux-gnueabihf/bitcoin-fece4625de26-arm-linux-gnueabihf-debug.tar.gz
6c7f366824e03d6832b0c5a58aac9529d318ccdc585472db74a75adcc0ac5b76c guix-build-fece4625de26/output/arm-linux-gnueabihf/bitcoin-fece4625de26-arm-linux-gnueabihf.tar.gz
7723c089b6df295f2190ba1237b728d0fa5f6f8434cc9958471bafb0fedf95a34 guix-build-fece4625de26/output/arm64-apple-darwin/SHA256SUMS.part
836484e4351e951be9c1de69719ea3caa94b469322d637f41b02f1493304956cf guix-build-fece4625de26/output/arm64-apple-darwin/bitcoin-fece4625de26-arm64-apple-darwin-codesigning.tar.gz
95431d0a14b2e4322fdb10a61389bfd4322da86e0d1e04b2556ec46f16196d596 guix-build-fece4625de26/output/arm64-apple-darwin/bitcoin-fece4625de26-arm64-apple-darwin-unsigned.tar.gz
10fe0d6452817e9de894aa733db279a95dd0420ef5322a5d6b6690a2bac1048a28 guix-build-fece4625de26/output/arm64-apple-darwin/bitcoin-fece4625de26-arm64-apple-darwin-unsigned.zip
1108d4c34bf34f33b7b4cabbc6aa6a2c8af58b73cbdc17fceb6c1001d1a8940d70 guix-build-fece4625de26/output/dist-archive/bitcoin-fece4625de26.tar.gz
1245ea2cd2ea9fdd3b98ab9469991bfa527574c27a3ef25df7b6c37577fcb84d4e guix-build-fece4625de26/output/powerpc64-linux-gnu/SHA256SUMS.part
1340190d6c750935241f514304bdcca8152156a02223fdcb7895b1d6773e642023 guix-build-fece4625de26/output/powerpc64-linux-gnu/bitcoin-fece4625de26-powerpc64-linux-gnu-debug.tar.gz
14c423bc2d242b5e1654f5d3206ed9984549812c4c7c4ace716c6f532b930969de guix-build-fece4625de26/output/powerpc64-linux-gnu/bitcoin-fece4625de26-powerpc64-linux-gnu.tar.gz
154b3dc70bbf942236d1145680c1a2e97787968ff173f48b602a180665b3c08274 guix-build-fece4625de26/output/riscv64-linux-gnu/SHA256SUMS.part
1665d2cb433f7dec48e0cab83d30ec02b9a6d15725eef7130e914c4ac7d20f532c guix-build-fece4625de26/output/riscv64-linux-gnu/bitcoin-fece4625de26-riscv64-linux-gnu-debug.tar.gz
17b0af39759f81859b183f35bfcf2839df56a257cf25f377845231f9460813a6e3 guix-build-fece4625de26/output/riscv64-linux-gnu/bitcoin-fece4625de26-riscv64-linux-gnu.tar.gz
188b6143558d6a05be727f945847477a68c5888aad634568a19567c966639fb0db guix-build-fece4625de26/output/x86_64-apple-darwin/SHA256SUMS.part
1911de80e59033770326daeff4354bfd43725d87082178898b204042d1147d4c5b guix-build-fece4625de26/output/x86_64-apple-darwin/bitcoin-fece4625de26-x86_64-apple-darwin-codesigning.tar.gz
203ecec766b31d1737ff8d3a60d01d34e5d9d12a113f737b1a58f8c2884250124a guix-build-fece4625de26/output/x86_64-apple-darwin/bitcoin-fece4625de26-x86_64-apple-darwin-unsigned.tar.gz
2152090d32acbe33a518dc57af0aa741698fe802768b478eb829b6b8e70f62f696 guix-build-fece4625de26/output/x86_64-apple-darwin/bitcoin-fece4625de26-x86_64-apple-darwin-unsigned.zip
225c7c1ef4f393a48090505daf515c50a03671d0fc312a3c0309cfff8866aaa048 guix-build-fece4625de26/output/x86_64-linux-gnu/SHA256SUMS.part
23e10255ae56d676e77ebf67b6714f8c68040a79435887d67e5311bf1aa0babbcc guix-build-fece4625de26/output/x86_64-linux-gnu/bitcoin-fece4625de26-x86_64-linux-gnu-debug.tar.gz
2459bcc92c7ae0aeb2ab3c500821edcc81c2b2606001d75efeac34cbedac469cc1 guix-build-fece4625de26/output/x86_64-linux-gnu/bitcoin-fece4625de26-x86_64-linux-gnu.tar.gz
25f4bef8727bc73db5408f6a1171465c01090cecd6af4cf04d7f7992b02a8bae07 guix-build-fece4625de26/output/x86_64-w64-mingw32/SHA256SUMS.part
26ebf57927bf680ad92d0f5e4c708350bb65c17485d397208ec11695a0b27edc66 guix-build-fece4625de26/output/x86_64-w64-mingw32/bitcoin-fece4625de26-win64-codesigning.tar.gz
272adc73f604f8cc57dabdc1abb2274b0d05a7a987dbe4ec7d9c5c51a463d69dd1 guix-build-fece4625de26/output/x86_64-w64-mingw32/bitcoin-fece4625de26-win64-debug.zip
2859a1a532e2b8defc3b5499be622f9606bd01a53e9a8e62bf7dc0cf36c5a86507 guix-build-fece4625de26/output/x86_64-w64-mingw32/bitcoin-fece4625de26-win64-setup-unsigned.exe
29a48f5c34d4bc8841128454c23ba2a973af1640a1a7d0de48bc05a26eb8bc77a1 guix-build-fece4625de26/output/x86_64-w64-mingw32/bitcoin-fece4625de26-win64-unsigned.zip