Add macOS clang-scan-deps support - #133
Conversation
|
Note that unprefixed clang scan deps is also supported in a newer cmake Kitware/CMake@5537b3d, but we are currently pinning cmake to 3.* due to RoboStack/ros-jazzy#40 (comment) |
|
fyi @Tobias-Fischer |
|
That seems quite a bit of complexity. Perhaps at this point is just easier to unpin cmake so we use the latest cmake, and fix any possible remaining error? |
|
I can remove the However, based on your previous comment, I think the root cause might actually be related to vinca setting: $Env:AMENT_PYTHON_EXECUTABLE="${env:CONDA_PREFIX}\python.exe"It seems like this may need to be changed to: $Env:AMENT_PYTHON_EXECUTABLE="${env:CONDA_PREFIX}/python.exe"My main question is whether Windows is ready for us to bump the cmake version now. Do you happen to remember any of the details around the previous issue? Admittedly, I a not very familiar with Windows, and I don't have a Windows machine available to test this locally :( |
|
Maybe I was wrong, looks like the error comes from ament-cmake-python a3577e9 |
Summary
Add central macOS support for Clang's C++ dependency scanner in generated CMake, Catkin, and Ament CMake recipes.
Problem
CMake 3.28 and newer may scan C++20 sources for module dependencies. On macOS, conda-forge activates a target-prefixed compiler such as
arm64-apple-darwin20.0.0-clang++, whileclang-toolsinstalls the scanner as the unprefixed$BUILD_PREFIX/bin/clang-scan-deps.CMake derives the toolchain prefix from the compiler name and therefore fails to discover the packaged scanner, eventually attempting to run
CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND.Changes
clang-toolsbuild requirement to CMake, Catkin, and Ament CMake recipes.clang-toolsmajor version tocxx_compiler_version, with*as the fallback when the compiler version is undefined.$BUILD_PREFIX/bin/clang-scan-depsexists and pass it throughCMAKE_CXX_COMPILER_CLANG_SCAN_DEPS.The scanner path does not enable module scanning by itself. CMake continues to decide whether to scan based on the C++ standard, generator, compiler support, policy settings, and
CXX_SCAN_FOR_MODULESproperties.Validation
ros-rolling-ur-controllersrecipes with this Vinca checkout.clang-tools 19.*.clang-tools19.1.7.CMAKE_CXX_SCAN_FOR_MODULES=OFFworkaround for the focused verification.ros-rolling-ur-controllerssuccessfully onosx-arm64; Ninja completed nine dependency-scanning steps and the log contained noCMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUNDin the successful build section.The Vinca unit, lint, and formatting baselines were not run as part of this focused verification.