Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: change tag can not get the new commit version #31903
now, there is a go module A.
step1: add new tag
when I run
@iiinsomnia FWIW, Go modules require that modules follow the semver spec, and as far as I am aware, it is not allowed under the semver spec to move a tag from commit_1 to commit_2 as in your example if that initial tagging represents an actual release viewable by others.
For example, from https://semver.org/#spec-item-3:
That said, in your case, you might want to try doing
Also, the top-half of your example is using v1 major version tags, but then the last part of your example says:
Is that intentional that you switched to a v0 major version tag there?
GOARCH="amd64" GOBIN="" GOCACHE="/Users/shenghui/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/workspace/go" GOPROXY="https://goproxy.io" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/j5/v0z7l6f53rs6lc9g2nyd37800000gn/T/go-build753395015=/tmp/go-build -gno-record-gcc-switches -fno-common"
I think @thepudds has the right diagnosis.
@iiinsomnia, the mapping of commits to versions must not be changed once a version is published. That is a core property of Go modules: it is what makes builds reproducible and enables proxies and caching.
If there is a serious problem with
(Note that we do not currently have a mechanism to inform proxies that an existing version is no longer safe to use; that's #24031.)