From ff42b3cc27936453f3175c57249de2e348fe1b63 Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Thu, 28 Dec 2017 19:02:03 +0100 Subject: [PATCH] build: avoid building test bins with duplicate TAGS, GOFLAGS, LINKFLAGS Recursively calling `$(MAKE) TAGS='$(TAGS)'` (ditto GOFLAGS, LINKFLAGS) causes the various strings to be appended twice to these variables (once in the caller make, one in the callee make) and then passed twice to the actual go commands. This causes some troubles on e.g. freebsd (see issue #21086). This patch alleviates the issue by removing the explicit variable overrides from the recursive make invocation. I have checked manually that if a user runs `make testlogic TAGS=foo` then the custom TAGS is properly propagated to the recursive make. Release note: None --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9ecbf8ad67a4..36fb9ff0b4a8 100644 --- a/Makefile +++ b/Makefile @@ -748,7 +748,7 @@ testrace: TESTTIMEOUT := $(RACETIMEOUT) FIND_RELEVANT := find $(PKG_ROOT) -name node_modules -prune -o pkg/%.test: main.go $(shell $(FIND_RELEVANT) ! -name 'zcgo_flags.go' -name '*.go') - $(MAKE) testbuild GOFLAGS='$(GOFLAGS)' TAGS='$(TAGS)' LINKFLAGS='$(LINKFLAGS)' PKG='./pkg/$(*D)' + $(MAKE) testbuild PKG='./pkg/$(*D)' bench: ## Run benchmarks. bench: TESTS := -