Revert #36057 & document mingw-w64 requirement #36271

Manually merged
fanquake merged 3 commits from revert_36057 into master 2026-10-11 07:05:12 +00:00 AGit
fanquake commented 2026-09-16 12:36:44 +00:00 (Migrated from github.com)

A follow-up reverting #36057, now that we've branched off for 33.x.
Also documents mingw-w64 requirements (#32380).

A follow-up reverting #36057, now that we've branched off for `33.x`. Also documents `mingw-w64` requirements (#32380).
DrahtBot commented 2026-09-16 12:36:51 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK willcl-ark, hebasto
Stale ACK ViniciusCestarii, hodlinator

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36042 (build: Bump g++ minimum supported version to 13 by maflcko)

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.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36271 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36271.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36271#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [willcl-ark](https://github.com/bitcoin/bitcoin/pull/36271#pullrequestreview-5412377369), [hebasto](https://github.com/bitcoin/bitcoin/pull/36271#pullrequestreview-5482269735) | | Stale ACK | [ViniciusCestarii](https://github.com/bitcoin/bitcoin/pull/36271#pullrequestreview-5227376196), [hodlinator](https://github.com/bitcoin/bitcoin/pull/36271#pullrequestreview-5266271964) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36042](https://github.com/bitcoin/bitcoin/pull/36042) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36042.svg"></sub> (build: Bump g++ minimum supported version to 13 by maflcko) 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-->
maflcko (Migrated from github.com) reviewed 2026-09-16 14:01:24 +00:00
maflcko (Migrated from github.com) commented 2026-09-16 14:01:24 +00:00

I think this one can be removed as well now:

diff --git a/contrib/devtools/shell-win64-cross.nix b/contrib/devtools/shell-win64-cross.nix
index 4fd83b0..7e0da92 100644
--- a/contrib/devtools/shell-win64-cross.nix
+++ b/contrib/devtools/shell-win64-cross.nix
@@ -10,8 +10,3 @@
 let
-  host = builtins.getEnv "HOST";
-  crossPkgs = if host == "x86_64-w64-mingw32ucrt"
-    then pkgs.pkgsCross.ucrt64
-    else if host == "x86_64-w64-mingw32"
-      then pkgs.pkgsCross.mingwW64
-      else throw "Unsupported HOST: ${host}";
+  crossPkgs = pkgs.pkgsCross.ucrt64;
   toolchain = crossPkgs.stdenv.cc.targetPrefix;
diff --git a/depends/README.md b/depends/README.md
index 3cee78a..f17bcab 100644
--- a/depends/README.md
+++ b/depends/README.md
@@ -169,4 +169,3 @@ you may install `nix-bin` and use the Nix shell from the repository root:
     apt install nix-bin
-    NIX_BUILD_SHELL=bash HOST=x86_64-w64-mingw32ucrt nix-shell contrib/devtools/shell-win64-cross.nix  # UCRT
+    NIX_BUILD_SHELL=bash nix-shell contrib/devtools/shell-win64-cross.nix
 
I think this one can be removed as well now: ```diff diff --git a/contrib/devtools/shell-win64-cross.nix b/contrib/devtools/shell-win64-cross.nix index 4fd83b0..7e0da92 100644 --- a/contrib/devtools/shell-win64-cross.nix +++ b/contrib/devtools/shell-win64-cross.nix @@ -10,8 +10,3 @@ let - host = builtins.getEnv "HOST"; - crossPkgs = if host == "x86_64-w64-mingw32ucrt" - then pkgs.pkgsCross.ucrt64 - else if host == "x86_64-w64-mingw32" - then pkgs.pkgsCross.mingwW64 - else throw "Unsupported HOST: ${host}"; + crossPkgs = pkgs.pkgsCross.ucrt64; toolchain = crossPkgs.stdenv.cc.targetPrefix; diff --git a/depends/README.md b/depends/README.md index 3cee78a..f17bcab 100644 --- a/depends/README.md +++ b/depends/README.md @@ -169,4 +169,3 @@ you may install `nix-bin` and use the Nix shell from the repository root: apt install nix-bin - NIX_BUILD_SHELL=bash HOST=x86_64-w64-mingw32ucrt nix-shell contrib/devtools/shell-win64-cross.nix # UCRT + NIX_BUILD_SHELL=bash nix-shell contrib/devtools/shell-win64-cross.nix
fanquake (Migrated from github.com) reviewed 2026-09-16 14:07:18 +00:00
fanquake (Migrated from github.com) commented 2026-09-16 14:07:18 +00:00

Sure, dropped.

Sure, dropped.
hebasto (Migrated from github.com) reviewed 2026-09-16 17:07:41 +00:00
hebasto (Migrated from github.com) left a comment

Concept ACK. This follows the plan.

Concept ACK. This follows the [plan](https://github.com/bitcoin/bitcoin/pull/36057#issuecomment-5450203081).
ViniciusCestarii (Migrated from github.com) reviewed 2026-09-16 19:28:33 +00:00
ViniciusCestarii (Migrated from github.com) left a comment
ACK ce76c082cead6a107d1c95f584a0eff390b3539f
hodlinator (Migrated from github.com) approved these changes 2026-09-21 12:21:47 +00:00
hodlinator (Migrated from github.com) left a comment

ACK ce76c082ce

Makes sense to drop remaining MSVCRT logic now that #33593 was merged.

Only remaining but probably acceptable references to "MSVCRT" in the repo are now overriding to UCRT:

github.com/bitcoin/bitcoin@ce76c082ce/contrib/guix/manifest_build.scm (L130-L139)


Completed Linux->Windows cross CI locally:

env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'MAKEJOBS="-j$(nproc)" FILE_ENV="./ci/test/00_setup_env_win64.sh" ./ci/test_run_all.sh'

(test_run_all.sh calls 02_run_container.py which calls shell-win64-cross.nix since 00_setup_env_win64.sh set HOST=x86_64-w64-mingw32ucrt).

ACK ce76c082cead6a107d1c95f584a0eff390b3539f Makes sense to drop remaining MSVCRT logic now that #33593 was merged. Only remaining but probably acceptable references to "MSVCRT" in the repo are now overriding to UCRT: https://github.com/bitcoin/bitcoin/blob/ce76c082cead6a107d1c95f584a0eff390b3539f/contrib/guix/manifest_build.scm#L130-L139 --- Completed Linux->Windows cross CI locally: ``` env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'MAKEJOBS="-j$(nproc)" FILE_ENV="./ci/test/00_setup_env_win64.sh" ./ci/test_run_all.sh' ``` (test_run_all.sh calls 02_run_container.py which calls shell-win64-cross.nix since 00_setup_env_win64.sh set `HOST=x86_64-w64-mingw32ucrt`).
hodlinator (Migrated from github.com) commented 2026-09-21 11:53:40 +00:00

One could potentially retain the HAVE_SETTHREADDESCRIPTION logic and make it fail at compile time:

#if defined(WIN32) && !defined(HAVE_SETTHREADDESCRIPTION)
#error "At least Mingw-w64 version 12.0 is required."
#endif

But I'm okay with just documenting the minimum version as well, and dropping HAVE_SETTHREADDESCRIPTION to keep build complexity down.

One could potentially retain the `HAVE_SETTHREADDESCRIPTION` logic and make it fail at compile time: ```c++ #if defined(WIN32) && !defined(HAVE_SETTHREADDESCRIPTION) #error "At least Mingw-w64 version 12.0 is required." #endif ``` But I'm okay with just documenting the minimum version as well, and dropping `HAVE_SETTHREADDESCRIPTION` to keep build complexity down.
hebasto (Migrated from github.com) approved these changes 2026-09-22 21:23:36 +00:00
hebasto (Migrated from github.com) left a comment

ACK ce76c082ce, I have reviewed the code and it looks OK.

However, I'd like to leave a couple of thoughts regarding versioning of the Windows cross-build toolchain.

  1. The MinGW-w64 version should be logged in the configure summary, along with the compiler version. See the proposal in #36029.

  2. Historically, we were bound to whichever combination of MinGW-w64 and GCC a particular distribution shipped. Switching to Nix opens the door to testing every documented combination (with some patching).

    So I tried MinGW-w64 12.0.0 + GCC 12.4.0:

    • The wallet_migration.py test fails. I haven't looked into it yet, but it may be a reason to bump the minimum supported MinGW-w64 version to 13.0, which contains many bug fixes.

    • Requiring GCC 13 or newer for the GUI appears unnecessary. Perhaps I misjudged the minimum toolchain requirements in 0a6724aaae.

ACK ce76c082cead6a107d1c95f584a0eff390b3539f, I have reviewed the code and it looks OK. However, I'd like to leave a couple of thoughts regarding versioning of the Windows cross-build toolchain. 1. The MinGW-w64 version should be logged in the configure summary, along with the compiler version. See the proposal in #36029. 2. Historically, we were bound to whichever combination of MinGW-w64 and GCC a particular distribution shipped. Switching to Nix opens the door to testing every documented combination (with some patching). So I [tried](https://github.com/hebasto/bitcoin/actions/runs/35755777710/job/106841191753) MinGW-w64 12.0.0 + GCC 12.4.0: - The `wallet_migration.py` test [fails](https://github.com/hebasto/bitcoin/actions/runs/35755777710/job/106874712751). I haven't looked into it yet, but it may be a reason to bump the minimum supported MinGW-w64 version to 13.0, which contains many bug fixes. - Requiring GCC 13 or newer for the GUI appears unnecessary. Perhaps I misjudged the minimum toolchain requirements in 0a6724aaae973659b6c44eb5a062aaaaf57be870.
hebasto (Migrated from github.com) reviewed 2026-09-23 11:00:25 +00:00
hebasto (Migrated from github.com) left a comment
  • The wallet_migration.py test fails.

This turned out to be a libstdc++ bug. It was fixed on master (GCC 15.1) and backported to GCC 14 (github.com/gcc-mirror/gcc@35c98149a5, first in GCC 14.3.0) and GCC 13 (github.com/gcc-mirror/gcc@8b3e47b409, first in GCC 13.4.0).

GCC 12 never received the backport, so every 12.x release remains broken.

I believe we should handle these cases somehow.

> * The `wallet_migration.py` test [fails](https://github.com/hebasto/bitcoin/actions/runs/35755777710/job/106874712751). This turned out to be a libstdc++ bug. It was [fixed](https://github.com/gcc-mirror/gcc/commit/017e3f89b081e4828a588a3bd27b5feacea042b7) on master (GCC 15.1) and backported to GCC 14 (https://github.com/gcc-mirror/gcc/commit/35c98149a5c7af9159fa7615d8d827b3aaa3cc97, first in GCC 14.3.0) and GCC 13 (https://github.com/gcc-mirror/gcc/commit/8b3e47b4099f319e38d357f7c646f51040a13d6e, first in GCC 13.4.0). GCC 12 never received the backport, so every 12.x release remains broken. I believe we should handle these cases somehow.
maflcko commented 2026-09-23 11:38:33 +00:00 (Migrated from github.com)

I believe we should handle these cases somehow.

See https://github.com/bitcoin/bitcoin/pull/36042, but there could also be a unit test, if you think it is important?

> I believe we should handle these cases somehow. See https://github.com/bitcoin/bitcoin/pull/36042, but there could also be a unit test, if you think it is important?
DrahtBot commented 2026-09-24 12:24:29 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
First-time contributor

Base: 66776840beb558f7e84451c2c55457f0e06242f0
Head: 1c96b08cb60bee930ed390de019a2cf943445ef5

No verified findings are available from this partial review.

Review coverage was incomplete. The archaeology review had incomplete evidence. The adversarial_glm review did not complete.

Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> Base: `66776840beb558f7e84451c2c55457f0e06242f0` Head: `1c96b08cb60bee930ed390de019a2cf943445ef5` No verified findings are available from this partial review. Review coverage was incomplete. The archaeology review had incomplete evidence. The adversarial_glm review did not complete. [Full review report](<https://review.fish.foo/traces/36271-1c96b08cb60bee930ed390de019a2cf943445ef5-333-2.html>)
hebasto (Migrated from github.com) approved these changes 2026-10-02 16:29:47 +00:00
hebasto (Migrated from github.com) left a comment

ACK b6eebe027e.

ACK b6eebe027eb59a7cafc3814b48658708bbc4b8e2.
willcl-ark (Migrated from github.com) reviewed 2026-10-02 21:02:40 +00:00
willcl-ark (Migrated from github.com) commented 2026-10-02 21:02:40 +00:00

In b6eebe027e

I think this slight simplification should work too, if you retouch:

  crossPkgs = pkgs.pkgsCross.ucrt64.extend (_: _: {
In b6eebe027eb59a7cafc3814b48658708bbc4b8e2 I think this slight simplification should work too, if you retouch: ```suggestion crossPkgs = pkgs.pkgsCross.ucrt64.extend (_: _: { ```
fanquake (Migrated from github.com) reviewed 2026-10-03 10:12:24 +00:00
fanquake (Migrated from github.com) commented 2026-10-03 10:12:24 +00:00

Thanks, taken.

Thanks, taken.
willcl-ark (Migrated from github.com) approved these changes 2026-10-05 09:19:04 +00:00
willcl-ark (Migrated from github.com) left a comment

utACK 1c96b08cb6

If i have it all correct, after this PR:

  • our Windows cross-build CI, Guix release builds, and Nix shell use UCRT.
  • MinGW-w64 12 itself still supports both UCRT and MSVCRT. the version requirement does not force any runtime choice on native windows builders.
  • our documented cross-build instructions use UCRT, while native MinGW-w64 builds are not officially tested.
utACK 1c96b08cb60bee930ed390de019a2cf943445ef5 If i have it all correct, after this PR: - our Windows cross-build CI, Guix release builds, and Nix shell use UCRT. - MinGW-w64 12 itself still supports both UCRT and MSVCRT. the version requirement does not force any runtime choice on native windows builders. - our documented cross-build instructions use UCRT, while native MinGW-w64 builds are not officially tested.
hebasto (Migrated from github.com) approved these changes 2026-10-11 07:03:46 +00:00
hebasto (Migrated from github.com) left a comment

re-ACK 1c96b08cb6.

re-ACK 1c96b08cb60bee930ed390de019a2cf943445ef5.
hebasto commented 2026-10-23 10:04:07 +00:00 (Migrated from github.com)

I believe we should handle these cases somehow.

See #36042, but there could also be a unit test, if you think it is important?

Done in https://github.com/bitcoin/bitcoin/pull/36620.

> > I believe we should handle these cases somehow. > > See #36042, but there could also be a unit test, if you think it is important? Done in https://github.com/bitcoin/bitcoin/pull/36620.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36271
No description provided.