Skip to content

Commit 28c0ee2

Browse files
authored
Disable CGO for improved compatibility across distros (#420)
* Disable CGO for improved compatibility across distros * Enabled CGO in tests for the race detector
1 parent bc2944d commit 28c0ee2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export PATH := $(shell pwd)/.tmp/protoc/bin:$(PATH)
44

55
export PROTOC_VERSION := 22.0
66

7+
# Disable CGO for improved compatibility across distros
8+
export CGO_ENABLED=0
9+
710
# TODO: run golint and errcheck, but only to catch *new* violations and
811
# decide whether to change code or not (e.g. we need to be able to whitelist
912
# violations already in the code). They can be useful to catch errors, but
@@ -89,7 +92,8 @@ errcheck:
8992

9093
.PHONY: test
9194
test:
92-
go test -race ./...
95+
# The race detector requires CGO: https://github.com/golang/go/issues/6508
96+
CGO_ENABLED=1 go test -race ./...
9397

9498
.tmp/protoc/bin/protoc: ./Makefile ./download_protoc.sh
9599
./download_protoc.sh

0 commit comments

Comments
 (0)