build: optimize Makefile
and fix infinite loop
#14000
Merged
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
This makes some improvements to the
Makefile
to speed up local development and avoid a common race condition when building.Modifications
Remove
DOCKER_DESKTOP
because nothing uses itSet
GOPATH
as a simply expanded variable sogo env GOPATH
isn't executed multiple timesDon't run the commands associated with the
ARGOEXEC_PKG_FILES
/CLI_PKG_FILES
/CONTROLLER_PKG_FILES
variables unless the target(s) needs them, because they're very slow. This speeds upmake
by ~1.5s for me. Before.After:
Fix issue where
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
is deleted during a build and it causes Kit to enter an infinite loop. This is a race condition triggered when running something likekit pre-up
. During that, as soon asutil/telemetry/attributes.go
is regenerated, this triggers Kit to abort themake ./dist/argo
command. If that command is in the middle of regeneratingpkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
, thenmake
deletes it:This tells
make
not to delete it using the special .PRECIOUS target.Verification
Ran
kit pre-up
and a bunch of other commands