Skip to content
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

[release/1.6 backport] deb, rpm: fix runc using incorrect version #386

Draft
wants to merge 7 commits into
base: release/1.6
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Aug 6, 2024

Both containerd and runc have been a module for some time now, and all
the branches we care about are a module, so there's no need to set the
GO111MODULE env-var.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9f2a5d2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The official docker image now have GOTOOLCHAIN=local set by default,
so for stages where we build inside that image, we can remove it;

    docker image inspect --format='{{ json .Config.Env }}' golang:1.21.11 | jq .
    [
      "PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
      "GOLANG_VERSION=1.21.11",
      "GOTOOLCHAIN=local",
      "GOPATH=/go"
    ]

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b062731)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah self-assigned this Aug 6, 2024
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 <github@gone.nl>
(cherry picked from commit 7fcb9f7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This condition was added 5 Years ago in c08bd94
because older versions had some issues.

CentOS 7 currently installs `2:2.119.2-1.911c772.el7_8`, and CentOS 9 stream
has `3:2.231.0-1.el9`; both are higher than the minimum version specified,
so let's remove the condition.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 018d28e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use more current versions of distros in the examples, because CentOS 7
will reach EOL soon, and there's a new Ubuntu LTS release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0737507)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Replace some for their equivalent macros. See the [rpm docs for Fedora][1]

- `%{_builddir}` is the equivalent of `%{_topdir}/BUILD`
- `%{_sourcedir}` is the equivalent of `%{_topdir}/SOURCES`

[1]: https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/#_macros_set_for_the_rpm_and_srpm_build_process

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4fd01c2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
runc v1.1.13 introduced an option to customize the version (as printed by the
`--version` flag) through a `VERSION` Make variable / environment variable
(see [1]).

This variable collided with the `VERSION` environment variable used by
containerd for the same purpose, which lead to `runc` binaries built
using the version of containerd;

    runc --version
    runc version 1.7.20
    commit: v1.1.13-0-g58aa9203
    ...

This patch explicitly sets the `VERSION` variable to the version of
runc being built when building the binary.

[1]: opencontainers/runc@6f4d975

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1d9c0d6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the 1.6_backport_fix_runc_version branch from d0a8778 to 8ef2340 Compare August 6, 2024 22:32
@thaJeztah
Copy link
Member Author

Hm... still not sure why this branch started failing on the brtfs bits; not sure what changed that caused it to miss the dependency;

#24 102.4 # github.com/containerd/btrfs
#24 102.4 vendor/github.com/containerd/btrfs/btrfs.go:21:10: fatal error: btrfs/ioctl.h: No such file or directory
#24 102.4    21 | #include <btrfs/ioctl.h>
#24 102.4       |          ^~~~~~~~~~~~~~~
#24 102.4 compilation terminated.

Comment on lines -5 to -8
# 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 ,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be why 👀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 I started with only the first two commits, then thought "we no longer do rhel/centos7 so let me pick those commits as well.

Got myself to blame for not mentioning that those also assumed containerd 1.7, and I didn't look here because another PR also started failing on the btrfs headers 🙈

%if %{undefined rhel} || 0%{?rhel} < 8
%if %{defined suse_version}
# SUSE flavors
BuildRequires: libbtrfs-devel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, here too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants