From f2d40931ffda20d53f6a6c179ae25f59e725d31b Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Mon, 2 Nov 2026 13:48:22 +0100 Subject: [PATCH 1/2] [civetweb] download tarball with 588860e3 source and patch it Put in civetweb-588860e3.tar.gz code from 588860e3 commit and apply our patches to it. Then build with same commands as with git checkout Specify LCG and jsroot.gsi.de as alternative location Provide DOWNLOAD_DIR arg Add readme explaining how to create tarball from repository (cherry picked from commit d2230fe99683ebc60c1aa41f8207cf758a29b458) --- builtins/civetweb/CMakeLists.txt | 21 +++++++++++++++------ builtins/civetweb/Readme.md | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 builtins/civetweb/Readme.md diff --git a/builtins/civetweb/CMakeLists.txt b/builtins/civetweb/CMakeLists.txt index 7182f3a633f98..2775a6007ff90 100644 --- a/builtins/civetweb/CMakeLists.txt +++ b/builtins/civetweb/CMakeLists.txt @@ -19,7 +19,7 @@ if(WIN32) endif() # check if the patch has already been applied if(NOT EXISTS "${ROOT_CIVETWEB_PREFIX}/src/BUILTIN_CIVETWEB/._patched") - set(ROOT_CIVETWEB_PATCH_COMMAND PATCH_COMMAND ${GIT_EXECUTABLE} init COMMAND ${GIT_EXECUTABLE} apply ${GIT_PATCH_ARGS} + set(ROOT_CIVETWEB_PATCH_COMMAND PATCH_COMMAND ${GIT_EXECUTABLE} init -b master COMMAND ${GIT_EXECUTABLE} apply ${GIT_PATCH_ARGS} ${CMAKE_CURRENT_SOURCE_DIR}/1385.patch # https://github.com/civetweb/civetweb/pull/1385 ${CMAKE_CURRENT_SOURCE_DIR}/1389.patch # https://github.com/civetweb/civetweb/pull/1389 ${CMAKE_CURRENT_SOURCE_DIR}/1423.patch # https://github.com/civetweb/civetweb/pull/1423 for OpenSSL4 compatibility @@ -96,13 +96,22 @@ endif() ExternalProject_Add(BUILTIN_CIVETWEB PREFIX ${ROOT_CIVETWEB_PREFIX} - # URL ${lcgpackages}/civetweb-${ROOT_CIVETWEB_VERSION}.tar.gz - # URL_HASH SHA256=${ROOT_CIVETWEB_HASH} + + # ------- tarball of 588860e3 commit, see Readme.md how to build it ------ + DOWNLOAD_DIR ${ROOT_DOWNLOAD_DIR} + URL ${lcgpackages}/civetweb-588860e3.tar.gz + https://jsroot.gsi.de/packages/civetweb-588860e3.tar.gz + URL_HASH SHA256=8d5d809f36e94b67257c5d61156a9b9eae7ab34de769dc82330c31841ac21771 + # while we extract directly repository, we need to patch it + ${ROOT_CIVETWEB_PATCH_COMMAND} + # TODO: once 1.17 released, bump SearchInstalledSoftware find_package to 1.17 plus remove patches # and potentially install civetweb in root-ci-images via homebrew and change builtin to OFF in ci-configs - GIT_REPOSITORY https://github.com/civetweb/civetweb.git - GIT_TAG 588860e30721bf5453b0440c390865a8e85dcae5 # v1.17.0 not yet released, v1.16.0 has missing CVE fixes - ${ROOT_CIVETWEB_PATCH_COMMAND} + + # ------- use next three lines when direct checkout from git repository required -------- + # GIT_REPOSITORY https://github.com/civetweb/civetweb.git + # GIT_TAG 588860e30721bf5453b0440c390865a8e85dcae5 # v1.17.0 not yet released, v1.16.0 has missing CVE fixes + # ${ROOT_CIVETWEB_PATCH_COMMAND} UPDATE_COMMAND "" LOG_DOWNLOAD TRUE LOG_CONFIGURE FALSE diff --git a/builtins/civetweb/Readme.md b/builtins/civetweb/Readme.md new file mode 100644 index 0000000000000..a126fb7bad72f --- /dev/null +++ b/builtins/civetweb/Readme.md @@ -0,0 +1,26 @@ +# Patched version of civetweb master + +Unfortunately last civetweb released version 1.16 does not include necessary changes, +therefore unreleased master version is used plus several patches. + +One strategy to build civetweb is checkout github repository, patch it at place and then build. +Main disadvantege of such approach - any ROOT build will require checkout of full repository +which is about 100MB of files. This possibility is commented out in cmake file - +see `GIT_REPOSITORY` and `GIT_TAG` parameters. + +Instead minimalistic tarball file is created and placed on LCG download site. +Such minimalistic tarball includes following files: + + * `cmake/` - cmake files + * `include/` - headers + * `src/` - sources without `src/third_party` + * CMakeLists.txt - main cmake file + * CREDITS.md, LICENSE.md, README.md, RELEASE_NOTES.md, SECURITY.md - misc + +Full command to create tarball is: + + git clone https://github.com/civetweb/civetweb.git + cd civetweb + tar -czf civetweb-.tar.gz --exclude='src/third_party' cmake include src CMakeLists.txt CREDITS.md LICENSE.md README.md RELEASE_NOTES.md SECURITY.md + + From edfe89f6420ec27c5efaf849f88732187f118293 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Tue, 3 Nov 2026 17:25:49 +0100 Subject: [PATCH 2/2] [civetweb] fix problem with lists CMAKE_ARGS When in ExternalProject_Add inside CMAKE_ARGS list of files or list of libraries should be specified - one have to use custom LIST_SEPARATOR to avoid conflict with sheel invocations by cmake For this particular case "|" symbol is used. Also disbale CIVETWEB_ENABLE_CXX compilation which is not used in ROOT (cherry picked from commit a7c2bbf3f53f66f9326ada8966628e7ae2142aab) --- builtins/civetweb/CMakeLists.txt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/builtins/civetweb/CMakeLists.txt b/builtins/civetweb/CMakeLists.txt index 2775a6007ff90..c4d44a39ce686 100644 --- a/builtins/civetweb/CMakeLists.txt +++ b/builtins/civetweb/CMakeLists.txt @@ -94,6 +94,14 @@ else() set(ROOT_CIVETWEB_ASAN_CMD "-DCIVETWEB_ENABLE_ASAN=ON") endif() + +# use special separatore to avoid conflicts when provide complex variables + +string(REGEX REPLACE "[ ;]" "|" OPENSSL_LIBRARIES_ALT "${OPENSSL_LIBRARIES}") +string(REGEX REPLACE "[ ;]" "|" ZLIB_LIBRARIES_ALT "${ZLIB_LIBRARIES}") +string(REGEX REPLACE "[ ;]" "|" ZLIB_INCLUDE_DIRS_ALT "${ZLIB_INCLUDE_DIRS}") + + ExternalProject_Add(BUILTIN_CIVETWEB PREFIX ${ROOT_CIVETWEB_PREFIX} @@ -125,6 +133,7 @@ ExternalProject_Add(BUILTIN_CIVETWEB USES_TERMINAL_INSTALL true USES_TERMINAL_TEST true INSTALL_DIR ${ROOT_CIVETWEB_PREFIX} + LIST_SEPARATOR "|" CMAKE_ARGS -G ${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_INSTALL_LIBDIR:PATH=/lib @@ -139,7 +148,7 @@ ExternalProject_Add(BUILTIN_CIVETWEB -DBUILD_TESTING=FALSE -DCIVETWEB_BUILD_TESTING=FALSE -DCIVETWEB_ENABLE_ASAN=OFF # If set to ON, you need to set below link_library interface to UBSAN libs - -DCIVETWEB_ENABLE_CXX=ON + -DCIVETWEB_ENABLE_CXX=OFF # C++ interface is not used in the ROOT # civetweb defines -DDEBUG for Debug builds, which activates its DEBUG_TRACE # macro (~130 call sites) and floods stderr with per-request output. # Note the same option also gates civetweb's assertions. @@ -154,7 +163,7 @@ ExternalProject_Add(BUILTIN_CIVETWEB -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} -DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} -DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} - -DOPENSSL_LIBRARIES=${OPENSSL_LIBRARIES} + -DOPENSSL_LIBRARIES=${OPENSSL_LIBRARIES_ALT} #-DCMAKE_PREFIX_PATH:STRING=${OPENSSL_PREFIX} -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} #-DOPENSSL_FOUND=TRUE @@ -163,8 +172,8 @@ ExternalProject_Add(BUILTIN_CIVETWEB #-DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} #-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} # -DCMAKE_INSTALL_RPATH:STRING=${rpath_origin} - -DZLIB_LIBRARY=${ZLIB_LIBRARIES} - -DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIRS} + -DZLIB_LIBRARY=${ZLIB_LIBRARIES_ALT} + -DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIRS_ALT} ${ZLIB_ROOT_OPTION} BUILD_COMMAND ${CMAKE_COMMAND} --build . ${ROOT_CIVETWEB_BUILD_COMMAND_FLAGS} INSTALL_COMMAND ${CMAKE_COMMAND} --build . ${ROOT_CIVETWEB_BUILD_COMMAND_FLAGS} --target install