Closed cottsay closed 3 years ago
So in the nominal case where there are no changes to the package, this works. Where this fails is when you make changes to the CMakeLists.txt of the package and it thinks it needs to redownload and repatch things; that always fails, and I actually think that will fail with any other vendor package where we patch as well. While I've seen this before, I am actually struggling to replicate it now; do you happen to have a series of steps to make it happen?
do you happen to have a series of steps to make it happen?
Yeah, just build twice:
$ colcon build --event-handler console_start_end- console_stderr- --packages-up-to uncrustify_vendor
Summary: 17 packages finished [16.7s]
1 package had stderr output: uncrustify_vendor
$ colcon build --event-handler console_start_end- --packages-select uncrustify_vendor
--- stderr: uncrustify_vendor
error: patch failed: CMakeLists.txt:440
error: CMakeLists.txt: patch does not apply
gmake[2]: *** [CMakeFiles/uncrustify-0.68.1.dir/build.make:119: uncrustify-0.68.1-prefix/src/uncrustify-0.68.1-stamp/uncrustify-0.68.1-patch] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:97: CMakeFiles/uncrustify-0.68.1.dir/all] Error 2
gmake: *** [Makefile:160: all] Error 2
---
Summary: 0 packages finished [1.29s]
1 package failed: uncrustify_vendor
1 package had stderr output: uncrustify_vendor
From cmake docs:
Specifies a custom command to patch the sources after an update. By default, no patch command is defined. Note that it can be quite difficult to define an appropriate patch command that performs robustly, especially for download methods such as git where changing the GIT_TAG will not discard changes from a previous patch, but the patch command will be called again after updating to the new tag.
My 2 cents: Maybe the patch command could create a "patch already installed" marker file, and the beginning of the patch command is to test for the existence of that file. That's a bit of a hack, but it would work.
I don't know if it was #15 or #16, but rebuilding the package after a successful build results in an error now.