| |
@@ -31,12 +31,15 @@
|
| |
#
|
| |
%gobuildflags() %{expand:%{gocompilerflags} -tags=\\"rpm_crashtraceback \\" -ldflags \\"${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'\\" -a -v -x}
|
| |
|
| |
+ # Turn off Go modules
|
| |
+ %gomodulesmode GO111MODULE=off
|
| |
+
|
| |
# Define commands for building
|
| |
# BUILD_ID can be generated for golang build no matter of debuginfo
|
| |
%gobuild(o:) %{expand:
|
| |
# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
|
| |
%global _dwz_low_mem_die_limit 0
|
| |
- %{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} GO111MODULE=off \\
|
| |
+ %{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} %{?gomodulesmode} \\
|
| |
go build %{?gocompilerflags} -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**};
|
| |
}
|
| |
${workroot}${GOPATH:+:${GOPATH}}
|
| |
@@ -44,4 +47,4 @@
|
| |
# Define commands for testing
|
| |
%gotestflags %{gocompilerflags}
|
| |
%gotestextldflags %__global_ldflags %{?__golang_extldflags}
|
| |
- %gotest() GO111MODULE=off go test %{gotestflags} -ldflags "${LDFLAGS:-}%{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**};
|
| |
+ %gotest() %{?gomodulesmode} go test %{gotestflags} -ldflags "${LDFLAGS:-}%{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**};
|
| |
Having this unconditionally disabled without some way to change it
causes more heartache for downstream users than necessary.
It doesn't hurt to make it default to disable it while providing a
way for downstream users who need the Go module features (e.g. in COPR)
to be able to use them.