Closed jabielecki closed 1 year ago
I wasn't able to reproduce this locally nor in a container:
#!/usr/bin/env bash
# test.sh - 0775 (create this file locally in a directory docker can mount)
mkdir -p /tmp/packngotest
cd /tmp/packngotest
go mod init x
go get -d github.com/packethost/packngo
$ chmod a+x test.sh
$ nerdctl run --rm -i -v `pwd`/test.sh:/test.sh golang /test.sh
go: creating new go.mod: module x
go: downloading github.com/packethost/packngo v0.30.0
go: added github.com/packethost/packngo v0.30.0
After some digging with go get -x -d
it looks like a cache issue. It tried to do something like this:
cd /home/kubit/go/pkg/mod/cache/vcs/8dc4fa85dc5f6f855e9b38517f6f12aee7464b4e24cbbdda535bee36d38a1e90; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' b45284c83715 --
b45284c83715a160236f466d510dac15592a263b 1684159918 HEAD -> master, origin/master
No tag
reported, that's the problem. :point_up:
$ cd /home/kubit/go/pkg/mod/cache/vcs/8dc4fa85dc5f6f855e9b38517f6f12aee7464b4e24cbbdda535bee36d38a1e90; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' v0.29.0 --
850d0677ea8c7fc9b02e4555da14ecb8226b4cf0 1667576362 tag: v0.29.0
$ cd /home/kubit/go/pkg/mod/cache/vcs/8dc4fa85dc5f6f855e9b38517f6f12aee7464b4e24cbbdda535bee36d38a1e90; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' v0.30.0 --
fatal: bad revision 'v0.30.0'
I think what happened is that we've used github.com/packethost/packngo@v0.29.1-0.20230515141158-b45284c83715
before the tag v0.30.0
existed. Note the tag is using exactly the same commit id b45284c83715
.
Good to know that directory like ~/go/pkg/mod/cache/download/github.com/packethost/packngo
is only a minor part of the cache, and not relevant to git issues. Removing it mostly doesn't make any sense. :bulb: :slightly_smiling_face:
The problem was shared between people who obtained their cache in the same way initially (from the same shared go.mod
file), but it's rather unlikely to happen in the wild. Closing, thank you.
Description
I'd like to use packngo at v0.30.0 and I see an unexpected behavior:
What I expected
A success, like the last time:
Extra checks
Versions