From 191406d35bd074600c8af59ebf40d05cdc2fd8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Tue, 26 Sep 2023 13:46:24 +0200 Subject: [PATCH] SPEC: enable default Go modules behavior on Fedora MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It turns out, that Fedora Go RPM macros are disabling the Go modules support by default for all builds. The reason seems to be the worry that some Go macros may not support it. However, it is not disabled by default on CentOS Stream or RHEL and the package builds just fine. On Fedora, undefine the macro which explicitly passes `GO111MODULE=off` to each build, to use the default compiler behavior instead. Additional relevant info: https://pagure.io/go-rpm-macros/c/35bd72648fe6cfa372f886b5692936ffb5b4389a https://pagure.io/go-rpm-macros/c/df8452a5df762d8df1e871a103bc05a58c24cb8d Signed-off-by: Tomáš Hozza --- osbuild-composer.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osbuild-composer.spec b/osbuild-composer.spec index 5a412af1d..96be53b58 100644 --- a/osbuild-composer.spec +++ b/osbuild-composer.spec @@ -78,6 +78,11 @@ export PATH=$PWD/_bin${PATH:+:$PATH} export GOPATH=$GO_BUILD_PATH:%{gopath} export GOFLAGS+=" -mod=vendor" %endif +%if 0%{?fedora} +# Fedora disables Go modules by default, but we want to use them. +# Undefine the macro which disables it to use the default behavior. +%undefine gomodulesmode +%endif # Set the commit hash so that composer can report what source version # was used to build it. This has to be set explicitly when calling rpmbuild,