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>