build: ensure Makefile driven dependencies are up to date #13623
+21
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
As a developer when the Makefile changes the version of a program that it uses or another dependency I would like to use the new version of that program or dependency
Created in response to https://cloud-native.slack.com/archives/C0510EUH90V/p1726666701563199
Modifications
For all make targets that specify their version in the Makefile specify the Makefile as a dependency so they will get refetched if the Makefile changes. This is crude as it will refetch all dependencies regardless of whether they have changed or not, so touching the Makefile will cause a slower rebuild. Correctness trumps speed here in my opinion.
Add
-y
to theapt get
call installing clang-format so that it becomes non-interactive. It's annoying to have to typey
when this runs anyway.Use the special Makefile variable
$@
instead of repeating the target name explicitly in the rules I was touching where it was relevant - following the DRY principle.Most annoyingly
recurl.sh
doesn't do any work if the target file exists, so remove the file before fetching in the case where that is used so we get an updated version. This foxed me for a while as this was the file causing the original issue linked above in slack.Verification
Locally
make codegen
successfully on a dirty checkout which had run codegen prior to #13413.Notes to approvers
This is pushed to argoproj so you can make direct edits if you feel that's appropriate for collective ownership of fixing this.
Signed-off-by: Alan Clucas [email protected]