Skip to content

Commit

Permalink
disable btrfs for all CentOS/RHEL versions
Browse files Browse the repository at this point in the history
Now that we no longer have to take 1.5/1.6 into account, we must
unconditionally disable brtfs for CentOS and RHEL, as no version
provides the Linux kernel headers for btrfs

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Jun 11, 2024
1 parent b062731 commit 7fcb9f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 29 deletions.
6 changes: 1 addition & 5 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ Source: containerd.io
Section: devel
Priority: optional
Maintainer: Containerd team <[email protected]>
# btrfs dependencies no longer needed for containerd 1.7 and up, which now
# uses the Linux kernel headers for this.
# TODO(thaJeztah): remove btrfs build-dependencies once containerd 1.6 reaches EOL.
Build-Depends: libbtrfs-dev | btrfs-tools ,
debhelper (>= 10~) | dh-systemd,
Build-Depends: debhelper (>= 10~) | dh-systemd,
pkg-config,
libseccomp-dev
Standards-Version: 4.1.4
Expand Down
30 changes: 6 additions & 24 deletions rpm/containerd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,6 @@ BuildRequires: gcc
BuildRequires: systemd
BuildRequires: libseccomp-devel

# containerd 1.7.x now use Linux kernel headers for btrfs, so we only
# need this dependency when building older (1.5.x, 1.6.x) releases.
# TODO(thaJeztah): remove btrfs build-dependencies once containerd 1.6 reaches EOL.
%if "%{major_minor}" == "1.6" || "%{major_minor}" == "1.5"
%if %{undefined rhel} || 0%{?rhel} < 8
%if %{defined suse_version}
# SUSE flavors
BuildRequires: libbtrfs-devel
%else
# Fedora / others, and CentOS/RHEL < 8
BuildRequires: btrfs-progs-devel
%endif
%endif
%endif

%{?systemd_requires}

%description
Expand Down Expand Up @@ -116,17 +101,14 @@ cd %{_topdir}/BUILD
make man

BUILDTAGS=""
%if %{defined rhel} && 0%{?rhel} >= 8
# btrfs support was removed in CentOS/RHEL 8
BUILDTAGS="${BUILDTAGS} no_btrfs"
%else
# TODO(thaJeztah): remove this block once 1.5.x and 1.6.x reach EOL.
%if %{defined rhel} && 0%{?rhel} >= 7 && "%{major_minor}" != "1.6" && "%{major_minor}" != "1.5"
# containerd 1.7.x now use linux kernel headers for btrfs, which is not
# provided by CentOS/RHEL 7, so don't build with btrfs for 1.7+.

# TODO(thaJeztah): can we remove the version compare, or would that exclude other RHEL derivatives (Fedora, etc)?
%if %{defined rhel} && 0%{?rhel} >= 7
# btrfs support was removed in CentOS/RHEL 8, and containerd 1.7+ uses
# linux kernel headers for btrfs, which are not provided by CentOS/RHEL 7
# so build without btrfs support for any CentOS/RHEL version.
BUILDTAGS="${BUILDTAGS} no_btrfs"
%endif
%endif

make -C /go/src/%{import_path} VERSION=%{getenv:VERSION} REVISION=%{getenv:REF} PACKAGE=%{getenv:PACKAGE} BUILDTAGS="${BUILDTAGS}"

Expand Down

0 comments on commit 7fcb9f7

Please sign in to comment.