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

go tool: receiving an exit status 1 for certain dependencies #71448

Closed
jamietanna opened this issue Jan 27, 2025 · 5 comments
Closed

go tool: receiving an exit status 1 for certain dependencies #71448

jamietanna opened this issue Jan 27, 2025 · 5 comments
Labels
BugReport Issues describing a possible bug in the Go implementation.

Comments

@jamietanna
Copy link

Go version

go version go1.24rc2 linux/amd64

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/jamie/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/jamie/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1856760023=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/jamie/workspaces/dependency-management-data/go.mod'
GOMODCACHE='/home/jamie/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/jamie/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/jamie/go/pkg/mod/golang.org/[email protected]'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/jamie/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/jamie/go/pkg/mod/golang.org/[email protected]/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.24rc2'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

As noted in 99designs/gqlgen#3505 I'm trying out Go 1.24's go tool functionality with gqlgen.

This appears to only impact gqlgen, so may be an issue with them directly (99designs/gqlgen#3505) but it's unclear if that's the expectation of moving to go tool, and so I've raised it here to also see if there's anything the Go team are able to help with.

However, this also seems to be reproducible in Go 1.24rc2 (I have not tested previous RCs), so seems to be most likely due to changes in the Go toolchain.

I have created a branch on one of my projects here to indicate the changes and help test.

Using go tool

# from https://gitlab.com/tanna.dev/dependency-management-data/-/commits/spike/go-tools-124-gql
% cd internal/graph
% go tool github.com/99designs/gqlgen generate --verbose
% echo $?
1

Using go run

# from https://gitlab.com/tanna.dev/dependency-management-data/-/commits/spike/go-tools-124-gql
% cd internal/graph
% git reset --hard c5030b01 # make sure we don't have any `go tool` changes
% go get github.com/99designs/[email protected]
% go run github.com/99designs/gqlgen generate
exit status 1

What did you see happen?

The go generate command fails with exit code 1 and no additional information

What did you expect to see?

The go generate command succeeds, or errors with more information.

@jamietanna jamietanna changed the title go tool: receiving an exit status 1 go tool: receiving an exit status 1 for certain dependencies Jan 27, 2025
@seankhliao
Copy link
Member

I think whatever problem you're having is unrelated to go tool. Installing gqlgen directly and running it also results in a nonzero exit status with no output.

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Jan 27, 2025
@jamietanna
Copy link
Author

Thanks Sean - the reason I'd raised this here is that this appears to be directly related to the changes in Go 1.24's go tool or go run caching - using go run which worked in Go 1.23 is now no longer working in Go 1.24rc2

@seankhliao
Copy link
Member

gqlgen is depending on too old a version of x/tools to be compatible with the latest go, that's unrelated to go run / go tool.

@jamietanna
Copy link
Author

Oh interesting, thank you - so bumping that should resolve this? I assume it's due to new directives that the old /x/tools can't understand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation.
Projects
None yet
Development

No branches or pull requests

3 participants