Skip to content

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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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.
@DasSkelett DasSkelett force-pushed the fix/runc-xsys-go118 branch from 76fac73 to 5c7661f Compare March 20, 2022 15:09
@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