Skip to content

Commit

Permalink
build: avoid building test bins with duplicate TAGS, GOFLAGS, LINKFLAGS
Browse files Browse the repository at this point in the history
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
  • Loading branch information
knz committed Dec 29, 2017
1 parent 1a3cb64 commit ff42b3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 := -
Expand Down

0 comments on commit ff42b3c

Please sign in to comment.