(cdk-go): malformed module path in Go code generation when attempting to build example
See original GitHub issueAttempt to get started with the go cdk, initialise and test the example crashed. Tentatively reporting as a bug in case linked to https://github.com/aws/jsii/issues/2842.
Reproduction Steps
Fresh go project following steps in https://docs.aws.amazon.com/cdk/latest/guide/work-with-cdk-go.html
aws configure mkdir gotest cd gotest cdk init app --language go // comment: this works fine cdk ls -v (or cdk deploy, cdk bootstrap, cdk synth)
What did you expect to happen?
This was an initial check that the toolchain is working by testing the example. I expected ls to build and launch a container to return the names of two existing CDK stacks in this account and region, created in a Typescript project, which seems to work perfectly in the same user session. So I think my AWS creds, cdk and node installations are correct.
What actually happened?
Go build failed with following error (tail of output)
build command-line-arguments: cannot load embed: malformed module path “embed”: missing dot in first path element Subprocess exited with error 1 Error: Subprocess exited with error 1 at ChildProcess.<anonymous> (/home/drskeet/.nvm/versions/node/v14.17.0/lib/node_modules/aws-cdk/lib/api/cxapp/exec.ts:122:23) at ChildProcess.emit (events.js:376:20) at ChildProcess.emit (domain.js:470:12) at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
Environment
- CDK CLI Version : 1.105.0 (build 4813992)
- Framework Version:
- Node.js Version: v14.17.0
- OS : Kubuntu Linux 5.4.0-58-generic
- Language (Version): go version go1.16 linux/amd64
Other
Unfortunately I can’t rule out configuration mistakes elsewhere since this was my first attempt to use the Go bindings. I don’t have a known-good version in golang.
Looks like this might be related to https://github.com/aws/jsii/issues/2842? But if so, much easier to reproduce.
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Fixed. Local config error: go aliased to go1.16 but /usr/bin/go symlinked to 1.13. Thank you for the key information that it was picking up the wrong go version. Closing.
Many thanks indeed, will try exactly that. Sorry for reporting as a bug, I rather suspected it would be something local. Will poke around in JSII and let you know. Might be relevant for FAQ or installation instructions for full release.