toolbox/toolbox-Unbreak-downstream-Fedora-CI.patch
Debarshi Ray b78b16e24a Update to 0.0.99.6
Update the compiler and linker flags for RHEL 10 by incorporating the
distribution's defaults from RHEL 10.0 Beta, because RHEL 10.0 is still
early in its development cycle and the defaults may be in a state of
flux.  Some exceptions are mentioned below.

The '-z pack-relative-relocs' linker flag was left out.  It's currently
not supported on s390x, so using it would require architecture specific
patches, which is a hassle.  Support for aarch64 was recently added [1],
so hopefully s390x will also be supported soon.

The change to use the RPM's %{name}, %{version}, %{release} and the
SOURCE_DATE_EPOCH environment variable [2], instead of /dev/urandom, to
generate the build ID annotation for the toolbox(1) binary [3] was left
out.  It will need more work to propagate the RPM's %{name}, %{version}
and %{release} to Meson.

The 'rpminspect --tests=elf' test run by the downstream CI was silenced
because toolbox(1) is only built with the '-z relro' linker flag, but
not '-z now' [4].  Otherwise, it fails with:
  /usr/bin/toolbox lost full GNU_RELRO security protection

Stop carrying the downstream patch for the compiler and linker flags for
PPC64.  The architecture was already discontinued from Fedora 29 [5],
even before the patch was added [6].  It was added purely for the sake
of completeness, and in the last four years since it was introduced, it
hasn't been tested or used.  At this point it's becoming too much of a
maintenance burden, and removing it silences the %ifarch-applied-patch
warning from rpmlint.

Fill in some of the missing Requires for the toolbox-tests sub-package.

[1] CentOS Stream redhat-rpm-config commit 3c5a6b17540b2a0b
    https://gitlab.com/redhat/centos-stream/rpms/redhat-rpm-config/-/commit/3c5a6b17540b2a0b
    https://gitlab.com/redhat/centos-stream/rpms/redhat-rpm-config/-/merge_requests/42
    https://issues.redhat.com/browse/RHEL-40379

[2] https://reproducible-builds.org/docs/source-date-epoch/

[3] go-rpm-macros commit 1980932bf3a21890
    https://pagure.io/go-rpm-macros/c/1980932bf3a21890
    https://fedoraproject.org/wiki/Changes/ReproduciblePackageBuilds

[4] Upstream commit 83f28c52e47c2d44
    https://github.com/containers/toolbox/commit/83f28c52e47c2d44
    https://github.com/containers/toolbox/pull/1548

[5] https://fedoraproject.org/wiki/Changes/DiscontinuePPC64

[6] Fedora toolbox commit ba60453d21
    https://src.fedoraproject.org/rpms/toolbox/c/ba60453d216a9226
    https://src.fedoraproject.org/rpms/toolbox/pull-request/2

Resolves: RHEL-61579
2024-10-04 22:22:54 +02:00

105 lines
2.7 KiB
Diff

From 1e90c721858b3119702b93445f535f9c23af88e6 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <rishi@fedoraproject.org>
Date: Wed, 2 Oct 2024 22:43:37 +0200
Subject: [PATCH] test/system: Unbreak the downstream Fedora CI
The working directory from which bats(1) is invoked might not be part of
the Toolbx container. eg., the downstream Fedora CI invokes the tests
as:
$ cd /path/to/toolbox/test/system
$ bats .
... and it led to:
not ok 8 help: Try unknown command (forwarded to host)
# tags: commands-options
# (from function `assert_line' in file
./libs/bats-assert/src/assert.bash, line 488,
# in test file ./002-help.bats, line 135)
# `assert_line --index 0
"Error: unknown command \"foo\" for \"toolbox\""' failed
#
# -- line differs --
# index : 0
# expected : Error: unknown command "foo" for "toolbox"
# actual : Error: crun: chdir to `/usr/share/toolbox/test/system`:
No such file or directory: OCI runtime attempted to invoke a
command that was not found
# --
#
https://github.com/containers/toolbox/pull/1560
---
test/system/002-help.bats | 2 ++
test/system/501-create.bats | 2 ++
test/system/504-run.bats | 2 ++
test/system/505-enter.bats | 2 ++
4 files changed, 8 insertions(+)
diff --git a/test/system/002-help.bats b/test/system/002-help.bats
index 57e918a04d22..a8bfbc2c79d2 100644
--- a/test/system/002-help.bats
+++ b/test/system/002-help.bats
@@ -25,9 +25,11 @@ setup() {
bats_require_minimum_version 1.10.0
_setup_environment
cleanup_all
+ pushd "$HOME" || return 1
}
teardown() {
+ popd || return 1
cleanup_all
}
diff --git a/test/system/501-create.bats b/test/system/501-create.bats
index 3f50f98e6bf3..cfb676b7001b 100644
--- a/test/system/501-create.bats
+++ b/test/system/501-create.bats
@@ -25,9 +25,11 @@ setup() {
bats_require_minimum_version 1.8.0
_setup_environment
cleanup_all
+ pushd "$HOME" || return 1
}
teardown() {
+ popd || return 1
cleanup_all
}
diff --git a/test/system/504-run.bats b/test/system/504-run.bats
index cc5f6fa8bb09..6ee3e86af1ff 100644
--- a/test/system/504-run.bats
+++ b/test/system/504-run.bats
@@ -25,9 +25,11 @@ setup() {
bats_require_minimum_version 1.8.0
_setup_environment
cleanup_all
+ pushd "$HOME" || return 1
}
teardown() {
+ popd || return 1
cleanup_all
}
diff --git a/test/system/505-enter.bats b/test/system/505-enter.bats
index 405d184f145e..57e58651623d 100644
--- a/test/system/505-enter.bats
+++ b/test/system/505-enter.bats
@@ -25,9 +25,11 @@ setup() {
bats_require_minimum_version 1.8.0
_setup_environment
cleanup_all
+ pushd "$HOME" || return 1
}
teardown() {
+ popd || return 1
cleanup_all
}
--
2.46.1