]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests/server: drop memdebug option
authorViktor Szakats <commit@vsz.me>
Sun, 15 Jun 2025 21:28:08 +0000 (23:28 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 15 Jun 2025 23:27:46 +0000 (01:27 +0200)
I added it just in case when removing enabled-by-default memdebug
from test servers. Apparently it broke after recent changes. It's
probably not a widely used feature and does not seem to be worth fixing.
It creates odd dependencies as the error message indicates:

```
[28/54] Building C object tests/server/CMakeFiles/servers.dir/__/__/lib/memdebug.c.obj
FAILED: tests/server/CMakeFiles/servers.dir/__/__/lib/memdebug.c.obj
[...]
lib/memdebug.c: In function 'curl_dbg_log':
lib/memdebug.c:465:12: error: implicit declaration of function 'mvsnprintf'; did you mean 'vsnprintf'? [-Wimplicit-function-declaration]
  465 |   nchars = mvsnprintf(buf, sizeof(buf), format, ap);
      |            ^~~~~~~~~~
      |            vsnprintf
lib/memdebug.c:465:12: warning: nested extern declaration of 'mvsnprintf' [-Wnested-externs]
```

This patch is dropping these build options:
- cmake: `ENABLE_SERVER_DEBUG`
- autotools: `--enable-server-debug` / `--disable-server-debug`

Follow-up to a16485a42ea5dabe6c327179a1678ad04d1c6b2f #16705

Closes #17629

CMakeLists.txt
configure.ac
docs/INSTALL-CMAKE.md
tests/server/CMakeLists.txt
tests/server/Makefile.am
tests/server/Makefile.inc

index 3730488cfd93506fe5041d9a6e0b853a97755035..addc38fa3ae6aa2320c20820422a17b1db9eff34 100644 (file)
@@ -277,7 +277,6 @@ if(ENABLE_DEBUG)
   message(WARNING "This curl build is Debug-enabled and insecure, do not use in production.")
 endif()
 option(ENABLE_CURLDEBUG "Enable TrackMemory debug feature" ${ENABLE_DEBUG})
-option(ENABLE_SERVER_DEBUG "Apply curl debug options to test servers" OFF)
 
 set(CURL_DEBUG_MACROS "")
 if(ENABLE_DEBUG)
index adffb9bb5c15e65448cba178fbe312c77e425216..d17811395560914956a59e3cc33516655cb76e97 100644 (file)
@@ -579,25 +579,6 @@ case $host_os in
     ;;
 esac
 
-dnl Apply curl debug options to test servers
-OPT_SERVER_DEBUG="default"
-AC_ARG_ENABLE(server-debug,
-AS_HELP_STRING([--enable-server-debug],[Enable debug options for test servers])
-AS_HELP_STRING([--disable-server-debug],[Disable debug options for test servers]),
-OPT_SERVER_DEBUG=$enableval)
-case "$OPT_SERVER_DEBUG" in
-  no)
-    dnl --disable-server-debug option used
-    want_server_debug="no"
-    ;;
-  *)
-    dnl --enable-server-debug option used or not specified
-    want_server_debug="no"
-    ;;
-esac
-AC_MSG_RESULT([$want_server_debug])
-AM_CONDITIONAL(ENABLE_SERVER_DEBUG, test x$want_server_debug = xyes)
-
 dnl **********************************************************************
 dnl Compilation based checks should not be done before this point.
 dnl **********************************************************************
index 35451075dc6fb3bd8a49a773149c1ec7577921a8..6f8a914d73186cfc906e71a691694a4273561f12 100644 (file)
@@ -248,7 +248,6 @@ target_link_libraries(my_target PRIVATE CURL::libcurl)
 - `ENABLE_CURLDEBUG`:                       Enable TrackMemory debug feature. Default: =`ENABLE_DEBUG`
 - `ENABLE_CURL_MANUAL`:                     Build the man page for curl and enable its `-M`/`--manual` option. Default: `ON`
 - `ENABLE_DEBUG`:                           Enable curl debug features (for developing curl itself). Default: `OFF`
-- `ENABLE_SERVER_DEBUG`:                    Apply curl debug options to test servers. Default: `OFF`
 - `IMPORT_LIB_SUFFIX`:                      Import library suffix. Default: `_imp` for MSVC-like toolchains, otherwise empty.
 - `LIBCURL_OUTPUT_NAME`:                    Basename of the curl library. Default: `libcurl`
 - `PICKY_COMPILER`:                         Enable picky compiler options. Default: `ON`
index 0f7c5dee12a3bd757384f072fa1d86bec9d225e7..63b87246d76eb5bc13d8ba51162bdc89fbe9a365 100644 (file)
 #
 ###########################################################################
 
-# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, MEMDEBUG, CURLX_SRCS, TESTFILES variables
+# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES variables
 curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
 include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
 
-set(_sources_extra "")
-if(ENABLE_SERVER_DEBUG AND ENABLE_CURLDEBUG)
-  list(APPEND _sources_extra ${MEMDEBUG})
-endif()
-
 add_custom_command(
   OUTPUT "${BUNDLE_SRC}"
   COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl"
@@ -51,9 +46,6 @@ target_include_directories(servers PRIVATE
   "${PROJECT_SOURCE_DIR}/tests/server"  # for "first.h"
 )
 target_link_libraries(servers ${CURL_LIBS})
-if(ENABLE_SERVER_DEBUG)
-  set_property(TARGET servers APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
-endif()
 set_property(TARGET servers APPEND PROPERTY COMPILE_DEFINITIONS "WITHOUT_LIBCURL" "CURL_NO_OLDIES")
 # Test servers simply are standalone programs that do not use libcurl
 # library.  For convenience and to ease portability of these servers,
index 8b994c7bfb4bfd28a1719d290ead089e74a512f9..f4cc7648e75fc418fbb04e0087dc5a89b0b68f42 100644 (file)
@@ -40,7 +40,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include        \
               -I$(top_srcdir)/src            \
               -I$(top_srcdir)/tests/server
 
-# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, MEMDEBUG, CURLX_SRCS, TESTFILES variables
+# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES variables
 include Makefile.inc
 
 EXTRA_DIST = CMakeLists.txt .checksrc $(FIRSTFILES) $(UTILS) $(TESTFILES)
@@ -53,14 +53,6 @@ LIBS = $(BLANK_AT_MAKETIME)
 if DOING_NATIVE_WINDOWS
 AM_CPPFLAGS += -DCURL_STATICLIB
 endif
-if ENABLE_SERVER_DEBUG
-if DEBUGBUILD
-AM_CPPFLAGS += -DDEBUGBUILD
-endif
-if CURLDEBUG
-AM_CPPFLAGS += -DCURLDEBUG
-endif
-endif
 
 AM_CPPFLAGS += -DWITHOUT_LIBCURL -DCURL_NO_OLDIES
 
@@ -69,12 +61,6 @@ $(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UT
 
 noinst_PROGRAMS = $(BUNDLE)
 nodist_servers_SOURCES = $(BUNDLE_SRC)
-servers_SOURCES =
-if ENABLE_SERVER_DEBUG
-if CURLDEBUG
-servers_SOURCES += $(MEMDEBUG)
-endif
-endif
 servers_LDADD = @CURL_NETWORK_AND_TIME_LIBS@
 servers_CFLAGS = $(AM_CFLAGS)
 CLEANFILES = $(BUNDLE_SRC)
index 8ca058df33110a561c0c665a266c63632760d85f..49cafe9b839c1923168911e4ba84b03a9ed07e46 100644 (file)
@@ -32,10 +32,6 @@ FIRSTFILES = first.c first.h
 # Common files used by test programs
 UTILS = getpart.c getpart.h util.c util.h
 
-MEMDEBUG = \
-  ../../lib/memdebug.c \
-  ../../lib/memdebug.h
-
 CURLX_SRCS = \
   ../../lib/curlx/base64.c \
   ../../lib/curlx/inet_pton.c \