-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[master] feat: build Fedora 41 RPM packages (carry #1055) #1058
Merged
thaJeztah
merged 2 commits into
docker:master
from
thaJeztah:carry_1055_enable_f41_builds
Sep 4, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG GO_IMAGE=golang:latest | ||
ARG DISTRO=fedora | ||
ARG SUITE=41 | ||
ARG BUILD_IMAGE=${DISTRO}:${SUITE} | ||
|
||
FROM ${GO_IMAGE} AS golang | ||
|
||
FROM ${BUILD_IMAGE} | ||
ENV GOPROXY=https://proxy.golang.org|direct | ||
ENV GO111MODULE=off | ||
ENV GOPATH=/go | ||
ENV GOTOOLCHAIN=local | ||
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin | ||
ENV AUTO_GOPATH=1 | ||
ARG DISTRO | ||
ARG SUITE | ||
ENV DISTRO=${DISTRO} | ||
ENV SUITE=${SUITE} | ||
RUN dnf install -y rpm-build rpmlint dnf-plugins-core | ||
# FIXME(thaJeztah): workaround for building on Fedora 41 on arm64 | ||
# | ||
# This is the equivalent of https://github.com/docker/containerd-packaging/pull/390 | ||
# for containerd packages, but unlike for containerd packages, we currently do | ||
# not run into this issue when building docker-ce packages. We're installing | ||
# this as a precaution, but perhaps it's not needed. | ||
# | ||
# go1.21 and up have a patch that enforces the use of ld.gold to work around | ||
# a bug in GNU binutils. See; | ||
# - https://github.com/golang/go/issues/22040. | ||
# - https://github.com/golang/go/commit/cd77738198ffe0c4a1db58352c89f9b2d2a4e85e | ||
# | ||
# Fedora 41 and up has a fixed version of binutils, and no longer requires that | ||
# patch, but may fail without ld.gold installed; | ||
# | ||
# /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 | ||
# collect2: fatal error: cannot find 'ld' | ||
# | ||
# Fedora's build of Go carries a patch for that, but it's not (yet) in upstream; | ||
# - https://src.fedoraproject.org/rpms/golang/blob/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77/f/0006-Default-to-ld.bfd-on-ARM64.patch | ||
# - https://src.fedoraproject.org/rpms/golang/c/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77?branch=rawhide | ||
# | ||
# As a workaround; install binutils-gold | ||
RUN if [ "$(arch)" = 'aarch64' ]; then dnf -y install binutils-gold; fi | ||
COPY --link SPECS /root/rpmbuild/SPECS | ||
RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec | ||
COPY --link --from=golang /usr/local/go /usr/local/go | ||
WORKDIR /root/rpmbuild | ||
ENTRYPOINT ["/bin/rpmbuild"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vvoland this one should be ready for review; I pushed a commit to install the
binutils-gold
, but mostly as a precaution; happy to drop it as well (at least made it a separate commit).