#Error from `dagger develop --sdk=go`

1 messages · Page 1 of 1 (latest)

mortal moon
#

hey! Trying to take my first steps into 0.11 (have several projects in 0.9 but I have a new fresh project and it seemed nicer to start there).

So, in a fresh project, I've done:

% dagger init

And then:

✘ ModuleSource.asModule: Module! 8.3s
! failed to create module: select: failed to update codegen and runtime: failed to generate code: failed to get modified source directory for go module sdk codegen: select: process "/usr/local/bin/codegen --module-context /src --module-name cdr --introspection-json-path /schema.json" did not complete successfully: exit code: 1
  
... omitted due to discord msg size limit ...    

Error: failed to generate code: input: moduleSource.withContextDirectory.withSDK.withSourceSubpath.asModule resolve: failed to create module: select: failed to update codegen and runtime: failed to generate code: failed to get modified source directory for go module sdk codegen: select: process "/usr/local/bin/codegen --module-context /src --module-name X --introspection-json-path /schema.json" did not complete successfully: exit code: 1

Stdout:
generating go module: X
Stderr:
Error: generate code: error formatting generated code: err: exit status 1: stderr: go: downloading go1.22 (linux/arm64)
go: download go1.22 for linux/arm64: toolchain not available```
brisk swift
#

@mortal moon can you tell me more about your environment. OS/version, hardware architecture, any go.work or other special golang files in your directory structure. 🙏

mortal moon
#

Mac OS 14.4.1, M1 Max (MBP), no go.work. Just a go.mod (specifies go 1.22).

#

(I should clarify, by "fresh" I meant "project without dagger", there's actually a lot of Go code in there)

mortal moon
#

So if I setup a blank dir and run the commands in there it's fine. Seems to be an issue if I run these commands in an existing go project

mortal moon
#

So an easier way to reproduce this:

$ git clone https://github.com/golang/example
$ cd example

Update go.mod go 1.18 -> go 1.22

$ dagger init

Then

$ dagger develop --sdk=go
...
Stdout:
generating go module: example
Stderr:
Error: generate code: error formatting generated code: err: exit status 1: stderr: go: downloading go1.22 (linux/arm64)
go: download go1.22 for linux/arm64: toolchain not available
novel wedge
#

it can be reproduced also by just creating a 1.22 go.mod file in the CWD before doing dagger develop

mortal moon