From 4fbfd3c5969a0d2e679d06c3e375f5c0e85c089e Mon Sep 17 00:00:00 2001 From: Michal Nowacki Date: Tue, 25 Nov 2025 12:43:06 -0500 Subject: [PATCH] allow daemon-golang-verify to pass when requested Add an option to override default behavior of daemon-golang-verify target, which is to fail the build if golang version used to build the daemon does not match the toolchain version from go.mod. Overriding this behavior is beneficial when trying to test building the daemon with more recent version of golang. --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5cccaf721..9fe9108ef 100644 --- a/Makefile +++ b/Makefile @@ -167,12 +167,19 @@ agent-valgrind: agent/Makefile # Configure the target directory for go install export GOBIN=$(CURDIR)/bin +# By default daemon golang verification will cause the build to fail. This +# behavior can be overriden by setting GOLANG_VERIFICATION_FAILURE_SEVERITY +# to a value different than ERROR. Overriding this value is helpful when +# trying to build the agent with more recent version of go than the one +# defined by toolchain go.mod. +GOLANG_VERIFICATION_FAILURE_SEVERITY ?= ERROR .PHONY: daemon-golang-verify daemon-golang-verify: @golang_in_binary=$$(go version -m bin/daemon | awk '/^bin\/daemon/ {print $$2;}') \ && golang_from_toolchain=$$(awk '/^toolchain/ {print $$2;}' daemon/go.mod) \ && [ "$$golang_in_binary" = "$$golang_from_toolchain" ] && echo "daemon built using: $$golang_from_toolchain" \ - || { echo "ERROR: daemon built using go: $$golang_in_binary, required: $$golang_from_toolchain"; exit 1; } + || { echo "$(GOLANG_VERIFICATION_FAILURE_SEVERITY): daemon built using go: $$golang_in_binary, required: $$golang_from_toolchain"; \ + [ "$(GOLANG_VERIFICATION_FAILURE_SEVERITY)" != "ERROR" ] || exit 1; } .PHONY: daemon daemon: