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

Go 1.21 Fails to Build #982

Closed
gerred opened this issue Jun 28, 2023 · 4 comments · Fixed by #1106
Closed

Go 1.21 Fails to Build #982

gerred opened this issue Jun 28, 2023 · 4 comments · Fixed by #1106
Assignees
Labels
needs-triage applied to all new customer/user issues. Removed after triage occurs.

Comments

@gerred
Copy link

gerred commented Jun 28, 2023

Which image/versions are related to this issue/feature request?

Go 1.21

Issue/Feature description

Getting the following issue consistently when building with the 1.21 image related to GOPROXY. Output is truncated to just the relevant parts:

 => ERROR [build 8/8] RUN GOOS=linux GOARCH=amd64  CGO_ENABLED=0 go build -ldflags '-extldflags "-s  0.1s
#0 0.064 api/config/config.go:4:2: GOPROXY list is not the empty string, but contains no entries
#0 0.064 pkg/client/audio/audio_grpc.pb.go:11:2: GOPROXY list is not the empty string, but contains no entries
#0 0.064 pkg/client/audio/audio_grpc.pb.go:12:2: GOPROXY list is not the empty string, but contains no entries
#0 0.064 pkg/client/audio/audio_grpc.pb.go:13:2: GOPROXY list is not the empty string, but contains no entries
#0 0.064 pkg/client/audio/audio.pb.go:10:2: GOPROXY list is not the empty string, but contains no entries
#0 0.064 pkg/client/audio/audio.pb.go:11:2: GOPROXY list is not the empty string, but contains no entries
#0 0.064 api/main.go:17:2: GOPROXY list is not the empty string, but contains no entries
#0 0.064 api/main.go:18:2: GOPROXY list is not the empty string, but contains no entries

Go 1.20 builds successfully. Go 1.21rc2 binary builds locally correctly, even with GOPROXY set the same as in the Chainguard image.

In go env:

GOPROXY=''

@gerred gerred added the needs-triage applied to all new customer/user issues. Removed after triage occurs. label Jun 28, 2023
@dlorenc
Copy link
Contributor

dlorenc commented Jun 28, 2023

Can you share the full Dockerfile?

@gerred
Copy link
Author

gerred commented Jun 28, 2023

@dlorenc https://github.com/defenseunicorns/leapfrogai/blob/main/Dockerfile - we updated it back to 1.20 for the moment.

@imjasonh
Copy link
Member

Thanks for reporting this! I'm able to reproduce with our image and not golang:1.21, so this is something for us to fix.

I'll add a test that our image can be used to build an app that has an external dependency, which is something we hadn't had coverage for before.

@imjasonh
Copy link
Member

Just to wrap this up, the issue was that Go 1.21 started considering the contents of $GOROOT/go.env when determining things like GOPROXY and more, and we weren't including that file.

#1106 added a test that packages with external dependencies can be built, and this passed after Jon's change.

Thanks again for reporting this! Let us know if anything else looks suspect, this is really helpful for vetting out the image before the real release!

developer-guy pushed a commit to Dentrax/images that referenced this issue Feb 12, 2024
…-images#982)

Signed-off-by: wolfi-bot <121097084+wolfi-bot@users.noreply.github.com>
Co-authored-by: wolfi-bot <121097084+wolfi-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage applied to all new customer/user issues. Removed after triage occurs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants