Revert #36057 & document mingw-w64 requirement #36271

pull fanquake wants to merge 3 commits into bitcoin:master from fanquake:revert_36057 changing 6 files +5 −20
  1. fanquake commented at 12:36 PM on September 16, 2026: member

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

  2. DrahtBot commented at 12:36 PM on September 16, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    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 <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 <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-->

  3. fanquake force-pushed on Sep 16, 2026
  4. in depends/README.md:170 in bc63b06914
     166 | @@ -167,7 +167,6 @@ Some Ubuntu or Debian versions may not offer a working package. In this case,
     167 |  you may install `nix-bin` and use the Nix shell from the repository root:
     168 |  
     169 |      apt install nix-bin
     170 | -    NIX_BUILD_SHELL=bash HOST=x86_64-w64-mingw32 nix-shell contrib/devtools/shell-win64-cross.nix  # MSVCRT
     171 |      NIX_BUILD_SHELL=bash HOST=x86_64-w64-mingw32ucrt nix-shell contrib/devtools/shell-win64-cross.nix  # UCRT
    


    maflcko commented at 2:01 PM on September 16, 2026:

    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
     
    

    fanquake commented at 2:07 PM on September 16, 2026:

    Sure, dropped.

  5. fanquake force-pushed on Sep 16, 2026
  6. DrahtBot added the label CI failed on Sep 16, 2026
  7. DrahtBot removed the label CI failed on Sep 16, 2026
  8. hebasto commented at 5:07 PM on September 16, 2026: member

    Concept ACK. This follows the plan.

  9. ViniciusCestarii commented at 7:28 PM on September 16, 2026: contributor

    ACK ce76c082cead6a107d1c95f584a0eff390b3539f

  10. DrahtBot requested review from hebasto on Sep 16, 2026
  11. in src/util/threadnames.cpp:36 in ce76c082ce outdated
      32 | @@ -35,7 +33,7 @@ static void SetThreadName(const char* name)
      33 |      pthread_set_name_np(pthread_self(), name);
      34 |  #elif defined(__APPLE__)
      35 |      pthread_setname_np(name);
      36 | -#elif defined(HAVE_SETTHREADDESCRIPTION)
      37 | +#elif defined(WIN32)
    


    hodlinator commented at 11:53 AM on September 21, 2026:

    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.

  12. hodlinator approved
  13. hodlinator commented at 12:21 PM on September 21, 2026: contributor

    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).

  14. maflcko added this to the milestone 33.0 on Sep 21, 2026
  15. hebasto approved
  16. hebasto commented at 9:23 PM on September 22, 2026: member

    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 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 0a6724aaae973659b6c44eb5a062aaaaf57be870.

  17. hebasto commented at 11:00 AM on September 23, 2026: member
    • 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 (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.

  18. maflcko commented at 11:38 AM on September 23, 2026: member

    I believe we should handle these cases somehow.

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

  19. DrahtBot added the label Needs rebase on Sep 24, 2026
  20. fanquake force-pushed on Sep 25, 2026
  21. fanquake force-pushed on Sep 25, 2026
  22. DrahtBot added the label CI failed on Sep 25, 2026
  23. DrahtBot removed the label CI failed on Sep 25, 2026
  24. DrahtBot removed the label Needs rebase on Sep 25, 2026
  25. fanquake requested review from hebasto on Sep 29, 2026
  26. fanquake force-pushed on Oct 2, 2026
  27. hebasto approved
  28. hebasto commented at 4:29 PM on October 2, 2026: member

    ACK b6eebe027eb59a7cafc3814b48658708bbc4b8e2.

  29. DrahtBot requested review from ViniciusCestarii on Oct 2, 2026
  30. DrahtBot requested review from hodlinator on Oct 2, 2026
  31. Revert "build: check for SetThreadDescription() at configure time"
    This reverts commit bed46bd16c2b34eec62849b96cebbbdbcdd2c1ac.
    8073ff101f
  32. doc: document mingw-w64 requirement in Windows build docs cd7605a6b7
  33. nix: drop MSVCRT build 1c96b08cb6
  34. in contrib/devtools/shell-win64-cross.nix:12 in b6eebe027e
      13 | -    then pkgs.pkgsCross.ucrt64
      14 | -    else if host == "x86_64-w64-mingw32"
      15 | -      then pkgs.pkgsCross.mingwW64
      16 | -      else throw "Unsupported HOST: ${host}";
      17 | +  baseCrossPkgs = pkgs.pkgsCross.ucrt64;
      18 |    crossPkgs = baseCrossPkgs.extend (_: _: {
    


    willcl-ark commented at 9:02 PM on October 2, 2026:

    In b6eebe027eb59a7cafc3814b48658708bbc4b8e2

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

      crossPkgs = pkgs.pkgsCross.ucrt64.extend (_: _: {
    

    fanquake commented at 10:12 AM on October 3, 2026:

    Thanks, taken.

  35. fanquake force-pushed on Oct 3, 2026
  36. DrahtBot added the label CI failed on Oct 3, 2026
  37. DrahtBot removed the label CI failed on Oct 3, 2026
  38. willcl-ark approved
  39. willcl-ark commented at 9:19 AM on October 5, 2026: member

    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.
  40. DrahtBot requested review from hebasto on Oct 5, 2026
  41. hebasto approved
  42. hebasto commented at 7:03 AM on October 11, 2026: member

    re-ACK 1c96b08cb60bee930ed390de019a2cf943445ef5.

  43. hebasto merged this on Oct 11, 2026
  44. hebasto closed this on Oct 11, 2026

  45. fanquake deleted the branch on Oct 11, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-10-11 10:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me