From d5e278e5ffa772238728e4c874bf9568bb0d18e1 Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Wed, 22 Jun 2022 12:12:00 +0200 Subject: [PATCH] mk: add dev target with go race detector enabled Add a dev target which enables Go's race detector. This requires CGo to be enabled and reduces performance significantly, but helps in finding data races which can lead to hard to diagnose bugs. Signed-off-by: Moritz Poldrack Acked-by: Robin Jarry --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 503d840..1b32a6b 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,11 @@ _!=grep -sqFx '$(build_cmd)' .aerc.d || rm -f .aerc.d aerc: $(GOSRC) .aerc.d $(build_cmd) +.PHONY: dev +dev: + $(MAKE) aerc BUILD_OPTS="-trimpath -race" + GORACE="log_path=race.log strip_path_prefix=git.sr.ht/~rjarry/aerc/" ./aerc + .PHONY: fmt fmt: gofmt -w .