-
Notifications
You must be signed in to change notification settings - Fork 405
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
ko stops building containers after Golang updates #106
Comments
That doesn't seem right. Do you have any idea why? |
I don't, but it has hit me on each minor Golang 1.13.x update, and always goes away immediately after reinstalling. I'm on a Mac using brew to install/update golang. I have seen some binaries hold on to the GOROOT used to build them, but they fail loudly as the previous GOROOT is removed on update.
|
We pull the GOPATH from here which might explain that?
Happens here: Not sure if there's a better way to do it... |
Interesting. My GOPATH isn't changing between golang releases. The GOROOT is not set as a env, but defined by |
Ah, weird. That check is just shelling out to:
I can't imagine why reinstalling would fix that. We call go/build.Import to check if a package is build-able. I wonder if the output of |
rsc's comment here hints at the problem:
We seem to be hitting the bolded part, but I'm still not sure what is actually breaking. We're completely swallowing any |
From the go 1.14 release notes:
This might be something we can use. |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale |
I think we've improved this situation by surfacing better errors and requiring
Which previously returned:
My theory is that there are multiple @scothis are you still running into this? Does this sound plausible? Edit: Nevermind! I see that this has been already discussed in #218 I wonder how problematic it would be to just set Looking at it:
It seems pretty reasonable to do this. Everything else seems pretty static, though I wonder how we'd handle |
Not sure. I've gotten into the habit of reinstalling ko automatically after upgrading golang |
We could do something stupid like: // somewhere we don't expect the build to fail (perhaps even checking the error)
if err != nil {
if goroot, execErr := exec("go env GOROOT"); execErr == nil {
if us, them := gb.buildContext.GOROOT, goroot; us != them {
return fmt.Errorf("ko was installed with GOROOT=%q, but `go env GOROOT`=%q, see %s to fix this; build failed: %v", us, them, issue106URL, err)
}
}
} And suggest We also currently shell out to get module info: https://github.com/google/ko/blob/522c37c4e0ec9537068f16e8f1652f969377b62e/pkg/build/gobuild.go#L104-L147 We could concurrently shell out to |
This also bites the version of ko distributed via brew. Setting GOROOT explicitly helps Annoyingly, despite build paths being prefixed with |
This shouldn't be happening anymore... with #281 and #275 I thought we would fail loudly... Looks like 281 didn't get into the v0.7.0 cut. Let me send a PR to "fix" this, then we can cut v0.8.0 that includes a bunch of fixes. Edit: in fact, @scothis can you test that HEAD doesn't fail silently? |
@jonjohnsonjr sorry I missed this. With 0.8 I see the new warning with the proper fallback by default. 👍 |
After each minor Golang version bump (e.g. 1.13.2 -> 1.13.3),
ko apply
no longer builds container images but happily applies the yaml untransformed, which leads with image pull errors on the cluster. After reinstalling ko, it works again as expected.Ideally
ko
would continue to work after a Golang update, but if not, it should fail loudly and demand to be reinstalled.The text was updated successfully, but these errors were encountered: