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

Fix Go 1.22 Docker image build failure #1083

Open
generalmimon opened this issue Feb 21, 2024 · 0 comments
Open

Fix Go 1.22 Docker image build failure #1083

generalmimon opened this issue Feb 21, 2024 · 0 comments

Comments

@generalmimon
Copy link
Member

generalmimon commented Feb 21, 2024

See https://github.com/kaitai-io/kaitai_struct_docker_images/actions/runs/7989563895/job/21816399533#step:4:122:

#13 [8/9] RUN ./prepare
#13 0.211 go: modules disabled by GO111MODULE=off; see 'go help modules'
#13 ERROR: process "/bin/sh -c ./prepare" did not complete successfully: exit code: 1
------
 > [8/9] RUN ./prepare:
0.211 go: modules disabled by GO111MODULE=off; see 'go help modules'
------
Dockerfile:20
--------------------
  18 |     
  19 |     # Install rest of go-specific dependencies
  20 | >>> RUN ./prepare
  21 |     
  22 |     # Validate that we've got correct version, e.g. something like this:
--------------------
ERROR: failed to solve: process "/bin/sh -c ./prepare" did not complete successfully: exit code: 1
Error: Process completed with exit code 1.

See https://github.com/kaitai-io/kaitai_struct_docker_images/blob/ef0ad6e321d86839c7a929a5d5221bfcf1099531/src/go/_common/prepare#L3:

GO111MODULE=off go get -v github.com/kaitai-io/kaitai_struct_go_runtime/kaitai

The reason this error suddenly appears in Go 1.22 (and not in Go 1.21) is explained at https://tip.golang.org/doc/go1.22#go-command:

go get is no longer supported outside of a module in the legacy GOPATH mode (that is, with GO111MODULE=off). Other build commands, such as go build and go test, will continue to work indefinitely for legacy GOPATH programs.

So apparently we need to change the way we install test dependencies in order to run the test suite on Go 1.22 and later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant