Skip to content

Commit 5e90bd3

Browse files
authored
Merge pull request #1058 from thaJeztah/carry_1055_enable_f41_builds
[master] feat: build Fedora 41 RPM packages (carry #1055)
2 parents 3137193 + 563068b commit 5e90bd3

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

Jenkinsfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def pkgs = [
88
[target: "debian-bookworm", image: "debian:bookworm", arches: ["amd64", "aarch64", "armhf"]], // Debian 12 (Next stable)
99
[target: "fedora-39", image: "fedora:39", arches: ["amd64", "aarch64"]], // EOL: November 12, 2024
1010
[target: "fedora-40", image: "fedora:40", arches: ["amd64", "aarch64"]], // EOL: May 13, 2025
11+
[target: "fedora-41", image: "fedora:41", arches: ["amd64", "aarch64"]], // EOL: November, 2025
1112
[target: "raspbian-bullseye", image: "balenalib/rpi-raspbian:bullseye", arches: ["armhf"]], // Debian/Raspbian 11 (stable)
1213
[target: "raspbian-bookworm", image: "balenalib/rpi-raspbian:bookworm", arches: ["armhf"]], // Debian/Raspbian 12 (next stable)
1314
[target: "ubuntu-focal", image: "ubuntu:focal", arches: ["amd64", "aarch64", "armhf"]], // Ubuntu 20.04 LTS (End of support: April, 2025. EOL: April, 2030)

rpm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ RUN?=docker run --rm \
6161
$(RUN_FLAGS) \
6262
rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS)
6363

64-
FEDORA_RELEASES ?= fedora-40 fedora-39
64+
FEDORA_RELEASES ?= fedora-39 fedora-40 fedora-41
6565
CENTOS_RELEASES ?= centos-9
6666
RHEL_RELEASES ?= rhel-8 rhel-9
6767

rpm/fedora-41/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# syntax=docker/dockerfile:1
2+
3+
ARG GO_IMAGE=golang:latest
4+
ARG DISTRO=fedora
5+
ARG SUITE=41
6+
ARG BUILD_IMAGE=${DISTRO}:${SUITE}
7+
8+
FROM ${GO_IMAGE} AS golang
9+
10+
FROM ${BUILD_IMAGE}
11+
ENV GOPROXY=https://proxy.golang.org|direct
12+
ENV GO111MODULE=off
13+
ENV GOPATH=/go
14+
ENV GOTOOLCHAIN=local
15+
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
16+
ENV AUTO_GOPATH=1
17+
ARG DISTRO
18+
ARG SUITE
19+
ENV DISTRO=${DISTRO}
20+
ENV SUITE=${SUITE}
21+
RUN dnf install -y rpm-build rpmlint dnf-plugins-core
22+
# FIXME(thaJeztah): workaround for building on Fedora 41 on arm64
23+
#
24+
# This is the equivalent of https://github.com/docker/containerd-packaging/pull/390
25+
# for containerd packages, but unlike for containerd packages, we currently do
26+
# not run into this issue when building docker-ce packages. We're installing
27+
# this as a precaution, but perhaps it's not needed.
28+
#
29+
# go1.21 and up have a patch that enforces the use of ld.gold to work around
30+
# a bug in GNU binutils. See;
31+
# - https://github.com/golang/go/issues/22040.
32+
# - https://github.com/golang/go/commit/cd77738198ffe0c4a1db58352c89f9b2d2a4e85e
33+
#
34+
# Fedora 41 and up has a fixed version of binutils, and no longer requires that
35+
# patch, but may fail without ld.gold installed;
36+
#
37+
# /usr/bin/gcc -Wl,-z,now -Wl,-z,nocopyreloc -fuse-ld=gold -o $WORK/b001/exe/a.out -rdynamic /tmp/go-link-1738353519/go.o /tmp/go-link-1738353519/000000.o /tmp/go-link-1738353519/000001.o /tmp/go-link-1738353519/000002.o /tmp/go-link-1738353519/000003.o /tmp/go-link-1738353519/000004.o /tmp/go-link-1738353519/000005.o /tmp/go-link-1738353519/000006.o /tmp/go-link-1738353519/000007.o /tmp/go-link-1738353519/000008.o /tmp/go-link-1738353519/000009.o /tmp/go-link-1738353519/000010.o /tmp/go-link-1738353519/000011.o /tmp/go-link-1738353519/000012.o /tmp/go-link-1738353519/000013.o /tmp/go-link-1738353519/000014.o /tmp/go-link-1738353519/000015.o /tmp/go-link-1738353519/000016.o /tmp/go-link-1738353519/000017.o /tmp/go-link-1738353519/000018.o /tmp/go-link-1738353519/000019.o /tmp/go-link-1738353519/000020.o /tmp/go-link-1738353519/000021.o /tmp/go-link-1738353519/000022.o /tmp/go-link-1738353519/000023.o /tmp/go-link-1738353519/000024.o -O2 -g -lresolv -O2 -g -lpthread -O2 -g -ldl -O2 -g
38+
# collect2: fatal error: cannot find 'ld'
39+
#
40+
# Fedora's build of Go carries a patch for that, but it's not (yet) in upstream;
41+
# - https://src.fedoraproject.org/rpms/golang/blob/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77/f/0006-Default-to-ld.bfd-on-ARM64.patch
42+
# - https://src.fedoraproject.org/rpms/golang/c/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77?branch=rawhide
43+
#
44+
# As a workaround; install binutils-gold
45+
RUN if [ "$(arch)" = 'aarch64' ]; then dnf -y install binutils-gold; fi
46+
COPY --link SPECS /root/rpmbuild/SPECS
47+
RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec
48+
COPY --link --from=golang /usr/local/go /usr/local/go
49+
WORKDIR /root/rpmbuild
50+
ENTRYPOINT ["/bin/rpmbuild"]

0 commit comments

Comments
 (0)