From 2022a318204727b08de4d40bbbfe51d1bf1832cb Mon Sep 17 00:00:00 2001 From: James Shubin Date: Wed, 20 Aug 2025 14:54:59 -0400 Subject: [PATCH] make: Leave race detector on by default Maybe this will help us shake out some bugs. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 81e76e92..78fa66e6 100644 --- a/Makefile +++ b/Makefile @@ -230,7 +230,10 @@ build/mgmt-%: $(GO_FILES) $(MCL_FILES) $(MISC_FILES) go.mod go.sum | lang resour @# If you need to run `go mod tidy` then this can trigger. @if [ "$(PKGNAME)" = "" ]; then echo "\$$(PKGNAME) is empty, test with: go list ."; exit 42; fi @echo "Building: $(PROGRAM), os/arch: $*, version: $(SVERSION)..." - time env GOOS=${GOOS} GOARCH=${GOARCH} go build $(TRIMPATH) -ldflags=$(PKGNAME)="-X main.program=$(PROGRAM) -X main.version=$(SVERSION) ${LDFLAGS}" -o $@ $(BUILD_FLAGS) + @# XXX: leave race detector on by default for now. For production + @# builds, we can consider turning it off for performance improvements. + @# XXX: ./mgmt run --tmp-prefix lang something_fast.mcl > /tmp/race 2>&1 # search for "WARNING: DATA RACE" + time env GOOS=${GOOS} GOARCH=${GOARCH} go build $(TRIMPATH) -race -ldflags=$(PKGNAME)="-X main.program=$(PROGRAM) -X main.version=$(SVERSION) ${LDFLAGS}" -o $@ $(BUILD_FLAGS) # create a list of binary file names to use as make targets # to use this you might want to run something like: