From 70300bdd48ece3763cc812fee276968767e77b3c Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 7 Feb 2026 12:44:40 +0100 Subject: build: Fix clobbering of FUSE_PREFIX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Sander Vrijders --- cmake/dependencies/system/fuse.cmake | 27 ++++++++++++++------------- 1 file 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) -- cgit v1.2.3