ament / uncrustify_vendor

CMake shim over the uncrustify library: https://github.com/uncrustify/uncrustify
Apache License 2.0
0 stars 9 forks source link

ROS 2 Galactic Failed to compile due to Uncrustify_vendor #24

Closed chngdickson closed 7 months ago

chngdickson commented 3 years ago

The CMakeLists.txt in this directory doesn't work. I believe there are errors in the implementation for ros2 galactic and should revert to ros2 foxy instead. Using ros2 foxy CMake produced a successful build.

C:\dev\ros2_galactic\src\ament\uncrustify_vendor\CMakeLists.txt

Galactic Implementation error code. Performing patch step for 'uncrustify-704034b8e9999fc2bf83be4aaf464859021a20c4' CUSTOMBUILD : error : patch failed: CMakeLists.txt:440 [C:\dev\ros2_galactic\build\uncrustify_vendor\uncrustify-704034b8e9999fc2bf83be4aaf464859021a20c4.vcxproj] CUSTOMBUILD : error : CMakeLists.txt: patch does not apply [C:\dev\ros2_galactic\build\uncrustify_vendor\uncrustify-704034b8e9999fc2bf83be4aaf464859021a20c4.vcxproj]

clalancette commented 3 years ago

So this is a known issue with all of our vendored packages. The problem is that there is no way for CMake to detect when it has already applied a patch, so if it detects it needs to rebuild it will try to apply the patch a second time.

The workaround is to remove the build directory of uncrustify, something like rm -rf build/uncrustify_vendor. Then the rebuild should work.

We've considered other options here, but there is no real straightforward way to fix this that we've found in CMake.

clalancette commented 7 months ago

We did end up fixing this by switching over to ament_vendor, which should have solved this problem (along with a bunch of other ones). I'm going to close this out, but feel free to reopen if you are still having problems.