Install clang-tools by default - #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 |
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
|
@traversaro I reverted the *.sh.in changes and keep clang-tools install by default, I confirm that I have tested locally and this should fix RoboStack/ros-rolling#31 (comment) . Could you please take a look again? |
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
|
There is something I am missing here, sorry. Is |
|
This is only required when the project uses cmake_minimum_required version >= 3.28 with C++20 like https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/blob/f6cae596ae0ba7a5045a89b1e847c47155d7e203/ur_controllers/CMakeLists.txt#L1. If One workaround is to disable module dependency scanning with: additional_cmake_args: "-DCMAKE_CXX_SCAN_FOR_MODULES=OFF"This was actually what I tried at first in RoboStack/ros-rolling#31 (comment). However, it doesn’t seem like a good long-term solution. @Tobias-Fischer later suggested adding You can also find the corresponding error log here: |
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.