Skip to content

Commit 194fe55

Browse files
guominxclaude
andcommitted
iox-#XXXX Auto-detect sys/acl.h availability on Linux
On Linux, IOX_PLATFORM_FEATURE_ACL previously defaulted to ON unconditionally. This causes build failures when using hermetic toolchains (e.g. Zig/clang sysroots) that do not provide sys/acl.h or libacl. Use CMake's check_include_file to probe for sys/acl.h at configure time. If the header is absent, default IOX_PLATFORM_FEATURE_ACL to OFF so the existing no-op stub is used instead. The option can still be overridden explicitly by the user. This unblocks hermetic and minimal toolchain builds without requiring out-of-tree patches (e.g. rules_ros2_iceoryx_no_acl.patch). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent ffd3610 commit 194fe55

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

iceoryx_platform/linux/cmake/IceoryxPlatformDeployment.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@ configure_option(
3838
DEFAULT_VALUE "/etc/"
3939
)
4040

41-
option(IOX_PLATFORM_FEATURE_ACL "Use ACLs for access control" ON)
41+
include(CheckIncludeFile)
42+
check_include_file("sys/acl.h" IOX_HAVE_SYS_ACL_H)
43+
if(IOX_HAVE_SYS_ACL_H)
44+
set(IOX_PLATFORM_FEATURE_ACL_DEFAULT ON)
45+
else()
46+
message(STATUS "[i] sys/acl.h not found - disabling ACL support (hermetic or minimal toolchain detected)")
47+
set(IOX_PLATFORM_FEATURE_ACL_DEFAULT OFF)
48+
endif()
49+
50+
option(IOX_PLATFORM_FEATURE_ACL "Use ACLs for access control" ${IOX_PLATFORM_FEATURE_ACL_DEFAULT})
4251
message(STATUS "[i] IOX_PLATFORM_FEATURE_ACL: ${IOX_PLATFORM_FEATURE_ACL}")
4352

4453
message(STATUS "[i] <<<<<<<<<<<<<< End iceoryx_platform configuration: >>>>>>>>>>>>>>")

0 commit comments

Comments
 (0)