Open
Description
Go version
go version go1.22.4 darwin/arm64
Output of go env
in your module/workspace:
GO111MODULE='auto'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/romain.marcadier/Library/Caches/go-build'
GOENV='/Users/romain.marcadier/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/romain.marcadier/go/pkg/mod'
GONOPROXY='github.com/DataDog'
GONOSUMDB='github.com/DataDog,go.ddbuild.io'
GOOS='darwin'
GOPATH='/Users/romain.marcadier/go'
GOPRIVATE='github.com/DataDog'
GOPROXY='binaries.ddbuild.io,proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.22.4/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.4/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.4'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/romain.marcadier/Development/Datadog/orchestrion/go.mod'
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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/qh/q2mpbd0j6xsb7vc8dqzdm81h0000gn/T/go-build3755867500=/tmp/go-build -gno-record-gcc-switches -fno-common'
What did you do?
Trying to use go list
to obtain the exports for a given package and its dependencies; possibly built with coverage instrumentation... Use a command similar to the following (io
being a standard library package that runs into the issue, but this happens with virtually any other package that does not "already" depend on sync/atomic
):
$ go list -cover -covermode=atomic -coverpkg=io -deps -export -json io
What did you see happen?
Removed -deps
and -json
arguments as they are largely irrelevant to the issue; but basically:
$ go list -cover -covermode=atomic -coverpkg=io -export io
# io
/opt/homebrew/Cellar/go/1.22.4/libexec/src/io/io.go:13:35: could not import sync/atomic (open : no such file or directory)
io
$ echo $?
1
What did you expect to see?
I'd have expected compilation to succeed and exports to be returned (the go build
equivalent command is successful):
$ go list -cover -covermode=atomic -coverpkg=io -deps -export -json io
io
$ echo $?
0