Skip to content

Commit

Permalink
Support Fedora 41 in Dockerfile
Browse files Browse the repository at this point in the history
This is needed for "make check" to work on a Fedora 41 host where the
FROM directive is overridden to fedora:41.

- Drop the workaround for gdb-headless on F41, it's no longer available
  there and the bug is fixed on F40+:
  https://bugzilla.redhat.com/show_bug.cgi?id=2310156

- Don't try to remove rpm-sign-libs and python3-rpm on F41 since dnf5 no
  longer pulls them in.

- Make sure to call "dnf clean all" before "rpm -e" as python3-rpm is
  needed by dnf4 to function (hence the duplicated call).

- Add a comment at the top saying which Fedora versions are supported by
  the Dockerfile.  This could be checked automatically during cmake
  config but let's leave that for later.

- Detect F41 vs. older by looking for the dnf5 binary, it's the easiest
  way.
  • Loading branch information
dmnks authored and ffesti committed Oct 31, 2024
1 parent bf2c1c3 commit 78cecdc
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tests/Dockerfile.fedora
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Supported Fedora releases: 39 40 41
FROM registry.fedoraproject.org/fedora:40 AS base
MAINTAINER [email protected]

Expand Down Expand Up @@ -46,27 +47,34 @@ RUN dnf -y install \
tar unzip gzip bzip2 cpio xz p7zip \
pkgconfig \
/usr/bin/systemd-sysusers \
"gdb-headless < 15" \
dwz \
fsverity-utils fsverity-utils-devel \
pandoc \
sequoia-sq \
libasan \
libubsan \
&& dnf clean all
libubsan

RUN echo "%_dbpath $(rpm --eval '%_dbpath')" > /root/.rpmmacros

# Workaround for pkgconf(1)'s unlisted dependency on rpm.
# This is needed for cmake to work without an rpm installation.
RUN ln -sf $(rpm --eval '%{_target_platform}%{?_gnu}')-pkg-config \
/usr/bin/pkg-config

# F40 and older (no dnf5) require special handling
RUN if which dnf5; then \
dnf -y install gdb-headless; \
dnf clean all; \
else \
dnf -y install "gdb-headless < 15"; \
dnf clean all; \
rpm -e --nodeps --nodb rpm-sign-libs python3-rpm; \
fi

RUN rpm -e --nodeps --nodb \
rpm \
rpm-libs \
rpm-build-libs \
rpm-sign-libs \
python3-rpm
rpm-build-libs

WORKDIR /
CMD /bin/bash
Expand Down

0 comments on commit 78cecdc

Please sign in to comment.