Skip to content

Commit

Permalink
Makefile: Build maptool with CGO enabled if RACE
Browse files Browse the repository at this point in the history
Fixes:

```
$ sudo -E make SKIP_VET=true SKIP_KVSTORES=true TESTPKGS=pkg/aws/eni RACE=1 unit-tests
dirname: missing operand
Try 'dirname --help' for more information.
make  -C tools/maptool/
make[1]: Entering directory
'/home/chris/code/cilium/cilium/tools/maptool'
CGO_ENABLED=0 go build -mod=vendor -race -ldflags '-X
"github.com/cilium/cilium/pkg/version.Version=1.7.90 2d4cc76
2020-05-20T12:25:41-07:00 go version go1.14.2 linux/amd64" -s -w -X
"github.com/cilium/cilium/pkg/envoy.RequiredEnvoyVersionSHA=a3385205ad620550b35d3b0b651e40898386e6e3"
-X
"github.com/cilium/cilium/pkg/datapath/loader.DatapathSHA=7359bebb8825a116e3b022e9a3ff35045d0709ce"
'  -o maptool
go build: -race requires cgo; enable cgo by setting CGO_ENABLED=1
make[1]: *** [Makefile:14: maptool] Error 2
make[1]: Leaving directory
'/home/chris/code/cilium/cilium/tools/maptool'
make: *** [Makefile:216: unit-tests] Error 2
```

Signed-off-by: Chris Tarazi <chris@isovalent.com>
  • Loading branch information
christarazi authored and joestringer committed May 21, 2020
1 parent 8b54d2f commit c6d373c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/maptool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ all: $(TARGET)

$(TARGET):
@$(ECHO_GO)
ifneq ($(RACE),"")
$(QUIET)$(GO_BUILD_WITH_CGO) -o $@
else
$(QUIET)$(GO_BUILD) -o $@
endif

clean:
@$(ECHO_CLEAN)
Expand Down

0 comments on commit c6d373c

Please sign in to comment.