From 299029329aa92ef9ed811a0a478ebcff0bb6699a Mon Sep 17 00:00:00 2001 From: Brian C. Lane Date: Aug 25 2021 17:04:48 +0000 Subject: Add BUILDTAGS to %gobuildflags Otherwise any tags set by the user are clobbered by the macro's use of -tags. Resolves: rhbz#1997721 --- diff --git a/rpm/macros.d/macros.go-compilers-golang b/rpm/macros.d/macros.go-compilers-golang index 44f1f12..7ae4566 100644 --- a/rpm/macros.d/macros.go-compilers-golang +++ b/rpm/macros.d/macros.go-compilers-golang @@ -29,7 +29,7 @@ # # %make GOBUILDFLAGS="%gobuildflags" # -%gobuildflags() %{expand:%{gocompilerflags} -tags=\\"rpm_crashtraceback \\" -ldflags \\"${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -compressdwarf=false -extldflags '%__global_ldflags %{?__golang_extldflags}'\\" -a -v -x} +%gobuildflags() %{expand:%{gocompilerflags} -tags=\\"rpm_crashtraceback ${BUILDTAGS:-}\\" -ldflags \\"${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -compressdwarf=false -extldflags '%__global_ldflags %{?__golang_extldflags}'\\" -a -v -x} # Turn off Go modules %gomodulesmode GO111MODULE=off