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

Update runc to 1.1.0 to get newer x/sys and fix Go 1.18 build #292

Merged
merged 2 commits into from
Mar 23, 2022

Conversation

DasSkelett
Copy link
Contributor

Problem

Due to the outdated indirect golang.org/x/sys dependency the build is broken on Darwin with Go 1.18.
See for example: https://github.com/Homebrew/homebrew-core/runs/5508152735?check_suite_focus=true#step:10:6143

  ==> Cloning https://github.com/bcicen/ctop.git
  Updating /Users/brew/Library/Caches/Homebrew/ctop--git
  ==> Checking out tag 0.7.6
  HEAD is now at 8f0c9f5 v0.7.6
  HEAD is now at 8f0c9f5 v0.7.6
  ==> make build
  Last 150 lines from /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/ctop/01.make:
  2022-03-11 12:24:11 +0000
  
  make
  build
  
  go mod download
  CGO_ENABLED=0 go build -tags release -ldflags "-w -X main.version=0.7.6 -X main.build=8f0c9f5" -o ctop
  # golang.org/x/sys/unix
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/zsyscall_darwin_amd64.1_13.go:27:3: //go:linkname must refer to declared function or variable
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/zsyscall_darwin_amd64.1_13.go:40:3: //go:linkname must refer to declared function or variable
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/sys@v0.0.0-20200728102440-3e129f6d46b1/unix/zsyscall_darwin_amd64.go:121:3: too many errors
  make: *** [build] Error 2

Changes

While runc says it only works with Go 1.16+, basic testing with an image built from the Dockerfile shows that it still works fine at 1.15, so I left the go directive as is for now. But issues might turn up that require bumping it to 1.16 or even 1.17.

...to fix building on Darwin with Go 1.18.

This required some code changes as opencontainers unfortunately introduced breaking changes in a minor revision.
However, those changes were to simpify the libcontainer factory initialization.
@bcicen bcicen merged commit 163060b into bcicen:master Mar 23, 2022
@bcicen
Copy link
Owner

bcicen commented Mar 23, 2022

merged; thanks @DasSkelett !

@DasSkelett DasSkelett deleted the fix/runc-xsys-go118 branch March 23, 2022 18:08
@DasSkelett
Copy link
Contributor Author

Nice!
The CI failure sounds like it can in fact no longer be compiled with Go 1.15, not sure why I haven't hit this when building the image locally.

@bcicen
Copy link
Owner

bcicen commented Mar 24, 2022

all updated and passing now on 1.18 👍

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