-
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 hangs when used with ASDF installed Go #530
Comments
Thanks for filing With $ ko version
0.9.3
$ git clone https://github.com/StevenACoffman/repro.git
$ export GOPRIVATE=github.com/StevenACoffman
$ cd sub
$ ko publish -B --bare --local --platform=linux/amd64 --push=false .
2021/12/13 14:08:08 Using base gcr.io/distroless/static for github.com/StevenACoffman/repro/sub
2021/12/13 14:08:11 Building github.com/StevenACoffman/repro/sub for linux/amd64
2021/12/13 14:08:12 Loading ko.local/sub:445cfe3dd7dcad8f41b8eb35058687973182ee7d7a3d57270c29dc58143d3293
2021/12/13 14:08:12 Loaded ko.local/sub:445cfe3dd7dcad8f41b8eb35058687973182ee7d7a3d57270c29dc58143d3293
2021/12/13 14:08:12 Adding tag latest
2021/12/13 14:08:12 Added tag latest
ko.local/sub:445cfe3dd7dcad8f41b8eb35058687973182ee7d7a3d57270c29dc58143d3293 However, the build config from $ docker run --detach --rm --publish 8080:8080 ko.local/sub:445cfe3dd7dcad8f41b8eb35058687973182ee7d7a3d57270c29dc58143d3293
$ curl -s localhost:8080
Hello from unknown, ! If I change $ curl -s localhost:8080
Hello from Working, ! A few points to note:
Based on the above, a simpler version of your builds:
- id: anything
ldflags:
- -s
- -w
- -X main.AppName=Working Here's what I got with the simplified $ image=$(ko publish -B --local .)
$ docker run --detach --rm --publish 8080:8080 $image
$ curl -s localhost:8080
Hello from Working, ! If you build
This line is absent if no build config from |
Each of these sounds like an error or warning we should raise, FWIW, if anybody reading this is interested in making it so. @StevenACoffman just to check, does a regular (For my own reference, docs on edit: And thank you so much for taking the time to share a repro, that's immensely helpful in debugging issues like this. 🙏 edit²: What's your |
Thanks so much for your helpful responses. It appears that the cause is actually using ASDF for Go installation is incompatible with I should have initially mentioned more details like I am running on MacOS Monterey 12.0.01.
I initially encountered the hanging behavior in a private GitHub repository, but am seeing the hanging behavior in the public I have Go installed using ASDF which plays shell games to have multiple GO versions installed. This is my installation method (which should also work on linux btw)
When I instead used homebrew to install Go 1.17.2 (yeah, not identical) and set my PATH to prefer it:
Then
If it is helpful, I can build and install ko from source with additional debug messages to see where it is hanging. I have updated the title of this issue based on my updated hypothesis. |
What's the output of I've seen some weirdness around osx install locations: |
Using ASDF for go 1.17.5 (under which
If I then run
However, these are unrelated, as I can export these environment variables with the other values, verify |
Can you determine where it's hanging with |
Is it interesting that in the initial report, we don't see a AFAIK I don't think we invoke the |
Again, I'm happy to sprinkle log lines in ko source, build ko, and run it if that is helpful. |
I would love it if these could be warnings, btw. All of the mistakes I made were from examples I found in the wild searching github for ko uses. |
Can you try setting Does |
So
If I just run this:
It just hangs as well. |
So I tried various permutations and only the
I can set or unset all the other environment variables and nothing changes the hanging behavior. |
Also, sorry that I got pulled away yesterday. if more realtime communication would be helpful now or in the future, where does that generally take place for |
We hang out in k8s slack: https://github.com/google/ko#discuss |
Signed-off-by: Steve Coffman <[email protected]>
Signed-off-by: Steve Coffman <[email protected]>
I am able to reproduce either a bug, or a misconfiguration that could perhaps use a better error message of some sort.
The reproduction is here at StevenACoffman/repro.
Repro
If you clone that repo and run:
The terminal will just hang there until you hit Ctrl-c.
At which point, it will then say:
However, if you delete the
.ko.yaml
file in that directory and run it again, things work as you'd expect.I have tried a number of different possible values for "main" and "dir" and "id" in the
.ko.yaml
file, including omitting them altogether. For instance, setting themain:
to the valuesgithub.com/StevenACoffman/repro/sub
,.
, andmain
don't seem to affect this hanging behavior..ko.yaml
contents:Any help or tips would be greatly appreciated!
The text was updated successfully, but these errors were encountered: