Skip to content

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

Closed

Description

@hebasto

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 96d2380 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.

Activity

  1. davidgumberg commented on Sep 2, 2026

    @davidgumberg
    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.

  2. stickies-v commented on Sep 3, 2026

    @stickies-v
    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.

  3. maflcko commented on Sep 19, 2026

    @maflcko
    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 https://github.com/bitcoin/bitcoin/issues/36153

    (or so)

  4. maflcko commented on Sep 24, 2026

    @maflcko
    Member
  5. maflcko commented on Sep 29, 2026

    @maflcko
    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.

  6. added this to the 33.0 milestone on Oct 6, 2026
  7. fanquake commented on Oct 8, 2026

    @fanquake
    Member

    More Windows/MSVC bugs in #36451.

  8. hebasto commented on Oct 14, 2026

    @hebasto
    MemberAuthor

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

    Linked.

  9. theuni commented on Oct 15, 2026

    @theuni
    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.

  10. maflcko commented on Oct 15, 2026

    @maflcko
    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 (#31507 (comment)). 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.

  11. hebasto commented on Oct 16, 2026

    @hebasto
    MemberAuthor

    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 hebasto/bitcoin-core-nightly#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.

  12. added a commit that references this issue on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions