Skip to content

Commit

Permalink
Merge pull request #4234 from cyphar/go122
Browse files Browse the repository at this point in the history
[hotfix] nsenter: refuse to build with Go 1.22
  • Loading branch information
kolyshkin authored Apr 2, 2024
2 parents ea38465 + e377e16 commit 4641f17
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
- name: install go
uses: actions/setup-go@v5
with:
go-version: 1.x # Latest stable
go-version: 1.21.x # TODO: switch to 1.x (latest stable) once Go 1.22 vs glibc issue is fixed.

- name: unit test
env:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

> **NOTE**: runc currently will not work properly when compiled with Go 1.22 or
> newer. This is due to some unfortunate glibc behaviour that Go 1.22
> exacerbates in a way that results in containers not being able to start on
> some systems. [See this issue for more information.][runc-4233].
### Deprecated

* `runc` option `--criu` is now ignored (with a warning), and the option will
Expand Down Expand Up @@ -47,6 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Remove tun/tap from the default device rules. (#3468)
* specconv: avoid mapping "acl" to MS_POSIXACL. (#3739)

[runc-4233]: https://github.com/opencontainers/runc/issues/4233

## [1.1.8] - 2023-07-20

> 海纳百川 有容乃大
Expand Down
15 changes: 15 additions & 0 deletions libcontainer/nsenter/nsenter_go122.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//go:build go1.22

package nsenter

/*
// We know for sure that glibc has issues with pthread_self() when called from
// Go after nsenter has run. This is likely a more general problem with how we
// ignore the rules in signal-safety(7), and so it's possible musl will also
// have issues, but as this is just a hotfix let's only block glibc builds.
#include <features.h>
#ifdef __GLIBC__
# error "runc does not currently work properly with Go >=1.22. See <https://github.com/opencontainers/runc/issues/4233>."
#endif
*/
import "C"

0 comments on commit 4641f17

Please sign in to comment.