Skip to content

make generate-go fails silently with error code 1 #247

Description

@rtk0c

https://traggo.net/dev/setup/ asks us to run make generate as a setup step. If you do so with a modern enough go toolchain, you'll get something like

~/traggo-server > make generate
gqlgen
make: *** [Makefile:17: generate-go] Error 1
~/traggo-server [2]>

As it turns out it's because the pinned gqlgen version is too old, which brings in golang.org/x/tools v0.40.0. That only supports data export version 2, while my installed Go version (1.27.0) has version 4.

Solution was to add a env var to force a lower version of Go, like so:

GOTOOLCHAIN=go1.25.5 make generate-go

**disclaimer: I realized I could run gqlgen --verbose to get it to spit out

internal error: package "database/sql/driver" without types was imported from "github.com/traggo/server/model"

but I was utterly clueless at what that meant. I asked help from a LLM to solve this issue, and the data version diagnosis was its explanation. I did not fact check it.

Activity

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

    a:bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions