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 <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Moritz Poldrack 2022-06-22 12:12:00 +02:00 committed by Robin Jarry
parent d889981088
commit d5e278e5ff

View file

@ -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 .