burrowers / garble

Obfuscate Go builds
BSD 3-Clause "New" or "Revised" License
3.93k stars 248 forks source link

Go 1.21 + darwin_arm64: panic: package runtime/metrics_test is not in std #784

Closed klauspost closed 1 year ago

klauspost commented 1 year ago

What version of Garble and Go are you using?

$ garble version
0.9.3

$ go version
go version go1.21.0 linux/amd64

What environment are you running Garble on?

Github workflow, crosscompile with goreleaser:

https://github.com/klauspost/compress/actions/runs/5818672197/job/15775561583?pr=851

go env
  GO111MODULE=''
  GOARCH='amd64'
  GOBIN=''
  GOCACHE='/home/runner/.cache/go-build'
  GOENV='/home/runner/.config/go/env'
  GOEXE=''
  GOEXPERIMENT=''
  GOFLAGS=''
  GOHOSTARCH='amd64'
  GOHOSTOS='linux'
  GOINSECURE=''
  GOMODCACHE='/home/runner/go/pkg/mod'
  GONOPROXY=''
  GONOSUMDB=''
  GOOS='linux'
  GOPATH='/home/runner/go'
  GOPRIVATE=''
  GOPROXY='https://proxy.golang.org,direct'
  GOROOT='/opt/hostedtoolcache/go/1.21.0/x64'
  GOSUMDB='sum.golang.org'
  GOTMPDIR=''
  GOTOOLCHAIN='auto'
  GOTOOLDIR='/opt/hostedtoolcache/go/1.21.0/x64/pkg/tool/linux_amd64'
  GOVCS=''
  GOVERSION='go1.21.0'
  GCCGO='gccgo'
  GOAMD64='v1'
  AR='ar'
  CC='gcc'
  CXX='g++'
  CGO_ENABLED='0'
  GOMOD='/dev/null'
  GOWORK=''
  CGO_CFLAGS='-O2 -g'
  CGO_CPPFLAGS=''
  CGO_CXXFLAGS='-O2 -g'
  CGO_FFLAGS='-O2 -g'
  CGO_LDFLAGS='-O2 -g'
  PKG_CONFIG='pkg-config'
  GOGCCFLAGS='-fPIC -m64 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build[29](https://github.com/klauspost/compress/actions/runs/5818672197/job/15775561583?pr=851#step:2:30)8886[37](https://github.com/klauspost/compress/actions/runs/5818672197/job/15775561583?pr=851#step:2:38)[43](https://github.com/klauspost/compress/actions/runs/5818672197/job/15775561583?pr=851#step:2:44)=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Upgrade CI to Go 1.21

What did you expect to see?

Compile success.

What did you see instead?

⨯ release failed after 376.45s error=failed to build for darwin_arm64: exit status 1: # runtime
panic: package runtime/metrics_test is not in std (/opt/hostedtoolcache/go/1.21.0/x64/src/runtime/metrics_test)

goroutine 1 [running]:
main.listPackage({0xc0000f3d9d, 0x5})
    /home/runner/go/pkg/mod/mvdan.cc/garble@v0.9.3/shared.go:397 +0x690
main.(*transformer).transformLinkname(0xc0000f3d80?, {0xc0000f3d8e?, 0x4000?}, {0xc0000f3d9d, 0x1c})
    /home/runner/go/pkg/mod/mvdan.cc/garble@v0.9.3/main.go:1096 +0x2e5
main.(*transformer).handleDirectives(0x7ffd8338cb0e?, {0xc0001b6400, 0x69, 0x6?})
    /home/runner/go/pkg/mod/mvdan.cc/garble@v0.9.3/main.go:1043 +0x126
main.transformCompile({0xc0000a4030?, 0xc0000836e0?, 0xc0000202[54](https://github.com/klauspost/compress/actions/runs/5818672197/job/15775561583?pr=851#step:9:55)?})
    /home/runner/go/pkg/mod/mvdan.cc/garble@v0.9.3/main.go:9[60](https://github.com/klauspost/compress/actions/runs/5818672197/job/15775561583?pr=851#step:9:61) +0x8db
main.mainErr({0xc0000a4010, 0xa4, 0x94bc40?})
    /home/runner/go/pkg/mod/mvdan.cc/garble@v0.9.3/main.go:434 +0x838
main.main1()
    /home/runner/go/pkg/mod/mvdan.cc/garble@v0.9.3/main.go:237 +0x177
main.main()
    /home/runner/go/pkg/mod/mvdan.cc/garble@v0.9.3/main.go:137 +0x13
exit status 1
klauspost commented 1 year ago

Rereading, I realized it was picking up an older version.