build: merge TrackMemory (CURLDEBUG) into debug-enabled option#20331
build: merge TrackMemory (CURLDEBUG) into debug-enabled option#20331vszakats wants to merge 29 commits intocurl:masterfrom
CURLDEBUG) into debug-enabled option#20331Conversation
No, please don't!
|
I'm confused, what else does it do? It's controlling the memtrack (we can name it anything, again, I just don't see why this is critical, |
|
That is |
Then I am confused now. What is this PR doing? I thought it made two defines into one, and then rename that single one? |
Ah OK, sorry! It keeps The only reason to keep it internally under a separate macro, is to help us locate It also merges the 'TrackMemory' feature into 'Debug' in build tooling and -V |
Why do we need more than one define if they are in sync? |
Because TrackMemory is a distinct feature internally, and |
|
So a |
Yes, works for me. Will push it shortly. edit: GH seems to have an ongoing CI job status refresh issue. |
CURLDEBUG into DEBUGBUILDCURLDEBUG option into DEBUGBUILD
There was a problem hiding this comment.
Pull request overview
This pull request merges the separate CURLDEBUG (TrackMemory) option into DEBUGBUILD, making memory tracking always enabled in debug builds. The main purpose is to simplify the build configuration by eliminating the separate toggle for memory debugging features.
Changes:
- Removed the
CURLDEBUGconditional compilation flag from all Makefiles and build systems - Renamed the internal
CURLDEBUGmacro toCURL_MEMDEBUGthroughout the codebase for clarity - Deprecated the public
CURL_VERSION_CURLDEBUGflag and removed TrackMemory from feature lists
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/Makefile.am | Removed CURLDEBUG conditional compilation flag |
| tests/tunit/Makefile.am | Removed CURLDEBUG conditional compilation flag |
| tests/runtests.pl | Updated TrackMemory detection to use Debug feature instead |
| tests/libtest/first.c | Renamed CURLDEBUG to CURL_MEMDEBUG |
| tests/libtest/Makefile.am | Removed CURLDEBUG conditional compilation flag |
| src/tool_main.c | Renamed CURLDEBUG to CURL_MEMDEBUG |
| src/tool_libinfo.c | Removed TrackMemory from feature list |
| src/curlinfo.c | Renamed CURLDEBUG to CURL_MEMDEBUG |
| src/curl.rc | Removed CURLDEBUG from debug flags check |
| src/Makefile.am | Removed CURLDEBUG conditional compilation flag |
| projects/OS400/curl.inc.in | Marked CURL_VERSION_CURLDEBUG as deprecated |
| m4/curl-confopts.m4 | Removed CURL_CHECK_OPTION_CURLDEBUG macro definition |
| lib/version.c | Removed TrackMemory feature entry |
| lib/memdebug.c | Renamed CURLDEBUG to CURL_MEMDEBUG |
| lib/libcurl.rc | Removed CURLDEBUG from debug flags check |
| lib/fake_addrinfo.h | Renamed CURLDEBUG to CURL_MEMDEBUG |
| lib/curlx/fopen.h | Renamed CURLDEBUG to CURL_MEMDEBUG |
| lib/curlx/fopen.c | Renamed CURLDEBUG to CURL_MEMDEBUG |
| lib/curl_setup.h | Added CURL_MEMDEBUG definition when DEBUGBUILD is set and renamed all CURLDEBUG references |
| lib/curl_addrinfo.h | Renamed CURLDEBUG to CURL_MEMDEBUG |
| lib/curl_addrinfo.c | Renamed CURLDEBUG to CURL_MEMDEBUG |
| lib/Makefile.am | Removed CURLDEBUG conditional compilation flag |
| include/curl/curl.h | Marked CURL_VERSION_CURLDEBUG as deprecated in documentation |
| docs/tests/TEST-SUITE.md | Updated documentation to reference DEBUGBUILD instead of CURLDEBUG |
| docs/libcurl/symbols-in-versions | Added deprecation version 8.19.0 for CURL_VERSION_CURLDEBUG |
| docs/libcurl/curl_version_info.md | Moved TrackMemory to deprecated section and updated description |
| docs/cmdline-opts/version.md | Removed TrackMemory from feature documentation |
| docs/INSTALL-CMAKE.md | Removed ENABLE_CURLDEBUG option documentation and updated libbacktrace documentation |
| configure.ac | Removed CURLDEBUG configuration checks |
| appveyor.yml | Updated test job names and removed separate CURLDEBUG toggles |
| appveyor.sh | Removed CURLDEBUG CMake option |
| CMakeLists.txt | Removed ENABLE_CURLDEBUG option and updated libbacktrace checks |
| CMake/CurlSymbolHiding.cmake | Removed ENABLE_CURLDEBUG from condition |
| .github/workflows/windows.yml | Removed ENABLE_CURLDEBUG and --disable-curldebug flags |
| .github/workflows/linux.yml | Removed ENABLE_CURLDEBUG flag from TSAN job |
Comments suppressed due to low confidence (1)
lib/version.c:461
- The CURL_VERSION_CURLDEBUG flag is not being set when DEBUGBUILD is enabled. According to the PR description and the documentation update in docs/libcurl/curl_version_info.md (line 383-384), CURL_VERSION_CURLDEBUG should now 'Always the same as CURL_VERSION_DEBUG since 8.19.0'. The bitmask should include both flags for backward compatibility. Change the bitmask to:
CURL_VERSION_DEBUG | CURL_VERSION_CURLDEBUG
FEATURE("Debug", NULL, CURL_VERSION_DEBUG),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CURLDEBUG option into DEBUGBUILDCURLDEBUG) option into debug-enabled builds
CURLDEBUG) option into debug-enabled buildsCURLDEBUG) into debug-enabled option
appveyor.yml say !DEBUGBUILD in existing job appveyor.yml drop another CURLDEBUG tweak
Drop separate
TrackMemory(akaCURLDEBUG) debug feature.After recent changes (thread-safety,
193cb00, and updates leading up to
it),
TrackMemoryis unlikely to cause build or runtime issues.To simplify builds and debug options, enable
TrackMemoryunconditionally for debug-enabled (aka
DEBUGBUILD) builds. Beforethis patch, this was already the default, with an option to disable
it, or enable it in non-debug-enabled builds.
Note, in practice these two debug options already went hand in hand. It
was not possible to toggle them separately for a long time due to bugs,
before 59dc9f7 (2024-05-28) fixed it.
This patch also removes/deprecates separate knobs and feature flags for
TrackMemory:--enable-curldebug/--disable-curldebug-DENABLE_CURLDEBUG=ON/OFFCURLDEBUGCURL_VERSION_CURLDEBUGsymbol deprecated in favorof
CURL_VERSION_DEBUG. They always return the same value after thispatch.
Also:
TrackMemoryfromcurl -Voutput.CURLDEBUGmacro toCURL_MEMDEBUGinternally.To avoid confusion with
DEBUGBUILD, but to keep guardingTrackMemory-related internals for readability.TrackMemoryto debug feature. Keep it a separatetest feature requirement, for clarity.
Ref: #20328 (comment)
--enable-curldebug/--disable-curldebugas a no-op.For compatibility. → No need, by default there is just a warning shown. Only
--enable-option-checking=fatalmakes it an error.