ios-2514 Auto-detect sys/acl.h availability on Linux instead of unconditional ON#2512
Conversation
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>
|
@xiangguomin, please follow the contributor guidelines.
When this is done, we are happy to merge your pull request. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2512 +/- ##
=======================================
Coverage 77.87% 77.87%
=======================================
Files 446 446
Lines 16301 16301
Branches 2320 2320
=======================================
+ Hits 12694 12695 +1
Misses 2759 2759
+ Partials 848 847 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
@xiangguomin with this change it is possible that iceoryx lacks the ACL protection if the system where it is build lacks the ACL feature, without the user being aware of it, e.g. when the release happens with a github CI action. This could lead to iceoryx becoming the first chain in an attack vector. We are always opting to be safe by default but leave the option to the user to opt out. With this change, there would be a silent degradation with the user not being aware that the feature is turned off. I'm afraid, but this PR cannot be merged. Why is the cmake option not working for you? That's the way to build iceoryx if you do not want to have ACLs. |
@elBoberido Thanks for your input. I agree with your comment. I was using 2.0.6 in our code. This option was added after that. I did not test the latest version, as we have some limitation to use the latest release. But I did a test today, this option is working correctly. I am closing this PR for now. |
Notes for Reviewer
On Linux,
IOX_PLATFORM_FEATURE_ACLdefaults toONunconditionally iniceoryx_platform/linux/cmake/IceoryxPlatformDeployment.cmake. This causesbuild failures when using hermetic toolchains (e.g. Zig/clang sysroots,
embedded cross-compilers) that do not include
sys/acl.horlibaclintheir sysroot:
This PR uses CMake's
check_include_fileto probe forsys/acl.hat configure time:ON(no behaviour change for standard system toolchains)OFF, using the existing no-op stub already present inlinux/include/iceoryx_platform/acl.hppbehind#if IOX_FEATURE_ACLThe cmake
option()is still user-overridable in both directions.Pre-Review Checklist for the PR Author
iox-123-this-is-a-branch)iox-#123 commit text)task-list-completed)Checklist for the PR Reviewer
iceoryx_hoofshave been added to./clang-tidy-diff-scans.txtPost-review Checklist for the PR Author
References