Skip to content

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

Not planned
@jamietanna

Description

@jamietanna

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/toolchain@v0.0.1-go1.24rc2.linux-amd64'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/jamie/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/jamie/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24rc2.linux-amd64/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/gqlgen@v0.17.49
% 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.

Activity

changed the title [-]`go tool`: receiving an `exit status 1`[/-] [+]`go tool`: receiving an `exit status 1` for certain dependencies[/+] on Jan 27, 2025
seankhliao

seankhliao commented on Jan 27, 2025

@seankhliao
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

added
BugReportIssues describing a possible bug in the Go implementation.
on Jan 27, 2025
jamietanna

jamietanna commented on Jan 27, 2025

@jamietanna
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

seankhliao commented on Jan 27, 2025

@seankhliao
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

jamietanna commented on Jan 27, 2025

@jamietanna
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jamietanna@seankhliao@gabyhelp

        Issue actions

          `go tool`: receiving an `exit status 1` for certain dependencies · Issue #71448 · golang/go