Skip to content

Commit c703533

Browse files
authored
Merge pull request #102 from akopytov/master
ARM64-specific fixes.
2 parents e81a48e + 3d875eb commit c703533

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ BIN_DIR ?= $(shell pwd)
2222
DOCKER_IMAGE_NAME ?= mongodb-exporter
2323
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))
2424

25+
# Race detector is only supported on amd64.
26+
RACE := $(shell test $$(go env GOARCH) != "amd64" || (echo "-race"))
2527

2628
all: format build test
2729

@@ -31,11 +33,11 @@ style:
3133

3234
test:
3335
@echo ">> running tests"
34-
gocoverutil -coverprofile=coverage.txt test -short -v -race $(pkgs)
36+
gocoverutil -coverprofile=coverage.txt test -short -v $(RACE) $(pkgs)
3537

3638
testall:
3739
@echo ">> running all tests"
38-
gocoverutil -coverprofile=coverage.txt test -v -race $(pkgs)
40+
gocoverutil -coverprofile=coverage.txt test -v $(RACE) $(pkgs)
3941

4042
format:
4143
@echo ">> formatting code"
@@ -60,7 +62,7 @@ docker:
6062
init:
6163
$(GO) get -u github.com/AlekSi/gocoverutil
6264
GOOS=$(shell uname -s | tr A-Z a-z) \
63-
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
65+
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(subst aarch64,arm64,$(shell uname -m)))) \
6466
$(GO) get -u github.com/prometheus/promu
6567

6668

0 commit comments

Comments
 (0)