build: Add Windows MSYS2 build support & build guide #35421

pull quadcpu wants to merge 2 commits into bitcoin:master from quadcpu:msys2 changing 6 files +565 −1
  1. quadcpu commented at 6:21 PM on May 30, 2026: none

    This PR shall add MSYS2 build environment support using UCRT64 GNU toolchains ( including cmake and ninja ).

    It is already specified that MSYS2 build "might work" on doc/build-windows.md however in order to build some patch with ./depends and ./cmake scripts was inevitable due to difference with Windows and Unix's file path, and it shall add MSYS_STAGING=1 env to tell those scripts to parse native windows file path correctly and thus it is possible to build bitcoin repo cloned on somewhere like C:\Users\UserName\Desktop\bitcoin , etc.

    doc/build-windows-msys2.md is for the guide of how to do it, including building nsis installer and zip archives that would be produced with guix build.

    The document guide added is very hacky ( since I am not a native english speaker ), so I would ask any maintainer or anyone patching it with friendly english guide as well.

  2. Add msys2 native build support 63a5814ecb
  3. Update .gitignore 8a87f5259f
  4. DrahtBot added the label Build system on May 30, 2026
  5. DrahtBot commented at 6:21 PM on May 30, 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/35421.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  6. willcl-ark commented at 6:26 PM on May 30, 2026: member

    this seems very hacky and niche. is this more or less popular than wsl?

    why would we want to support this?

  7. quadcpu commented at 6:38 PM on May 30, 2026: none

    Hello @willcl-ark, WSL is still VM based build, and MSYS2 runs on native-like environment with native Windows path support which means you don't need to move around to VM to debug and edit source code on both locations.

    And yeah MSYS2 is far from niche, it is built in with Github Actions on windows-latest env, and it should be able to support any GCC compile jobs while WSL would stall on some jobs ( yes, WSL is still buggy with my experience )

  8. sedited commented at 7:32 PM on May 30, 2026: contributor

    The bottleneck for this project is pull request review. This seems to be the first PR for introducing support for this toolchain, which indicates that there is little active demand for it. People interested in building Bitcoin Core natively on windows use msvc. Given this I don't think this will receive the review required in order to be merged soon. The change also includes build system changes that should probably be tested by CI in order to catch regressions. Due to these costs and apparent low demand, I don't think we should add support for this.

  9. quadcpu commented at 8:04 PM on May 30, 2026: none

    which indicates that there is little active demand for it @sedited Good point because even if it comes with msvc or wsl only a little people would be using it since you would be already using Unix not Windows in order to compile this project ( cause every toolchain including msvc, mingw-w64, MSYS2, or even WSL have active issues )

    in order to catch regressions

    There is a reason that this patch to fix windows file paths to something that gcc or cmake to understand are gated with MSYS_STAGING env is to avoid such issues, and I think it is safe code as it is gated already.

    If we want, we could add another workflow to test MSYS2 builds on windows-latest env but I think we wouldn't need it, as this patch would only touch very minimal changes with depends scripts or nsis scripts which isn't very core scripts to bitcoin,

    This patch is still for convenience to use open-source toolchains like MSYS2 or GCC instead of using MS's MSVC. From time to time there would be limitations where MSVC wouldn't support every C++ code that GCC supports ( which happens with some popular libraries like libmdbx ), so I think this is long term good goal to achieve.


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-05-31 17:50 UTC

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