Repository navigation
Conversation
|
Is there as a reason |
I took a dive into this here: #22484 (comment) In conclusion, I don't think this could work, because So, no, I don't think it would work as expected, and that it would improve |
There was a problem hiding this comment.
Pull request overview
This PR tightens curl “debug-enabled/development” builds to ensure assert()s are not disabled (i.e., prevents DEBUGBUILD being used together with NDEBUG), and updates CMake/docs/Windows CI to comply with that requirement.
Changes:
- Add a compile-time hard error when
DEBUGBUILDandNDEBUGare both defined. - Add a CMake configure-time error for common single-config non-Debug configurations when
ENABLE_DEBUG=ON. - Update CMake install docs and Windows GitHub Actions matrix entries to align with the new constraint.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/curl_setup.h | Adds a preprocessor check that forbids DEBUGBUILD + NDEBUG. |
| docs/INSTALL-CMAKE.md | Documents the build-type/configuration requirement when ENABLE_DEBUG is enabled. |
| CMakeLists.txt | Adds a configure-time guard intended to prevent debug-enabled builds with non-Debug build types. |
| .github/workflows/windows.yml | Adjusts Windows CI matrix build types/options to avoid ENABLE_DEBUG with non-Debug configs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Which "debug" is the misleading name and why? The way I see it, it is cmake that makes this really complicated not curl. |
|
Or perhaps it is the term "debug" that might mean different things to different people. |
I think most people understand it like CMake, MSBuild and I think Meson define it: built without compiler optimizations and with asserts enabled. |
Does it matter? CMake is what it is, it's a tool with things and certain expectations. Also about the names, does it matter? I believe curl how it worked before this |
They may well do, yes. I'd guess for some, it's not necessarily self-evident what each of these options mean: |
|
I don't think anyone can tell the difference between all of those without looking them up, but I also don't think anyone needs to. |
I think we all can agree to that lose definition. But if that was the completely picture, this whole line of argument wouldn't have happened... 😀 |
It certainly doesn't make it easier to have a discussion about them. |
|
We have a lot of code, names and solutions. They all need names. Some names sometimes get a little confusing and wrong and then we try fix them as we go along to maybe make it easier. I don't think the situation is particularly bad as most things are documented and can be figured out fairly easy. |
This reverts commit e27cff0. Tested OK by failing as designed: https://github.com/curl/curl/actions/runs/31159628749/job/92807878479?pr=22513
To prevent creating a curl-development (aka debug-enabled, aka
-DENABLE_DEBUG=ON,--enable-debugorDEBUGBUILD) build withoutassert()s. Since it may break expectations by missing to catch errorcases. Also to make it less likely to build an inherently insecure
development build by accident.
in CMake, for non-Multi-Config builds, show this error unless Debug
configuration is set at configure-time:
Ref: https://github.com/curl/curl/actions/runs/31159065911/job/92805128331?pr=22513#step:6:56
The other 3 predefined configs (
Release,RelWithDebInfo,MinSizeRel) setNDEBUGautomatically.or this message in other cases, e.g. when using CMake Multi-Config
with non-Debug, e.g.
--config Release, or passedNDEBUGmanuallywith either build tools:
Ref: https://github.com/curl/curl/actions/runs/31159628749/job/92807878479#step:9:28
Also:
missing.
Reported-by Stefan Eissing
Bug: #22484 (comment)
Ref: ea98445 #13592
Fixes #22481
Fixes #22484
Multi-Config tested OK (to fail by design) here: https://github.com/curl/curl/actions/runs/31159628749/job/92807878479?pr=22513