build: merge TrackMemory (CURLDEBUG) into debug-enabled option

Drop separate `TrackMemory` (aka `CURLDEBUG`) debug feature.

After recent changes (thread-safety,
193cb00ce9, and updates leading up to
it), `TrackMemory` is unlikely to cause build or runtime issues.

To simplify builds and debug options, enable `TrackMemory`
unconditionally for debug-enabled (aka `DEBUGBUILD`) builds. Before
this 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 59dc9f7e69 (2024-05-28) fixed it.

This patch also removes/deprecates separate knobs and feature flags for
`TrackMemory`:
- autotools: `--enable-curldebug`/`--disable-curldebug`
- cmake: `-DENABLE_CURLDEBUG=ON`/`OFF`
- C macro: `CURLDEBUG`
- libcurl: `CURL_VERSION_CURLDEBUG` symbol deprecated in favor
  of `CURL_VERSION_DEBUG`. They always return the same value after this
  patch.

Also:
- drop `TrackMemory` from `curl -V` output.
- rename internal `CURLDEBUG` macro to `CURL_MEMDEBUG` internally.
  To avoid confusion with `DEBUGBUILD`, but to keep guarding
  `TrackMemory`-related internals for readability.
- runtests: bind `TrackMemory` to debug feature. Keep it a separate
  test feature requirement, for clarity.
- CI: drop test builds for combinations of the two options.
- GHA/linux: no longer disable TrackMemory in the TSAN job.

Ref: https://github.com/curl/curl/pull/20328#issuecomment-3754528407

Closes #20331
This commit is contained in:
Viktor Szakats 2026-01-15 14:04:05 +01:00
parent 0002184015
commit 2d5a063121
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
35 changed files with 58 additions and 146 deletions

View file

@ -101,56 +101,6 @@ AS_HELP_STRING([--disable-ares],[Disable c-ares for DNS lookups]),
])
dnl CURL_CHECK_OPTION_CURLDEBUG
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-curldebug or --disable-curldebug, and set
dnl shell variable want_curldebug value as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_CURLDEBUG], [
AC_MSG_CHECKING([whether to enable curl debug memory tracking])
OPT_CURLDEBUG_BUILD="default"
AC_ARG_ENABLE(curldebug,
AS_HELP_STRING([--enable-curldebug],[Enable curl debug memory tracking])
AS_HELP_STRING([--disable-curldebug],[Disable curl debug memory tracking]),
OPT_CURLDEBUG_BUILD=$enableval)
case "$OPT_CURLDEBUG_BUILD" in
no)
dnl --disable-curldebug option used
want_curldebug="no"
AC_MSG_RESULT([no])
;;
default)
dnl configure's curldebug option not specified. Initially we will
dnl handle this as a request to use the same setting as option
dnl --enable-debug. IOW, initially, for debug-enabled builds
dnl this will be handled as a request to enable curldebug if
dnl possible, and for debug-disabled builds this will be handled
dnl as a request to disable curldebug.
if test "$want_debug" = "yes"; then
AC_MSG_RESULT([(assumed) yes])
else
AC_MSG_RESULT([no])
fi
want_curldebug_assumed="yes"
want_curldebug="$want_debug"
;;
*)
dnl --enable-curldebug option used.
dnl The use of this option value is a request to enable curl's
dnl debug memory tracking for the libcurl library. This can only
dnl be done when some requisites are simultaneously satisfied.
dnl Later on, these requisites are verified and if they are not
dnl fully satisfied the option will be ignored and act as if
dnl --disable-curldebug had been given setting shell variable
dnl want_curldebug to 'no'.
want_curldebug="yes"
AC_MSG_RESULT([yes])
;;
esac
])
dnl CURL_CHECK_OPTION_DEBUG
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
@ -159,7 +109,6 @@ dnl variable want_debug value as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_DEBUG], [
AC_BEFORE([$0],[CURL_CHECK_OPTION_WARNINGS])dnl
AC_BEFORE([$0],[CURL_CHECK_OPTION_CURLDEBUG])dnl
AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
AC_MSG_CHECKING([whether to enable debug build options])
OPT_DEBUG_BUILD="default"