gokrazy / tools

this repository contains the gok CLI tool of gokrazy
https://gokrazy.org
BSD 3-Clause "New" or "Revised" License
50 stars 28 forks source link

Intermittent build errors: cannot find package #22

Closed andig closed 3 years ago

andig commented 3 years ago

I've noticed gokr-packager being unable to download required packages from time to time.

Locally on OSX:

❯ gokr-packer -overwrite=image -target_storage_bytes=1153441792 github.com/gokrazy/breakglass github.com/gokrazy/hello
2021/01/09 22:58:30 packer.go:412: building [github.com/gokrazy/breakglass github.com/gokrazy/hello]
2021/01/09 22:58:33 write.go:149: writing boot file system
cannot find package "github.com/gokrazy/rpi-eeprom" in any of:
        /usr/local/Cellar/go/1.15.6/libexec/src/github.com/gokrazy/rpi-eeprom (from $GOROOT)
        /Users/andig/go/src/github.com/gokrazy/rpi-eeprom (from $GOPATH)
2021/01/09 22:58:33 packer.go:917: [go list -f {{ .Dir }} github.com/gokrazy/rpi-eeprom]: exit status 1

In Github actions (https://github.com/andig/git/runs/1674794392?check_suite_focus=true):

Run gokr-packer -overwrite=image -target_storage_bytes=1153441792 github.com/gokrazy/breakglass github.com/gokrazy/hello
2021/01/09 22:01:17 packer.go:412: building [github.com/gokrazy/breakglass github.com/gokrazy/hello]
2021/01/09 22:01:17 gotool.go:77: getting incomplete packages [github.com/gokrazy/gokrazy/cmd/dhcp github.com/gokrazy/gokrazy/cmd/ntp github.com/gokrazy/breakglass github.com/gokrazy/hello github.com/gokrazy/gokrazy github.com/gokrazy/kernel github.com/gokrazy/firmware]
2021/01/09 22:03:39 write.go:149: writing boot file system
cannot find package "github.com/gokrazy/rpi-eeprom" in any of:
    /opt/hostedtoolcache/go/1.15.6/x64/src/github.com/gokrazy/rpi-eeprom (from $GOROOT)
    /home/runner/go/src/github.com/gokrazy/rpi-eeprom (from $GOPATH)
2021/01/09 22:03:39 packer.go:917: [go list -f {{ .Dir }} github.com/gokrazy/rpi-eeprom]: exit status 1
Error: Process completed with exit code 1.

Noticed with rpi-eeprom, and kernel both. Both examples were running go1.15.6 I'd suspect some weird thing going on with go tool, maybe go proxy but have no idea where to look.

Not sure this is something for an issue in the go repo?

stapelberg commented 3 years ago

Are you running with Go modules enabled (and a go.mod file present), or is this still GOPATH?

It looks like GOPATH from the error messages, and given that Go 1.16 will default to module mode, I think you should try with modules before digging much deeper.

andig commented 3 years ago

Ah, thats true. In den testing setup I didn‘t have a module. Closing for time being, thanks.