-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
installation problems with "v2" #920
Comments
Version v2.0.1 is released to fix this problem, but it don't. The new version can not be found with an external example project.
I have found different resources for v2+ modules:
|
v1:
v2+:
|
It seems the simple version increasing will not work in our case, see https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher. citation: "(Note that this advice regarding incrementing the major version when first adopting modules does not apply to pre-existing repos or packages whose latest versions are v0.x.x or v1.x.x)" Hi @deadprogram , how we should proceed with this issue? IMO we have some possibilities:
Any suggestions/ideas? Thanks, Thomas |
Yes, only if we had started with our various code in a Considering our options here... 🤔 |
"create a folder v2" is the most common pattern and would be least surprising to developers. |
@deadprogram , thanks for your immediate answer. So I will remove the current releases/tags first, than create the folder and will release the "v2.0.0" again, right? |
Not sure about the tags, maybe better to just add new one 2.0.3 |
@deadprogram do you really mean 2.0.3? Normally the next version increment would be 2.0.2. I would move the code to the new "v2" folder according to this example https://github.com/googleapis/gax-go. What do you think? |
Correct, I mistyped the number. |
Thanks, and I was wrong with my given example. There was done a copy to v2 folder, so the development can also continue on version 0.x/1.x, IMO there is no other reason for this. In our case, I think, nobody wants to maintain the old version v1.x. So I move the code to the v2 folder. |
After releasing v2.0.2 it is not working completely. This means
It seems there is a missing forward from the website or something else. If we can get it to work with v2.0.1 this would be nice, because moving the code to the v2 subfolder in v2.0.2 has some drawbacks. @deadprogram do you have any idea to fix this? |
Now I have tested v2+ with a new branch "v2":
both with the same result:
I'm running out of ideas. |
It seems "periph.io" runs in the same problem 2017 and solved this with a new start in 2020. See also this version history https://pkg.go.dev/periph.io/x/periph?tab=versions - it begins with a "v2.0.0+incompatible" tag. Possibly this is the only solution at the moment? |
Hi @deadprogram , here for uuid we can find a good description of the problem with a nice solution (read also the later comments to get an idea of the steps to be taken) I will try to sum up it later for gobot as a base for discussion. |
Thanks @gen2thomas I will take a look. |
@deadprogram here you can find an excellent wrap up of all possible solutions with its pros and cons. This was done by investigation of multiple projects: KateGo520/Hero#1. (IMO that document deals more or less only with compatibility for GOPATH users) |
After some more investigation I'm more wondering than before and still have no idea what went wrong. Here you can find my document: WORKFLOW_V2+.md Conclusion:
|
Because there is already an "v2.0.0+incompatible" version (GOPATH, but defective), and all v2+ versions (model mode) are not available for download, I will moving forward in this direction:
note: drop the idea to support for GOPATH in v2+, because this will force rollback of all dependencies to GOPATH-compatible versions |
Unfortunately, the new v2+ package (v2.1.0) package is still not available. But if you click on Open Source Insights at this page, you can see the package. On the dependencies there is a problem with tinygo.org/x/bluetooth. Maybe this prevents publishing the new package, because this is now important in module mode, but was not in GOPATH mode. So a new idea would be to deactivate/remove the ble adaptor and remove the problematic dependency from gobot for a test with a new version 2.2.0. @deadprogram what do you think? |
Those are all only included in tinygo.org/x/bluetooth when built to run bare metal on Nordic Semi microcontrollers by TinyGo, and not for Linux/macOS/Windows. The files with those references are protected by build tags like this: https://github.com/tinygo-org/bluetooth/blob/release/adapter_nrf51.go#L1 I will try to look into what might be the problem with the Gobot build. |
There is no build problem, but there is a small chance, that the publishing of the "module mode releases" (like 2.1.0) are blocked due to this missing modules. This is only a "static" dependency problem. |
I think the core problem here is we were missing the needed custom domain redirect to handle the
I added this PR to the Now the v2 Gobot package appears to be working as I expect from one of the repos that I have which uses it: This was what I first ran to update the
Hmm now it is compatible? Sweet!
After that I was able to build my code using v2 and Bluetooth:
|
Hi @deadprogram , Thanks! It sounds like a hack, but it works, also for pkg.go.dev. Lets see what happen with v3 - depending on gobot-site for all upcoming versions feels wrong to me. |
It is not a hack, it is how "vanity domains" work. See https://pkg.go.dev/cmd/go#hdr-Remote_import_paths Also see https://twitter.com/rakyll/status/892805962867683328 |
Hi @deadprogram , thanks for the enlightenment, although I have not understand the content of the provided links completely. I thought the redirect is done "automatically" in the background but I see now that there was the same for the v0/v1 present at gobot-site. So my earlier guess, was not so bad 😄:
Thanks again, so we are prepared for v3 and I can close this issue immediately. |
I wish I had noticed your earlier guess, you had the right idea about what was going wrong! |
latest recognized version seems to be 1.16.0:
try to install version 2.0.0 will result in an error:
For root cause, see e.g.: https://research.swtch.com/vgo-import
the solution: https://github.com/golang/go/wiki/Modules#semantic-import-versioning
example: https://github.com/cpuguy83/go-md2man/blob/master/go.mod
The text was updated successfully, but these errors were encountered: