windows: Thread model mismatch between Guix builds and CI #36314

issue hebasto opened this issue on September 22, 2026
  1. hebasto commented at 3:41 PM on September 22, 2026: member

    The contrib/devtools/shell-win64-cross.nix script used in CI builds a GCC cross-compiler configured with --enable-threads=mcf:

    $ NIX_BUILD_SHELL=bash HOST=x86_64-w64-mingw32ucrt nix-shell contrib/devtools/shell-win64-cross.nix
    $ $CXX -v
    Using built-in specs.
    COLLECT_GCC=/nix/store/i67bfgf5xy32wzh6cck9jpxcjkvnq9k5-x86_64-w64-mingw32-gcc-14.3.0/bin/x86_64-w64-mingw32-g++
    COLLECT_LTO_WRAPPER=/nix/store/i67bfgf5xy32wzh6cck9jpxcjkvnq9k5-x86_64-w64-mingw32-gcc-14.3.0/libexec/gcc/x86_64-w64-mingw32/14.3.0/lto-wrapper
    Target: x86_64-w64-mingw32
    Configured with: ../gcc-14.3.0/configure --prefix=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-x86_64-w64-mingw32-gcc-14.3.0 --with-gmp-include=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-gmp-with-cxx-6.3.0-dev/include --with-gmp-lib=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-gmp-with-cxx-6.3.0/lib --with-mpfr-include=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-mpfr-4.2.2-dev/include --with-mpfr-lib=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-mpfr-4.2.2/lib --with-mpc=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-libmpc-1.4.0 --with-native-system-header-dir=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-mingw-w64-x86_64-w64-mingw32-13.0.0-dev/include --with-build-sysroot=/ --with-gxx-include-dir=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-x86_64-w64-mingw32-gcc-14.3.0/include/c++/14.3.0/ --program-prefix=x86_64-w64-mingw32- --enable-lto --disable-libstdcxx-pch --without-included-gettext --with-system-zlib --enable-static --enable-languages=c,c++ --disable-multilib --enable-plugin --with-isl=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-isl-0.20 --with-as=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-x86_64-w64-mingw32-binutils-wrapper-2.46/bin/x86_64-w64-mingw32-as --with-headers=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-mingw-w64-x86_64-w64-mingw32-13.0.0-dev/include --enable-__cxa_atexit --enable-long-long --enable-threads=mcf --enable-nls --disable-bootstrap --enable-default-pie --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-w64-mingw32
    Thread model: mcf
    Supported LTO compression algorithms: zlib
    gcc version 14.3.0 (GCC) 
    
    

    The Guix release builds, however, use a GCC configured with the posix thread model.

    Therefore, the CI jobs exercise a toolchain whose threading differs from the one used for release binaries. This reduces the value of the Windows cross-compilation CI jobs.

    Somewhat related: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1054148.

  2. hebasto added the label Windows on Sep 22, 2026
  3. maflcko added the label Build system on Sep 22, 2026
  4. maflcko commented at 3:54 PM on September 22, 2026: member

    GCC is being built from source anyway, IIRC, according to #35877 (review)

    So if this is important, it may be possible to configure GCC with the thread model that is configured by the Guix release builds.

  5. willcl-ark commented at 3:55 PM on September 22, 2026: member

    GCC is being built from source

    Correct, we can change the thread model here

  6. Prachi01Yadav commented at 3:58 PM on September 22, 2026: none

    Hi @hebasto @willcl-ark , I would like to work on fixing this mismatch.

    To align the environments, would the preferred approach be to override the Nix derivation in contrib/devtools/shell-win64-cross.nix to enforce the posix thread model so it matches our current Guix releases? Or is there an active plan to migrate the Guix builds to use the newer mcf thread model instead?

    Let me know which direction is preferred and I can start researching the implementation for the fix!

  7. hebasto commented at 4:01 PM on September 22, 2026: member

    So if this is important...

    I believe it is.

  8. maflcko commented at 4:02 PM on September 22, 2026: member

    Ok, I was thinking that there is no relevant end-user visible behavior change, and this is mostly a style/consistency cleanup.

  9. willcl-ark commented at 4:03 PM on September 22, 2026: member

    I'm pretty sure we can ~ trivially override with:

    diff --git a/contrib/devtools/shell-win64-cross.nix b/contrib/devtools/shell-win64-cross.nix
    index 4fd83b0da7a..2c81e7e7555 100644
    --- a/contrib/devtools/shell-win64-cross.nix
    +++ b/contrib/devtools/shell-win64-cross.nix
    @@ -16,11 +16,20 @@ let
           else throw "Unsupported HOST: ${host}";
       toolchain = crossPkgs.stdenv.cc.targetPrefix;
       pthreads = crossPkgs.windows.pthreads;
    +  gcc = crossPkgs.wrapCCWith {
    +    cc = crossPkgs.gcc14.cc.override {
    +      threadsCross = {
    +        model = "posix"; # match Guix release binaries
    +        package = null; # don't add mcfgthread when using posix thread model
    +      };
    +    };
    +    extraPackages = [ ];
    +  };
     in
     
     pkgs.mkShellNoCC {
       packages = [
    -    crossPkgs.gcc14
    +    gcc
         pkgs.nsis
       ];
    

    But waiting for a build to finish to confirm.


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-09-23 05:51 UTC

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