Organize Makefile variables and fix Go flags bug
#2520
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.
GO_FLAGS_EXTRAbehavior is bugged and cannot be used to pass extra Go flags to the build command.E.g.,
make GO_BUILD_TAGS=rego GO_FLAGS_EXTRA=-trimpath out/delta-snp.tar.gzbuilds the Go binaries with only the-trimpathflag, and not-tags=rego:Specifying Make variables via command line takes precedence over and overrides all assignments to it.
This causes issues with
GO_FLAGS_EXTRA, which may be updated to include-tagsan-modflags, as well as used to pass extra Go flags via command line (e.g.,make GO_FLAGS_EXTRA=-trimpath). UpdateMakefileto updateGO_FLAGSinstead, and leaveGO_FLAGS_EXTRAunmodified.Move
Makefilevariables intended to be overridden in the command line to dedicated blocks, and add comments to them.Additionally, add fix for new Microsoft Go behavior (starting in go1.25) that requires CGo by default for crypto libraries.
See: