RFC: Drop MSVC as a supported compiler on Windows (keep clang-cl) #36153

issue hebasto opened this issue on September 2, 2026
  1. hebasto commented at 8:50 PM on September 2, 2026: member

    This continues the 2026-08-13 IRC meeting discussion.

    Proposal

    Stop supporting MSVC (cl.exe). Native Windows builds use clang-cl.exe (#31507). Release binaries are unaffected (mingw-w64 cross-compile in Guix).

    Motivation

    • MSVC is the only compiler we use that we cannot fix: no upstream patches, ineffective bug reporting. Also see historical ICE workarounds.
    • As far as we know, every MSVC-specific issue found so far has been a compiler bug, not a codebase bug. More of them are expected as we adopt C++23/26.
    • Windows keeps two toolchains (mingw-w64 cross, clang-cl native); CI job count unchanged.
    • clang-cl still uses the MS STL, so standard-library diversity is retained.

    The only drawback is reduced compiler diversity in what the codebase is built and tested against.

    What changes (commit 96d2380dc40e703e342dc0fad5d294cc49b25ff9 in #31507)

    Removed: MSVC CI jobs; MSVC docs; MSVC-specific CMake flags and diagnostics.

    Kept: CMake does not reject MSVC; source-level _MSC_VER guards (shared with clang-cl).

    Policy: MSVC is unsupported, no CI, MSVC-only workarounds not accepted.

    #24773 will be closed, as no longer needed to fix performance issues.

    Users' perspective

    From the users' perspective, the binaries produced by MSVC are strictly inferior.

  2. hebasto added the label Build system on Sep 2, 2026
  3. hebasto added the label Windows on Sep 2, 2026
  4. hebasto added the label Brainstorming on Sep 2, 2026
  5. davidgumberg commented at 9:26 PM on September 2, 2026: contributor

    Concept ACK, just restating some of the things said on IRC: losing compiler diversity is unfortunate but given that MSVC is closed-source, gleaning information from any problems it surfaces is difficult, and their process for dealing with internal bugs is opaque.

    see e.g. #31303 and #32499 (comment) where e.g. it was not even clear what version fixed an internal issue.

  6. stickies-v commented at 7:04 AM on September 3, 2026: contributor

    Concept ACK

    It seems like MSVC is causing us a lot of overhead, and very limited actual benefits. Unless there are strong indications that MSVC is going to take a different course (e.g. becoming fully open-source, better support, ... ) in the near term (I can't find them), it seems best to drop MSVC.

    For reference, here is the relevant IRC conversation (would be useful to link in OP).

    I think it would also be useful to be explicit about what dropping support means. In my book, that means when evaluating a change, MSVC support must be discounted completely. That would also mean that PRs that remove MSVC-specific code would be equivalent to cleaning up dead code, and thus generally welcomed if people want to work on it.

  7. maflcko commented at 5:43 AM on September 19, 2026: member

    Should a short release note snippet be added to the wiki draft?

    # Build
    
    * Self-compilation on Windows with MSVC is expected to be dropped in favor of clang-cl support. See [#36153](/bitcoin-bitcoin/36153/)
    

    (or so)

  8. maflcko added the label Needs release note on Sep 19, 2026
  9. maflcko removed the label Needs release note on Sep 19, 2026
  10. maflcko commented at 9:58 AM on September 24, 2026: member

    Added the note to https://github.com/bitcoin-core/bitcoin-devwiki/wiki/32.0-Release-Notes-Draft#build-system

    (edit: feel free to remove, if this isn't needed)

  11. maflcko commented at 4:50 PM on September 29, 2026: member
    • As far as we know, every MSVC-specific issue found so far has been a compiler bug, not a codebase bug.

    IIRC there was a minor C++ compat bug, as the STL uses a smaller int size for chrono minutes: #31391 (comment). But this is just minor.

    Edit: Please ignore the comment. Clang-cl obviously still uses the STL, so nothing changes here.

  12. maflcko removed the label Brainstorming on Oct 6, 2026
  13. maflcko added this to the milestone 33.0 on Oct 6, 2026
  14. fanquake commented at 9:32 PM on October 8, 2026: member

    More Windows/MSVC bugs in #36451.

  15. hebasto commented at 5:33 AM on October 14, 2026: member

    For reference, here is the relevant IRC conversation (would be useful to link in OP).

    Linked.

  16. theuni commented at 2:32 AM on October 15, 2026: member

    Concept ACK. I've been a voice for keeping MSVC support for the sake of compiler diversity, but it's pretty clearly a net negative to support at this point. Rather than pointing out buggy code that clang/gcc wrongly allow, it's far more likely to cause us grief. All of the points listed as motivation are good and relevant imo.

  17. maflcko commented at 7:05 AM on October 15, 2026: member

    I've been a voice for keeping MSVC support for the sake of compiler diversity

    Same, but I think this is still trivially possible even after #31507. I think it just needs a minimal patch to not link the clang-rt for int128 (https://github.com/bitcoin/bitcoin/pull/31507#issuecomment-6165722953). Also, it needs a cmake preset (or similar) with the list of compile warning suppressions.

    I don't have Windows, so I can't try this, but I am confident that a modern LLM bot can keep this alive and the orange site happy. (Ref: https://news.ycombinator.com/item?id=36436113 [Microsoft uses Bitcoin as part of MSVC validation test suite ])

    This way, anyone can use Bitcoin Core code to find bugs in their compiler, but in the rare case that a bug is in Bitcoin Core, it is still possible to find and fix on our side.

  18. hebasto commented at 12:35 AM on October 16, 2026: member

    I've been a voice for keeping MSVC support for the sake of compiler diversity

    Same, but I think this is still trivially possible even after #31507.

    See https://github.com/hebasto/bitcoin-core-nightly/pull/395.

    I think it just needs a minimal patch to not link the clang-rt for int128 (#31507 (comment)). Also, it needs a cmake preset (or similar) with the list of compile warning suppressions.

    The latter can be done via CXXFLAGS.

    Also src/test/util_not_null_tests.cpp fails to compile due to https://github.com/hebasto/bitcoin/blob/f0b38b15f2d02c886afc4266c27468622bdc4f64/src/test/util_not_null_tests.cpp#L111-L113.


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

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