Skip to content

Commit

Permalink
Disable CGO for improved compatibility across distros (#420)
Browse files Browse the repository at this point in the history
* Disable CGO for improved compatibility across distros

* Enabled CGO in tests for the race detector
  • Loading branch information
gpassini committed Oct 24, 2023
1 parent bc2944d commit 28c0ee2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export PATH := $(shell pwd)/.tmp/protoc/bin:$(PATH)

export PROTOC_VERSION := 22.0

# Disable CGO for improved compatibility across distros
export CGO_ENABLED=0

# TODO: run golint and errcheck, but only to catch *new* violations and
# decide whether to change code or not (e.g. we need to be able to whitelist
# violations already in the code). They can be useful to catch errors, but
Expand Down Expand Up @@ -89,7 +92,8 @@ errcheck:

.PHONY: test
test:
go test -race ./...
# The race detector requires CGO: https://github.com/golang/go/issues/6508
CGO_ENABLED=1 go test -race ./...

.tmp/protoc/bin/protoc: ./Makefile ./download_protoc.sh
./download_protoc.sh
Expand Down

0 comments on commit 28c0ee2

Please sign in to comment.