Skip to content

Commit 7eefff3

Browse files
chore: restore CentOS Stream targets in Packit config
Re-enable centos-stream-9 and centos-stream-10 targets for copr_build and tests jobs. go-vendor-tools is now available via EPEL for both platforms: - EPEL 9: go-vendor-tools-0.12.0-1.el9 - EPEL 10.1: go-vendor-tools-0.12.0-1.el10_1 Add EPEL additional_repos for CentOS Stream targets so the mock buildroot can find go-vendor-tools during COPR builds. Add generic Go version workaround to spec %prep section to handle cases where the system Go has an older patch version than what go.mod requires (e.g., CentOS Stream Go 1.26.7 vs go.mod 1.26.8). Uses go\K regex anchor for reliable version extraction. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
1 parent 557730d commit 7eefff3

2 files changed

Lines changed: 29 additions & 14 deletions

File tree

.packit.yaml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,31 @@ jobs:
2525
- job: copr_build
2626
trigger: pull_request
2727
targets:
28-
- fedora-rawhide-x86_64
29-
- fedora-45-x86_64
30-
- fedora-44-x86_64
31-
- fedora-43-x86_64
32-
# CentOS Stream targets removed: go-vendor-tools is not
33-
# available in CentOS Stream repos. Restore when the
34-
# tooling becomes available on those platforms.
28+
fedora-rawhide-x86_64: {}
29+
fedora-45-x86_64: {}
30+
fedora-44-x86_64: {}
31+
fedora-43-x86_64: {}
32+
centos-stream-10-x86_64:
33+
additional_repos:
34+
- https://dl.fedoraproject.org/pub/epel/10/Everything/x86_64/
35+
centos-stream-9-x86_64:
36+
additional_repos:
37+
- https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/
3538

3639
# Running tests using testing farm https://packit.dev/docs/configuration/upstream/tests
3740
- job: tests
3841
trigger: pull_request
3942
targets:
40-
- fedora-rawhide-x86_64
41-
- fedora-45-x86_64
42-
- fedora-44-x86_64
43-
- fedora-43-x86_64
44-
# CentOS Stream targets removed: go-vendor-tools is not
45-
# available in CentOS Stream repos. Restore when the
46-
# tooling becomes available on those platforms.
43+
fedora-rawhide-x86_64: {}
44+
fedora-45-x86_64: {}
45+
fedora-44-x86_64: {}
46+
fedora-43-x86_64: {}
47+
centos-stream-10-x86_64:
48+
additional_repos:
49+
- https://dl.fedoraproject.org/pub/epel/10/Everything/x86_64/
50+
centos-stream-9-x86_64:
51+
additional_repos:
52+
- https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/
4753

4854
# https://packit.dev/docs/fedora-releases-guide
4955
# Propose Downstream PRs once a Upstream release is out

complyctl.spec

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ Providers are distributed separately via the complytime-providers package.
3838
%setup -q -T -D -a1 %{forgesetupargs}
3939
%autopatch -p1
4040

41+
# Lower the go.mod directive to match the system Go version so
42+
# rpmbuild succeeds with GOTOOLCHAIN=local. This handles cases where
43+
# the system Go has the same major.minor but an older patch version
44+
# than what go.mod requires (e.g., system Go 1.26.7 vs go.mod 1.26.8).
45+
# Reference: https://packages.fedoraproject.org/pkgs/golang/golang/
46+
SYSTEM_GO_VERSION=$(go version | grep -oP 'go\K[0-9]+\.[0-9]+\.[0-9]+')
47+
sed -i "s/^go [0-9].*/go ${SYSTEM_GO_VERSION}/" go.mod
48+
sed -i "/^## explicit; go /s/go [0-9]\..*/go ${SYSTEM_GO_VERSION}/" vendor/modules.txt
49+
4150
%generate_buildrequires
4251
%go_vendor_license_buildrequires -c %{S:2}
4352

0 commit comments

Comments
 (0)