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

"encore run" fails with GOTOOLCHAIN=local error #1659

Open
robertocamp opened this issue Dec 19, 2024 · 0 comments
Open

"encore run" fails with GOTOOLCHAIN=local error #1659

robertocamp opened this issue Dec 19, 2024 · 0 comments

Comments

@robertocamp
Copy link

Encore run fails with GOTOOLCHAIN=local error

environment

  • encore version: encore version v1.45.2
  • Go version: go version go1.23.4 darwin/arm64

project design

  • project structure
├── encore.app
├── go.mod
├── go.sum
└── services
    └── gitlab
        ├── README.gitlab-client.md
        ├── encore.gen.go
        └── gitlab.go

detailed problem description

I am attempting to create an endpoint that uses the newer gitlab go-client.

The legacy client (https://github.com/xanzy/go-gitlab) has been archived as read-only, and while still viable, active development has moved to https://gitlab.com/gitlab-org/api/client-go.

When I add "gitlab.com/gitlab-org/api/client-go" to the imports in services/gitlab/gitlab.go, encore is changing the go.mod file from go 1.23.0 to go 1.23.4. Seems logical, as that Go version is what the new Gitlab client is requiring. However when I attempt to run the project (which is doing a simple "get user" endpoint as a smoke test), the encore run fails with:

'go mod tidy' failed: go: /Users/<MY_USER>/Library/Caches/encore-build/encore-demo-zazi/build/go.mod requires go >= 1.23.4
(running go 1.23.0; GOTOOLCHAIN=local)

╭─[Stack Trace]
├─▶ build.(*builder).writeModFile-fm.(*builder).writeModFile.func1 encr.dev/v2/compiler/build/build.go:229
├─▶ etrace.Sync0                                                   encr.dev/internal/etrace/etrace.go:10
├─▶ build.(*builder).writeModFile                                  encr.dev/v2/compiler/build/build.go:138
├─▶ build.(*builder).Build                                         encr.dev/v2/compiler/build/build.go:128
├─▶ build.Build                                                    encr.dev/v2/compiler/build/build.go:73
├─▶ v2builder.BuilderImpl.Compile.func1                            encr.dev/v2/v2builder/v2builder.go:149


I get this message even though:

  1. my local go version is 1.23.4
  2. my GOTOOLCHAIN is set to "auto"

WorkAround

Work around is to persist with the legacy Github client, but I'd like to be make the new Gitlab client work.

What I've tried

  • validated Go version and encore versions
  • uninstalled and reinstalled Go
  • cleared encore build cache
  • uninstalled and reinstalled Encore
  • setting go.mod to go 1.23.0 does not allow the Gitlab client to build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant