build: explicitly disable cl.exe #36839

Open
bartoli wants to merge 1 commit from disable_cl_cmake into master AGit
bartoli commented 2026-11-11 18:09:51 +00:00 (Migrated from github.com)

Since 4f1e6de6 (https://github.com/bitcoin/bitcoin/pull/31507), cmake for visual studio can only generate projects that use clang-cl.
But calling cmake without '--preset windows' or '-T ClangCL' still silently generates projects that cannot build anymore.

For example, a build with cl now fails in minisketchwrapper.c because we don't pass anymore a cl option to set __cplusplus value properly.

I propose we explicitly tell at cmake time that this can't work anymore. If not, a lot of windows devs who use cmake without presets will lose time on this.

Since 4f1e6de6 (https://github.com/bitcoin/bitcoin/pull/31507), cmake for visual studio can only generate projects that use clang-cl. But calling cmake without '--preset windows' or '-T ClangCL' still silently generates projects that cannot build anymore. For example, a build with cl now fails in minisketchwrapper.c because we don't pass anymore a cl option to set __cplusplus value properly. I propose we explicitly tell at cmake time that this can't work anymore. If not, a lot of windows devs who use cmake without presets will lose time on this.
DrahtBot commented 2026-11-11 18:10:01 +00:00 (Migrated from github.com)

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

External sites

Reviews

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36033 ([wip,nomerge,rfc] build: Require C++23 compiler by maflcko)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36839 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36839.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36839#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. A summary of reviews will appear here. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36033](https://github.com/bitcoin/bitcoin/pull/36033) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36033.svg"></sub> ([wip,nomerge,rfc] build: Require C++23 compiler by maflcko) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

🔵 Suggestion · The cl.exe rejection does not identify the supported toolset

The linked documentation offers preset-based recovery, but neither the error nor its linked Building section names the clang-cl requirement, leaving developers retaining a non-preset configuration to infer the necessary compiler change.

Location: CMakeLists.txt:86 (head).

Review coverage was incomplete.


Reviewed: eca1492f5919 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:f3e06854f254c480580a263b00f5c6aaa804717e751da362d6c3a17a8fae78d3:eaa37ea1cdada8fdd806ab11180fd9e0f01062422d9d8c5ea7dcfd80d5014b95 --> <!-- ralph-base:a06515e9fdf81a762804471733b1f43a13e1f10b --> <!-- ralph-head:eca1492f591982e6914425175e78176d9706019c --> <!-- ralph-case:44af0d3d6e23c2cb44cb69e13f8ab0915b79ee21278edc30d83df7632e993914 --> **🔵 Suggestion · The cl.exe rejection does not identify the supported toolset** The linked documentation offers preset-based recovery, but neither the error nor its linked Building section names the clang-cl requirement, leaving developers retaining a non-preset configuration to infer the necessary compiler change. Location: [`CMakeLists.txt:86`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/eca1492f591982e6914425175e78176d9706019c/CMakeLists.txt#L86>) (head). Review coverage was incomplete. <!-- Review tier: standard --> --- Reviewed: [`eca1492f5919`](<https://git.fish.foo/bitcoin/bitcoin/commit/eca1492f591982e6914425175e78176d9706019c>) · [Review report](<https://review.fish.foo/report/36839-eca1492f591982e6914425175e78176d9706019c-2577-5.html>) · [Previous reports](<https://review.fish.foo/traces/36839/>) [permalink](<https://review.fish.foo/report/36839-eca1492f591982e6914425175e78176d9706019c-2577-5.html>)
maflcko (Migrated from github.com) reviewed 2026-11-12 10:24:28 +00:00
maflcko (Migrated from github.com) commented 2026-11-12 10:24:28 +00:00

could link to the build docs here, similar to how cmake/module/CheckCXXFeatures.cmake does it?

could link to the build docs here, similar to how cmake/module/CheckCXXFeatures.cmake does it?
hebasto (Migrated from github.com) reviewed 2026-11-12 10:46:06 +00:00
hebasto (Migrated from github.com) left a comment

I'm not opposed to this change. However, I do have some concerns.

I propose we explicitly tell at cmake time that this can't work anymore.

There are compilers we do not support, yet none of them is explicitly banned. Banning one would make it harder for someone to experiment with it.

FWIW, there is a nightly build that uses cl.exe.

If not, a lot of windows devs who use cmake without presets will lose time on this.

The documentation should help.

Anyway, I wouldn't want to put Windows devs off merely for the reasons I stated above.

I'm not opposed to this change. However, I do have some concerns. > I propose we explicitly tell at cmake time that this can't work anymore. There are compilers we do not support, yet none of them is explicitly banned. Banning one would make it harder for someone to experiment with it. FWIW, there is a nightly [build](https://github.com/hebasto/bitcoin-core-nightly#windows-native-builds) that uses `cl.exe`. > If not, a lot of windows devs who use cmake without presets will lose time on this. The documentation should help. Anyway, I wouldn't want to put Windows devs off merely for the reasons I stated above.
maflcko commented 2026-11-12 10:53:31 +00:00 (Migrated from github.com)

If not, a lot of windows devs who use cmake without presets will lose time on this.

The documentation should help.

In theory, it could be a warning that the compiler is not supported (link to docs) and should only be used at their own risk? However, I am not sure if someone not reading the docs to start will read the warning.

> > If not, a lot of windows devs who use cmake without presets will lose time on this. > > The documentation should help. In theory, it could be a warning that the compiler is not supported (link to docs) and should only be used at their own risk? However, I am not sure if someone not reading the docs to start will read the warning.
bartoli commented 2026-11-12 11:37:20 +00:00 (Migrated from github.com)

If not, a lot of windows devs who use cmake without presets will lose time on this.

The documentation should help.

In theory, it could be a warning that the compiler is not supported (link to docs) and should only be used at their own risk? However, I am not sure if someone not reading the docs to start will read the warning.

Well, i was not thinking about someone setting up a new build environement; that person should read the doc indeed. But about the devs that already have a custom build env, and will not read the doc at each pull

FWIW, there is a nightly build that uses cl.exe.

It seems they added patches to workaround the change in the main repo : github.com/hebasto/bitcoin-core-nightly@727b9af3e2

> > > If not, a lot of windows devs who use cmake without presets will lose time on this. > > > > > > The documentation should help. > > In theory, it could be a warning that the compiler is not supported (link to docs) and should only be used at their own risk? However, I am not sure if someone not reading the docs to start will read the warning. Well, i was not thinking about someone setting up a new build environement; that person should read the doc indeed. But about the devs that already have a custom build env, and will not read the doc at each pull > FWIW, there is a nightly [build](https://github.com/hebasto/bitcoin-core-nightly#windows-native-builds) that uses `cl.exe`. It seems they added patches to workaround the change in the main repo : https://github.com/hebasto/bitcoin-core-nightly/commit/727b9af3e2eb0bffb468e62b217c2f5296bd1690
bartoli (Migrated from github.com) reviewed 2026-11-12 12:14:11 +00:00
bartoli (Migrated from github.com) commented 2026-11-12 12:14:11 +00:00

I updated the message to point to the doc instead of manually listing cmake options

I updated the message to point to the doc instead of manually listing cmake options
maflcko (Migrated from github.com) reviewed 2026-11-12 12:33:19 +00:00
maflcko (Migrated from github.com) commented 2026-11-12 12:33:19 +00:00
  "See the recommended doc/build-windows-native.md#building or remove this check and continue at your own risk without support.")

nit: I guess this option is obvious, but it could make sense to spell it out, given that some do that experimentally. But no strong opinion.

```suggestion "See the recommended doc/build-windows-native.md#building or remove this check and continue at your own risk without support.") ``` nit: I guess this option is obvious, but it could make sense to spell it out, given that some do that experimentally. But no strong opinion.
bartoli (Migrated from github.com) reviewed 2026-11-12 12:55:24 +00:00
bartoli (Migrated from github.com) commented 2026-11-12 12:55:24 +00:00

That makes sense, thanks

That makes sense, thanks
fanquake commented 2026-12-01 14:20:52 +00:00 (Migrated from github.com)

What is the status here? A number of comments but no actual Concept/Approach indication?

What is the status here? A number of comments but no actual Concept/Approach indication?
maflcko commented 2026-12-01 15:22:51 +00:00 (Migrated from github.com)

I think it is fine to print this error for people who run into this, but I am not sure how common such a setup without the presets is.

Would be good to have the Windows reviewers give a look here.

I think it is fine to print this error for people who run into this, but I am not sure how common such a setup without the presets is. Would be good to have the Windows reviewers give a look here.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36839
No description provided.