Closed RainbowMango closed 4 years ago
Hi @RainbowMango ,
Thank you for reaching out to us.
Before Go 1.13 there was no validation on the pseudo-version components, being possible for a single commit hash to be present on multiple pseudo-versions. This would usually happen when users created or changed pseudo-versions manually instead of relying on the Go client to do it for them.
Since GoCenter is Go version agnostic, it will cache and serve those pseudo versions when users request them from the center to promote the reproducibility of builds and interoperability between module proxies. The logic we try to follow here is that if it worked when users where resolving dependencies from source, it should work as well if they resolve from GoCenter.
Let us know if you have additional question.
Thanks for your quick response. I'm familiar with the proxy.golang.org
, but not with GoCenter
, so I still confused.
This would usually happen when users created or changed pseudo-versions manually instead of relying on the Go client to do it for them.
Do you mean the pseudo-versions are created by users? If yes, could you please show an example? I also wonder how GoCenter cache the packages.
Another question:
Take github.com/golang/glog@v0.0.0-20170312005925-23def4e6c14b
for example, seems GoCenter
already cached it, but can not pass the GOSUMDB verify. I guess that because the GOSUMDB(sum.golang.org
) doesn't record this version. Am I right?
Will you remove this kind of package?
[root@ecs-d8b6 temp]# go get -v github.com/golang/glog@v0.0.0-20170312005925-23def4e6c14b
go: downloading github.com/golang/glog v0.0.0-20170312005925-23def4e6c14b
go get github.com/golang/glog@v0.0.0-20170312005925-23def4e6c14b: github.com/golang/glog@v0.0.0-20170312005925-23def4e6c14b: verifying module: github.com/golang/glog@v0.0.0-20170312005925-23def4e6c14b: reading https://gocenter.io/sumdb/sum.golang.org/lookup/github.com/golang/glog@v0.0.0-20170312005925-23def4e6c14b: 404 Not Found
Do you mean the pseudo-versions are created by users? If yes, could you please show an example?
Users should not create pseudo-versions by themselves and should aways rely on the Go client to translate a commit hash or a branch name to the actual pseudo-version. However, before Go 1.13, there was no logic built in the Go client to validate the pseudo-version components, making it possible for users to simply change the commit hash part of a pseudo-version while leaving the other components untouched and still get a working pseudo-version. That is why it was possible to get multiple working pseudo-versions for the same commit hash. This changed on Go 1.13 when a validation logic was introduced to make sure the version and date components of a pseudo-version are compatible with the commit hash part.
I also wonder how GoCenter cache the packages.
Can you provide more details about what specifically you would like to know about how GoCenter cache the packages.
Take github.com/golang/glog@v0.0.0-20170312005925-23def4e6c14b for example, seems GoCenter already cached it, but can not pass the GOSUMDB verify. I guess that because the GOSUMDB(sum.golang.org) doesn't record this version. Am I right? Will you remove this kind of package?
Yes, you are right. The checksum server was introduced after Go 1.13 and is not backwards compatible. If users want to rely on the checksum server, they will need to either move to the actual correct pseudo-version or disable the checksum server check step for that specific module.
We will not remove those packages. Remember that there is nothing wrong with them as long as you are using Go 1.12. GoCenter is version agnostic and is meant to promote reproducible builds. In order to achieve that all versions need to be immutable and always available. Also, users should not be force to update their dependencies or move to a newer Go version because the server did a non backwards compatible change. They should have the control over when it is safe for them to make this type of changes.
Thank you for your patience, I think I've got my answer now.
Remember that there is nothing wrong with them as long as you are using Go 1.12. They should have the control over when it is safe for them to make this type of changes.
After we started use Go1.12+ we should change the dependencies to a version that can be verified by GOSUMDB.
Thanks again, and I'm going to close the issue now.
You are more than welcome. Feel free to reach out again if you have additional questions.
From the following output, I have some questions:
The latest commit happened on 27 Jan 2016, the short commit id is
23def4e6c
, why gocenter.io keeps two pseudo versions with different times?