From 25929cd9d68218d3be652d2a040494f0b104bc787a9810baf84984cb1eeebb0b Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Thu, 8 Apr 2021 09:01:25 +0000 Subject: [PATCH] Accepting request 883791 from home:cyphar:umoci - Backport patch to fix KIWI which depends on umoci having sane output from "umoci --version". + 0001-makefile-fix-bad-build-flags.patch OBS-URL: https://build.opensuse.org/request/show/883791 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/umoci?expand=0&rev=53 --- 0001-makefile-fix-bad-build-flags.patch | 30 +++++++++++++++++++++++++ umoci.changes | 7 +++--- umoci.spec | 4 ++++ 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 0001-makefile-fix-bad-build-flags.patch diff --git a/0001-makefile-fix-bad-build-flags.patch b/0001-makefile-fix-bad-build-flags.patch new file mode 100644 index 0000000..cec1704 --- /dev/null +++ b/0001-makefile-fix-bad-build-flags.patch @@ -0,0 +1,30 @@ +From ed20cebfec648920c59e0988aceeef7dfd646558 Mon Sep 17 00:00:00 2001 +From: Aleksa Sarai +Date: Thu, 8 Apr 2021 18:55:40 +1000 +Subject: [PATCH] makefile: fix bad build flags + +Fix mistake in the Makefile which prevents the version field (as well as +some other build flags) from being passed to "go build". + +Fixes: 6fbd32e48b66 ("Make Makefile more portable") +Signed-off-by: Aleksa Sarai +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index d760e9289033..1fdcf650f4f9 100644 +--- a/Makefile ++++ b/Makefile +@@ -71,7 +71,7 @@ BASE_LDFLAGS := -s -w -X ${PROJECT}.gitCommit=${COMMIT} -X ${PROJECT}.version=${ + + # Specific build flags for build type. + ifeq ($(GOOS), linux) +- TEST_BUILD_FLAGS := ${BASE_FLAGS} -buildmode=pie -ldflags "${BASE_LDFLAGS} -X ${PROJECT}/pkg/testutils.binaryType=test" DYN_BUILD_FLAGS := ${BASE_FLAGS} -buildmode=pie -ldflags "${BASE_LDFLAGS}" ++ DYN_BUILD_FLAGS := ${BASE_FLAGS} -buildmode=pie -ldflags "${BASE_LDFLAGS}" + TEST_BUILD_FLAGS := ${BASE_FLAGS} -buildmode=pie -ldflags "${BASE_LDFLAGS} -X ${PROJECT}/pkg/testutils.binaryType=test" + else + DYN_BUILD_FLAGS := ${BASE_FLAGS} -ldflags "${BASE_LDFLAGS}" +-- +2.30.2 + diff --git a/umoci.changes b/umoci.changes index 76ec1e7..950ce3c 100644 --- a/umoci.changes +++ b/umoci.changes @@ -17,20 +17,19 @@ Tue Apr 6 11:13:10 UTC 2021 - Aleksa Sarai * umoci now compiles on FreeBSD and appears to work, with the notable limitation that it currently refuses to extract non-Linux images on any platform (this will be fixed in a future release). - * Initial fuzzer implementations for oss-fuzz. - * umoci will now read all trailing data from image layers, to combat the existence of some image generators that appear to append NUL bytes to the end of the gzip stream (which would previously cause checksum failures because we didn't read nor checksum the trailing junk bytes). However, umoci will still not read past the descriptor length. - * umoci now ignores all overlayfs xattrs during unpack and repack operations, to avoid causing issues when packing a raw overlayfs directory. - * For details, see CHANGELOG.md in the package. +- Backport patch to fix KIWI which depends on umoci having sane output from + "umoci --version". + + 0001-makefile-fix-bad-build-flags.patch ------------------------------------------------------------------- Thu Apr 1 05:36:50 UTC 2021 - Aleksa Sarai diff --git a/umoci.spec b/umoci.spec index 270f1fc..b43c755 100644 --- a/umoci.spec +++ b/umoci.spec @@ -29,6 +29,8 @@ URL: https://umo.ci Source0: https://github.com/opencontainers/umoci/releases/download/v%{version}/umoci.tar.xz#/%{name}-%{version}.tar.xz Source1: https://github.com/opencontainers/umoci/releases/download/v%{version}/umoci.tar.xz.asc#/%{name}-%{version}.tar.xz.asc Source2: https://umo.ci/%{name}.keyring +# OPENSUSE-FIX-UPSTREAM: Backport of . +Patch1: 0001-makefile-fix-bad-build-flags.patch BuildRequires: fdupes BuildRequires: go-go-md2man # Due to a limitation in openSUSE's Go packaging we cannot have a BuildRequires @@ -43,6 +45,8 @@ provided by the OCI. %prep %setup -q +# +%patch1 -p1 %build export VERSION="$(cat ./VERSION)"