From 31cbacf3c68a2a9a95a9286176d17a2f52de2a42 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Fri, 17 Apr 2026 14:04:25 -0400 Subject: [PATCH 1/4] RPM: re-add spec file from v1.18.0 Restore rpm/skopeo.spec from the v1.18.0 tag so packit can use it directly instead of fetching from CentOS Stream GitLab, which may be ahead of this release branch. Signed-off-by: Lokesh Mandvekar --- rpm/skopeo.spec | 170 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 rpm/skopeo.spec diff --git a/rpm/skopeo.spec b/rpm/skopeo.spec new file mode 100644 index 0000000000..0c23ce25b8 --- /dev/null +++ b/rpm/skopeo.spec @@ -0,0 +1,170 @@ +%global with_debug 1 + +%if 0%{?with_debug} +%global _find_debuginfo_dwz_opts %{nil} +%global _dwz_low_mem_die_limit 0 +%else +%global debug_package %{nil} +%endif + +%global gomodulesmode GO111MODULE=on + +# No btrfs on RHEL +%if %{defined fedora} +%define build_with_btrfs 1 +%endif + +%if %{defined rhel} +%define fips 1 +%endif + +# Only used in official koji builds +# Copr builds set a separate epoch for all environments +%if %{defined fedora} +%define conditional_epoch 1 +%else +%define conditional_epoch 2 +%endif + +Name: skopeo +%if %{defined copr_username} +Epoch: 102 +%else +Epoch: %{conditional_epoch} +%endif +# DO NOT TOUCH the Version string! +# The TRUE source of this specfile is: +# https://github.com/containers/skopeo/blob/main/rpm/skopeo.spec +# If that's what you're reading, Version must be 0, and will be updated by Packit for +# copr and koji builds. +# If you're reading this on dist-git, the version is automatically filled in by Packit. +Version: 0 +# The `AND` needs to be uppercase in the License for SPDX compatibility +License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 +Release: %autorelease +%if %{defined golang_arches_future} +ExclusiveArch: %{golang_arches_future} +%else +ExclusiveArch: aarch64 ppc64le s390x x86_64 +%endif +Summary: Inspect container images and repositories on registries +URL: https://github.com/containers/%{name} +# Tarball fetched from upstream +Source0: %{url}/archive/v%{version}.tar.gz +BuildRequires: %{_bindir}/go-md2man +%if %{defined build_with_btrfs} +BuildRequires: btrfs-progs-devel +%endif +BuildRequires: git-core +BuildRequires: golang +%if !%{defined gobuild} +BuildRequires: go-rpm-macros +%endif +BuildRequires: gpgme-devel +BuildRequires: libassuan-devel +BuildRequires: ostree-devel +BuildRequires: glib2-devel +BuildRequires: make +BuildRequires: shadow-utils-subid-devel +Requires: containers-common >= 4:1-21 + +%description +Command line utility to inspect images and repositories directly on Docker +registries without the need to pull them + +%package tests +Summary: Tests for %{name} + +Requires: %{name} = %{epoch}:%{version}-%{release} +%if %{defined fedora} +Requires: bats +Requires: fakeroot +%endif +Requires: gnupg +Requires: jq +Requires: golang +Requires: podman +Requires: crun +Requires: httpd-tools +Requires: openssl +Requires: squashfs-tools + +%description tests +%{summary} + +This package contains system tests for %{name} + +%prep +%autosetup -Sgit %{name}-%{version} +# The %%install stage should not rebuild anything but only install what's +# built in the %%build stage. So, remove any dependency on build targets. +sed -i 's/^install-binary: bin\/%{name}.*/install-binary:/' Makefile +sed -i 's/^completions: bin\/%{name}.*/completions:/' Makefile +sed -i 's/^install-docs: docs.*/install-docs:/' Makefile + +%build +%set_build_flags +export CGO_CFLAGS=$CFLAGS + +# These extra flags present in $CFLAGS have been skipped for now as they break the build +CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-flto=auto//g') +CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-Wp,D_GLIBCXX_ASSERTIONS//g') +CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-annobin-cc1//g') + +%ifarch x86_64 +export CGO_CFLAGS="$CGO_CFLAGS -m64 -mtune=generic -fcf-protection=full" +%endif + +BASEBUILDTAGS="$(hack/libsubid_tag.sh)" +%if %{defined build_with_btrfs} +export BUILDTAGS="$BASEBUILDTAGS $(hack/btrfs_tag.sh) $(hack/btrfs_installed_tag.sh)" +%else +export BUILDTAGS="$BASEBUILDTAGS btrfs_noversion exclude_graphdriver_btrfs" +%endif + +%if %{defined fips} +export BUILDTAGS="$BUILDTAGS libtrust_openssl" +%endif + +# unset LDFLAGS earlier set from set_build_flags +LDFLAGS='' + +%gobuild -o bin/%{name} ./cmd/%{name} +%{__make} docs + +%install +make \ + DESTDIR=%{buildroot} \ + PREFIX=%{_prefix} \ + install-binary install-docs install-completions + +# system tests +install -d -p %{buildroot}/%{_datadir}/%{name}/test/system +cp -pav systemtest/* %{buildroot}/%{_datadir}/%{name}/test/system/ + +#define license tag if not already defined +%{!?_licensedir:%global license %doc} + +# Include this to silence rpmlint. +# Especially annoying if you use syntastic vim plugin. +%check + +%files +%license LICENSE +%doc README.md +%{_bindir}/%{name} +%{_mandir}/man1/%{name}* +%dir %{_datadir}/bash-completion +%dir %{_datadir}/bash-completion/completions +%{_datadir}/bash-completion/completions/%{name} +%dir %{_datadir}/fish/vendor_completions.d +%{_datadir}/fish/vendor_completions.d/%{name}.fish +%dir %{_datadir}/zsh/site-functions +%{_datadir}/zsh/site-functions/_%{name} + +%files tests +%license LICENSE vendor/modules.txt +%{_datadir}/%{name}/test + +%changelog +%autochangelog From 288a721b975638fe01d26c0553f6cd88bfe40548 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Wed, 6 May 2026 10:50:46 -0400 Subject: [PATCH 2/4] Packit: use rpm/skopeo.spec as specfile path The spec file is now in the rpm/ directory, so update the path accordingly. Signed-off-by: Lokesh Mandvekar --- .packit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.packit.yaml b/.packit.yaml index b73d0ad6ef..928d71f7e6 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -5,7 +5,7 @@ downstream_package_name: skopeo upstream_tag_template: v{version} -specfile_path: skopeo.spec +specfile_path: rpm/skopeo.spec # Disable automatic merging for Copr builds (and subsequent Testing Farm) merge_pr_in_ci: false From 1a577457828546985374eb52d9773901ab7616d6 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Wed, 6 May 2026 10:51:08 -0400 Subject: [PATCH 3/4] Packit: consolidate copr_build jobs Merge the separate RHEL 9 and RHEL 10 copr_build jobs into a single job with all targets. Since the spec file is now in the repo at rpm/skopeo.spec, we no longer need the post-upstream-clone actions to fetch it from different branches. Signed-off-by: Lokesh Mandvekar --- .packit.yaml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index 928d71f7e6..ff941ff687 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -13,25 +13,15 @@ merge_pr_in_ci: false jobs: - job: copr_build trigger: pull_request - notifications: &packit_failure_notification + notifications: failure_comment: message: "Packit jobs failed. @containers/packit-build please check." - enable_net: true targets: + - epel-9-x86_64 + - epel-9-aarch64 - epel-10-x86_64 - epel-10-aarch64 - actions: - post-upstream-clone: "curl --fail -O https://gitlab.com/redhat/centos-stream/rpms/skopeo/-/raw/c10s/skopeo.spec" - - - job: copr_build - trigger: pull_request - notifications: *packit_failure_notification enable_net: true - targets: - - epel-9-x86_64 - - epel-9-aarch64 - actions: - post-upstream-clone: "curl --fail -O https://gitlab.com/redhat/centos-stream/rpms/skopeo/-/raw/c9s/skopeo.spec" - job: tests trigger: pull_request From 884575fe49c9c0e4cb78bc4f52e0ce645d32f6be Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Wed, 6 May 2026 10:51:59 -0400 Subject: [PATCH 4/4] Packit: split test jobs for better efficiency Split tests into system-tests (needs RPM) and no-rpm-tests (skip_build) to reduce Testing Farm resource usage. Add aarch64 targets and use YAML anchor to avoid duplication. This matches the buildah pattern and fixes Testing Farm failures from PR #2855. Signed-off-by: Lokesh Mandvekar --- .packit.yaml | 53 ++++++++++++++++++++++++++++++++---------------- plans/no-rpm.fmf | 53 +++++++++++++++++++++++++++++------------------- 2 files changed, 67 insertions(+), 39 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index ff941ff687..b592c6f461 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -23,33 +23,50 @@ jobs: - epel-10-aarch64 enable_net: true + # System tests on RHEL 9 and RHEL 10 using internal Testing Farm ranch - job: tests trigger: pull_request + identifier: system-tests use_internal_tf: true - notifications: *packit_failure_notification - targets: - epel-10-x86_64: - distros: [RHEL-10-Nightly,RHEL-10.0-Nightly] - epel-10-aarch64: - distros: [RHEL-10-Nightly,RHEL-10.0-Nightly] + tmt_plan: /plans/system + targets: &rhel_targets epel-9-x86_64: - distros: [RHEL-9-Nightly,RHEL-9.6.0-Nightly] + distros: [RHEL-9.6.0-Nightly] epel-9-aarch64: - distros: [RHEL-9-Nightly,RHEL-9.6.0-Nightly] - tmt_plan: "/plans/system" - identifier: "rpm" + distros: [RHEL-9.6.0-Nightly] + epel-10-x86_64: + distros: [RHEL-10.0-Nightly] + epel-10-aarch64: + distros: [RHEL-10.0-Nightly] + # Validation tests on RHEL 9 and RHEL 10 using internal Testing Farm ranch + # Note: Only x86_64 to avoid toolchain/vendoring issues on aarch64 with newer packages - job: tests trigger: pull_request + identifier: validate-tests use_internal_tf: true - notifications: *packit_failure_notification skip_build: true - targets: - # RHEL-N-Nightly can often have newer toolchain packages, breaking - # vendoring. So, only test on N.Y here - epel-10-x86_64: - distros: [RHEL-10.0-Nightly] + tmt_plan: /plans/no-rpm/validate + targets: &x86_targets epel-9-x86_64: distros: [RHEL-9.6.0-Nightly] - tmt_plan: "/plans/no-rpm" - identifier: "no-rpm" + epel-10-x86_64: + distros: [RHEL-10.0-Nightly] + + # Unit tests on RHEL 9 and RHEL 10 using internal Testing Farm ranch + - job: tests + trigger: pull_request + identifier: unit-tests + use_internal_tf: true + skip_build: true + tmt_plan: /plans/no-rpm/unit + targets: *x86_targets + + # Integration tests on RHEL 9 and RHEL 10 using internal Testing Farm ranch + - job: tests + trigger: pull_request + identifier: integration-tests + use_internal_tf: true + skip_build: true + tmt_plan: /plans/no-rpm/integration + targets: *x86_targets diff --git a/plans/no-rpm.fmf b/plans/no-rpm.fmf index 31da4d05b1..5cf1b7b842 100644 --- a/plans/no-rpm.fmf +++ b/plans/no-rpm.fmf @@ -1,23 +1,34 @@ -prepare: - - name: dependencies - how: install - package: [ golang, go-md2man, gpgme-devel, podman-docker ] +/: + summary: Common configuration for no-rpm tests + prepare: + - name: dependencies + how: install + package: [ golang, go-md2man, gpgme-devel, podman-docker ] + discover: + keep-git-metadata: true + how: shell + execute: + how: tmt -discover: - keep-git-metadata: true - how: shell - tests: - - name: /validate - test: > - make tools && - make BUILDTAGS="exclude_graphdriver_btrfs" validate-local && - make validate-docs && - make vendor && - hack/tree_status.sh - - name: /integration - test: make BUILDTAGS="exclude_graphdriver_btrfs" test-integration - - name: /unit - test: make BUILDTAGS="exclude_graphdriver_btrfs" test-unit-local +/validate: + discover+: + tests: + - name: /validate + test: > + make tools && + make BUILDTAGS="exclude_graphdriver_btrfs" validate-local && + make validate-docs && + make vendor && + hack/tree_status.sh -execute: - how: tmt +/unit: + discover+: + tests: + - name: /unit + test: make BUILDTAGS="exclude_graphdriver_btrfs" test-unit-local + +/integration: + discover+: + tests: + - name: /integration + test: make BUILDTAGS="exclude_graphdriver_btrfs" test-integration