From e973d15c35b00378915d6c12e18cb532cf3d24b4 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Fri, 28 Jul 2023 14:01:17 -0400 Subject: [PATCH 1/4] [CI:BUILD] RPM: define gobuild macro for rhel/centos stream The current gobuild macro doesn't account for build tags on both c9s and c8s. This is currently causing copr build failures for c9s. Ref: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/build/6220412/ This commit will define gobuild for all those envs until gobuild is fixed by default. Refs: c9s bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227328 c8s bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227331 [NO NEW TESTS NEEDED] Signed-off-by: Lokesh Mandvekar --- rpm/podman.spec | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rpm/podman.spec b/rpm/podman.spec index 6092b3b4f1..ba000f1767 100644 --- a/rpm/podman.spec +++ b/rpm/podman.spec @@ -7,12 +7,18 @@ %global debug_package %{nil} %endif -# RHEL 8's default %%gobuild macro doesn't account for the BUILDTAGS variable, so we -# set it separately here and do not depend on RHEL 8's go-srpm-macros package. -%if %{defined rhel} && 0%{?rhel} == 8 +# RHEL's default %%gobuild macro doesn't account for the BUILDTAGS variable, so we +# set it separately here and do not depend on RHEL's go-[s]rpm-macros package +# until that's fixed. +# c9s bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227328 +# c8s bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227331 +%if %{defined rhel} %define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**}; +# python3 dep conditional for rhel8 +%if %{?rhel} == 8 %define rhel8py3 1 %endif +%endif %global gomodulesmode GO111MODULE=on From 663fe9446b1f0983c451010a6d3ba081e80a4317 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Sat, 29 Jul 2023 07:08:47 -0400 Subject: [PATCH 2/4] Mention no comment lines in Containerfile.in podman-build man page Fixes: https://github.com/containers/podman/issues/13070 Signed-off-by: Daniel J Walsh --- docs/source/markdown/podman-build.1.md.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/markdown/podman-build.1.md.in b/docs/source/markdown/podman-build.1.md.in index eeaaac6b29..0bd702aa50 100644 --- a/docs/source/markdown/podman-build.1.md.in +++ b/docs/source/markdown/podman-build.1.md.in @@ -23,8 +23,10 @@ directory, Podman uses the Containerfile's parent directory as its build context Containerfiles ending with a ".in" suffix are preprocessed via CPP(1). This can be useful to decompose Containerfiles into several reusable parts that can -be used via CPP's **#include** directive. Notice, a Containerfile.in file can -still be used by other tools when manually preprocessing them via `cpp -E`. +be used via CPP's **#include** directive. Containerfiles ending in .in, are +restricted to no comment lines unless they are CPP commands. +Note, a Containerfile.in file can still be used by other tools when manually +preprocessing them via `cpp -E`. When the URL is an archive, the contents of the URL is downloaded to a temporary location and extracted before execution. From e1114f03ce4cb1b54528a390afd72cedf02fbe3f Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Mon, 31 Jul 2023 14:55:52 -0400 Subject: [PATCH 3/4] do not redefine gobuild for eln Signed-off-by: Lokesh Mandvekar --- rpm/podman.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm/podman.spec b/rpm/podman.spec index ba000f1767..fc8c14e6eb 100644 --- a/rpm/podman.spec +++ b/rpm/podman.spec @@ -12,7 +12,7 @@ # until that's fixed. # c9s bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227328 # c8s bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227331 -%if %{defined rhel} +%if %{defined rhel} && !%{defined eln} %define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**}; # python3 dep conditional for rhel8 %if %{?rhel} == 8 From 6930f39a661de4356bd2a57c9e54de43689a22c3 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 31 Jul 2023 15:20:58 -0400 Subject: [PATCH 4/4] Update docs/source/markdown/podman-build.1.md.in Co-authored-by: Valentin Rothberg Signed-off-by: Daniel J Walsh --- docs/source/markdown/podman-build.1.md.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/markdown/podman-build.1.md.in b/docs/source/markdown/podman-build.1.md.in index 0bd702aa50..5397c4149d 100644 --- a/docs/source/markdown/podman-build.1.md.in +++ b/docs/source/markdown/podman-build.1.md.in @@ -23,7 +23,7 @@ directory, Podman uses the Containerfile's parent directory as its build context Containerfiles ending with a ".in" suffix are preprocessed via CPP(1). This can be useful to decompose Containerfiles into several reusable parts that can -be used via CPP's **#include** directive. Containerfiles ending in .in, are +be used via CPP's **#include** directive. Containerfiles ending in .in are restricted to no comment lines unless they are CPP commands. Note, a Containerfile.in file can still be used by other tools when manually preprocessing them via `cpp -E`.