ci: use POSIX threads for Nix Windows builds #36316

pull willcl-ark wants to merge 2 commits into bitcoin:master from willcl-ark:win-cross-threads changing 2 files +30 −9
  1. willcl-ark commented at 4:18 PM on September 22, 2026: member

    Guix release binaries use GCC’s POSIX thread model, while the pinned Nixpkgs toolchain defaults to mcf. This makes POSIX the default for Nix Windows cross builds. Nightly builds can select mcf or win32 with the threadModel argument.

    The Nixpkgs threads setting selects the model before GCC is built. Only the mcf model pulls in mcfgthreads. For POSIX, GCC’s target libraries need winpthreads headers and libraries during the compiler build. The EXTRA_*_FOR_TARGET flags provide those paths without exposing target headers to GCC’s native build tools, which caused the earlier build failure.

    The compiler wrapper includes winpthreads through extraPackages, so the shell no longer needs to export pthread include and library flags manually. CI also prints GCC’s configured thread model to make mismatches visible.

    Fixes #36314

  2. DrahtBot added the label Tests on Sep 22, 2026
  3. DrahtBot commented at 4:18 PM on September 22, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36316.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    Concept ACK hebasto

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

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

    Added a second commit we may want to drop to print/verify first in the CI run.

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

    Concept ACK.

    3edcc510370c7fd804060960a0a5e16bbe356c96

    Could we make the thread model configurable? This would help with testing MCF in nightly builds.

  6. DrahtBot added the label CI failed on Sep 22, 2026
  7. DrahtBot commented at 5:28 PM on September 22, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task lint: https://github.com/bitcoin/bitcoin/actions/runs/35753251918/job/106832510905</sub> <sub>LLM reason (✨ experimental): CI failed because the shell lint step (shellcheck) reported SC2016 in ci/test/01_base_install.sh line 55 (expressions inside single quotes).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  8. willcl-ark force-pushed on Sep 22, 2026
  9. ci: configure Nix Windows cross compiler threads
    Default to POSIX threads to match Guix release binaries, while allowing
    nightlies to select mcf or win32 via threadModel. Only mcf should pull in
    mcfgthreads.
    
    The POSIX GCC build needs winpthreads headers and libraries for its
    target libraries. Pass their paths via EXTRA_*_FOR_TARGET so native GCC
    build tools do not see target headers. Adding winpthreads as a target
    dependency instead exposed those headers to native tools and broke the
    compiler build.
    
    Add winpthreads to the POSIX compiler wrapper extraPackages so the Nix
    shell supplies its include and library paths automatically. This removes
    the need for manual NIX_CFLAGS_COMPILE and NIX_LDFLAGS exports.
    0600aa0f03
  10. ci: print Windows cross compiler details
    Show the compiler version and configured thread model while initializing
    the Nix Windows cross-compilation environment.
    903d6d3eb9
  11. willcl-ark force-pushed on Sep 22, 2026
  12. willcl-ark commented at 10:22 PM on September 22, 2026: member

    Could we make the thread model configurable? This would help with testing MCF in nightly builds.

    I’ve made the thread model configurable through a Nix argument. e.g. to test mcf:

    HOST=x86_64-w64-mingw32ucrt nix-shell contrib/devtools/shell-win64-cross.nix --argstr threadModel mcf
    
  13. DrahtBot removed the label CI failed on Sep 22, 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-09-23 06:50 UTC

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