cmcfarlen commented on PR #12036:
URL: https://github.com/apache/trafficserver/pull/12036#issuecomment-2694872875
I think your fix is masking the real issue here. We have
`cmake/layout.cmake` that sets up up the directory layout, including the logdir
directory. That uses the CMAKE_INSTALL_PREFIX variable as a base. However, if
you don't specify this variable in the build, it defaults to
`/usr/local/trafficserver`, but only *after* including the layout script. This
creates a mismatch in the full logdir and the defaulted prefix. Would you mind
trying this diff instead of yours to fix this issue?
```diff --git a/CMakeLists.txt b/CMakeLists.txt
index e691ab2c9..6b8d3856f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,6 +45,14 @@ set(CMAKE_CXX_EXTENSIONS OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE -DATS_BUILD)
+# Setup default install directory
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX
+ /usr/local/trafficserver
+ CACHE PATH "Default install path" FORCE
+ )
+endif()
+
include(layout)
include(ClangTidy)
@@ -161,14 +169,6 @@ else()
endif()
set(TS_PKGSYSUSER ${WITH_USER})
-# Setup default install directory
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- set(CMAKE_INSTALL_PREFIX
- /usr/local/trafficserver
- CACHE PATH "Default install path" FORCE
- )
-endif()
-
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(DEFAULT_POSIX_CAP ON)
endif()
```
It just moves defaulting the install prefix before including layout.
Thank!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]