From 1e97e5d3477dd988c935d081d6a0ba762d5f75ae Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 24 Oct 2023 11:27:57 -0400 Subject: [PATCH 1/2] Disable CGO for improved compatibility across distros --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 1317cab0..7b8bdae4 100644 --- a/Makefile +++ b/Makefile @@ -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 From eb4ac5e9478ef94fa41eff8c6d4bce78219d29b9 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 24 Oct 2023 11:45:57 -0400 Subject: [PATCH 2/2] Enabled CGO in tests for the race detector --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7b8bdae4..5e8af5c6 100644 --- a/Makefile +++ b/Makefile @@ -92,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