opencontainers / runc

CLI tool for spawning and running containers according to the OCI specification
https://www.opencontainers.org/
Apache License 2.0
11.58k stars 2.06k forks source link

rlimit hack won't work with Go 1.23 #4287

Open kolyshkin opened 1 month ago

kolyshkin commented 1 month ago

Description

It is no longer possible to compile runc with rlimit hack from PR #4268 with Go 1.23 (devel at the moment):

[kir@kir-tp1 runc]$ echo $GO; $GO version
/home/kir/git/golang/go/bin/go
go version devel go1.23-1a349fc92b Tue May 21 19:45:20 2024 +0000 linux/amd64
[kir@kir-tp1 runc]$ GO=$GO make all
rm -f libcontainer/dmz/binary/runc-dmz
/home/kir/git/golang/go/bin/go generate -tags "seccomp urfave_cli_no_docs " ./libcontainer/dmz
make[1]: Entering directory '/home/kir/git/runc/libcontainer/dmz'
gcc -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib -lgcc -static -o binary/runc-dmz _dmz.c
strip -gs binary/runc-dmz
make[1]: Leaving directory '/home/kir/git/runc/libcontainer/dmz'
/home/kir/git/golang/go/bin/go build -trimpath "-buildmode=pie"  -tags "seccomp urfave_cli_no_docs " -ldflags "-X main.gitCommit=v1.2.0-rc.1-54-g45d37ac7 -X main.version=1.2.0-rc.1+dev " -o runc .
# github.com/opencontainers/runc
link: github.com/opencontainers/runc/libcontainer/system: invalid reference to syscall.origRlimitNofile
make: *** [Makefile:71: runc-bin] Error 1

Go 1.23 explicitly disabled such hacks in a few PRs, in our case the relevant ones are:

kolyshkin commented 1 month ago

Being fixed by