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

include go build output in build error #1127

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Sep 7, 2023

This doesn't change much for users of ko as a CLI, the output still contains relevant error output:

$ go run ./ build ./test/                                 
2023/09/07 09:18:11 Using base cgr.dev/chainguard/static:latest@sha256:a432665213f109d5e48111316030eecc5191654cf02a5b66ac6c5d6b310a5511 for github.com/google/ko/test
2023/09/07 09:18:11 Building github.com/google/ko/test for linux/amd64
Error: failed to publish images: error building "ko://github.com/google/ko/test": build: go build: exit status 1: # github.com/google/ko/test
test/main.go:80:1: syntax error: non-declaration statement outside function body

Previously, this was:

ko build ./test/
2023/09/07 09:19:21 Using base cgr.dev/chainguard/static:latest@sha256:a432665213f109d5e48111316030eecc5191654cf02a5b66ac6c5d6b310a5511 for github.com/google/ko/test
2023/09/07 09:19:22 Building github.com/google/ko/test for linux/amd64
2023/09/07 09:19:22 Unexpected error running "go build": exit status 1
# github.com/google/ko/test
test/main.go:79:1: syntax error: non-declaration statement outside function body
Error: failed to publish images: error building "ko://github.com/google/ko/test": build: go build: exit status 1
exit status 1

For users of ko as a library, mainly tf-ko, which swallows log output, this will be very helpful in surfacing the go build error.

@imjasonh imjasonh merged commit daab1ac into ko-build:main Sep 7, 2023
23 checks passed
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

Successfully merging this pull request may close these issues.

2 participants