From 4abed29cd7e01378d4b79e2a708c76c41e1c3f8a Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Wed, 1 Feb 2023 20:23:39 +0530 Subject: [PATCH] [CI:BUILD] copr: fix el8 builds Bump containers-common dependency to match with that in podman.spec.rpkg. qemu-user-static dependency is now handled in containers-common-extra itself. TODO: fix debuginfo for el8. Signed-off-by: Lokesh Mandvekar --- buildah.spec.rpkg | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/buildah.spec.rpkg b/buildah.spec.rpkg index 1b03855bdeb..b3a249b431d 100644 --- a/buildah.spec.rpkg +++ b/buildah.spec.rpkg @@ -9,7 +9,15 @@ # CAUTION: This is not a replacement for RPMs provided by your distro. # Only intended to build and test the latest unreleased changes. +# 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. +# TODO: fix debuginfo for RHEL 8 +%if !0%{?fedora} && 0%{?rhel} <= 8 +%define gobuild(o:) GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x %{?**}; +%global with_debug 0 +%else %global with_debug 1 +%endif %if 0%{?with_debug} %global _find_debuginfo_dwz_opts %{nil} @@ -18,10 +26,6 @@ %global debug_package %{nil} %endif -%if ! 0%{?gobuild:1} -%define gobuild(o:) GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x %{?**}; -%endif - %global provider github %global provider_tld com %global project containers @@ -56,11 +60,7 @@ BuildRequires: shadow-utils-subid-devel %if 0%{?fedora} && ! 0%{?rhel} BuildRequires: btrfs-progs-devel %endif -%if 0%{?fedora} <= 35 -Requires: containers-common >= 4:1-39 -%else -Requires: containers-common-extra -%endif +Requires: containers-common-extra >= 4:1-78 %if 0%{?rhel} BuildRequires: libseccomp-devel %else @@ -68,7 +68,6 @@ BuildRequires: libseccomp-static %endif Requires: libseccomp Suggests: cpp -Suggests: qemu-user-static %description The %{name} package provides a command line tool which can be used to @@ -102,7 +101,6 @@ This package contains system tests for %{name} %build %set_build_flags -export GO111MODULE=off export GOPATH=$(pwd)/_build:$(pwd) export CGO_CFLAGS=$CFLAGS # These extra flags present in $CFLAGS have been skipped for now as they break the build @@ -113,6 +111,7 @@ CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-an %ifarch x86_64 export CGO_CFLAGS+=" -m64 -mtune=generic -fcf-protection=full" %endif + mkdir _build pushd _build mkdir -p src/%{provider}.%{provider_tld}/%{project} @@ -124,9 +123,9 @@ mv vendor src export CNI_VERSION=`grep '^# github.com/containernetworking/cni ' src/modules.txt | sed 's,.* ,,'` export LDFLAGS="-X main.buildInfo=`date +%s` -X main.cniVersion=${CNI_VERSION}" -export BUILDTAGS='seccomp libsubid selinux' +export BUILDTAGS='$(hack/libsubid_tag.sh) seccomp selinux $(hack/systemd_tag.sh)' %if 0%{?rhel} -export BUILDTAGS='$BUILDTAGS exclude_graphdriver_btrfs btrfs_noversion' +export BUILDTAGS="$BUILDTAGS exclude_graphdriver_btrfs btrfs_noversion" %endif %gobuild -o bin/%{name} %{import_path}/cmd/%{name}