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
1 changed files with 5 additions and 0 deletions

View File

@ -47,6 +47,11 @@ _!=grep -sqFx '$(build_cmd)' .aerc.d || rm -f .aerc.d
aerc: $(GOSRC) .aerc.d aerc: $(GOSRC) .aerc.d
$(build_cmd) $(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 .PHONY: fmt
fmt: fmt:
gofmt -w . gofmt -w .