diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-02-07 12:44:40 +0100 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-02-13 09:22:29 +0100 |
| commit | 70300bdd48ece3763cc812fee276968767e77b3c (patch) | |
| tree | 5e26640ce3ac9490f10b5d3a82887e7d807e2eee /cmake/dependencies/system/fuse.cmake | |
| parent | 7ed1b82e13fd70f3e68c4d6ec320377e4c27174f (diff) | |
| download | ouroboros-70300bdd48ece3763cc812fee276968767e77b3c.tar.gz ouroboros-70300bdd48ece3763cc812fee276968767e77b3c.zip | |
build: Fix clobbering of FUSE_PREFIX
pkg_check_modules(FUSE ...) in fuse.cmake tells CMake's pkg-config
module to use FUSE as the variable prefix. pkg-config then populates
FUSE_PREFIX with the install prefix of libfuse (i.e., usr). This
overwrote the FUSE_PREFIX cache variable set to /tmp/ouroboros in
global.cmake.
IRMd was calling mkdir("/usr", 0777) on startup and rmdir("/usr") on
shutdown. The rmdir only fails because usr isn't empty — if it ever
were (e.g., in a minimal container), it would deleted /usr.
The fix renames the pkg-config prefix from FUSE to FUSE_PKG, so
pkg-config populates FUSE_PKG_PREFIX (harmless) instead of clobbering
FUSE_PREFIX.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'cmake/dependencies/system/fuse.cmake')
| -rw-r--r-- | cmake/dependencies/system/fuse.cmake | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/cmake/dependencies/system/fuse.cmake b/cmake/dependencies/system/fuse.cmake index 7de12b31..ffd9e92e 100644 --- a/cmake/dependencies/system/fuse.cmake +++ b/cmake/dependencies/system/fuse.cmake @@ -1,28 +1,29 @@ # Try pkg-config first, fall back to find_library +# Use FUSE_PKG prefix to avoid collision with FUSE_PREFIX if(PkgConfig_FOUND) - pkg_check_modules(FUSE QUIET IMPORTED_TARGET fuse>=2.6) - if(FUSE_FOUND AND NOT TARGET Fuse::Fuse) - add_library(Fuse::Fuse ALIAS PkgConfig::FUSE) + pkg_check_modules(FUSE_PKG QUIET IMPORTED_TARGET fuse>=2.6) + if(FUSE_PKG_FOUND AND NOT TARGET Fuse::Fuse) + add_library(Fuse::Fuse ALIAS PkgConfig::FUSE_PKG) endif() endif() -if(NOT FUSE_FOUND) - find_library(FUSE_LIBRARIES fuse QUIET) - if(FUSE_LIBRARIES) - set(FUSE_FOUND TRUE) +if(NOT FUSE_PKG_FOUND) + find_library(FUSE_PKG_LIBRARIES fuse QUIET) + if(FUSE_PKG_LIBRARIES) + set(FUSE_PKG_FOUND TRUE) if(NOT TARGET Fuse::Fuse) add_library(Fuse::Fuse UNKNOWN IMPORTED) set_target_properties(Fuse::Fuse PROPERTIES - IMPORTED_LOCATION "${FUSE_LIBRARIES}") + IMPORTED_LOCATION "${FUSE_PKG_LIBRARIES}") endif() endif() endif() -if(FUSE_FOUND) +if(FUSE_PKG_FOUND) set(DISABLE_FUSE FALSE CACHE BOOL "Disable FUSE support") if(NOT DISABLE_FUSE) - if(FUSE_VERSION) - message(STATUS "FUSE support enabled (version ${FUSE_VERSION})") + if(FUSE_PKG_VERSION) + message(STATUS "FUSE support enabled (version ${FUSE_PKG_VERSION})") else() message(STATUS "FUSE support enabled") endif() @@ -38,7 +39,7 @@ else() endif() if(NOT HAVE_FUSE) - set(FUSE_LIBRARIES "") + set(FUSE_PKG_LIBRARIES "") endif() -mark_as_advanced(FUSE_LIBRARIES) +mark_as_advanced(FUSE_PKG_LIBRARIES) |
