-
Notifications
You must be signed in to change notification settings - Fork 117
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
Unstable Import Paths #61
Comments
Isn't |
It is, but notice that go modules only resolves to 3.1.0 with gofrs/uuid when using mods.
So, yes, when using modules and /v3 everything works correctly. But if you use that, then it breaks those not use modules.
If you don’t use /v3 it works for both, but won’t resolve past 3.1.0.
…On Nov 19, 2018, 12:57 PM -0500, Adam Shannon ***@***.***>, wrote:
Isn't github.com/gofrs/uuid/v3 v3.1.2 // indirect the desired outcome? I'm not aware of any cross Go version support for Go module import paths.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yea and I'm not sure of support for compiling Go <1.11 with module import paths. This sounds like a problem all Go projects that adopt modules and cross compile have. |
There are two ways you can fix it.
https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher |
If a branch is created and called |
I believe the branch approach only works for >1.9.7, but don't quote me on that. |
See golang/go#27430 and golang/go#25967 (comment). For maximum compatibility, leave the original |
Finally, I have a tool in the works that may help for cases like this one: the |
Hi all, I wanted to circle back to the original problem report for this issue:
and:
The bit I wanted to try to clarify is that IF you are using Go 1.9.7 as a client of this Part of the tricky bit is that if you are using Go 1.9.7, then I believe you should not include the It might be simplest to show by example. Here we'll download an older Go 1.9.7 toolset, then show getting, importing, and using # 1. Verify we do *not* have GO111MODULE set:
$ echo $GO111MODULE
# 2. Install Go 1.9.7 if we don't have it:
$ go get golang.org/dl/go1.9.7
$ go1.9.7 download
# 3. Using Go 1.9.7, 'go get' the package of interest.
# KEY POINT: do not use '/v3' for 'go get' here:
$ go1.9.7 get github.com/gofrs/uuid
# 4. Still using Go 1.9.7, we create, build, and run a trivial client within GOPATH:
$ mkdir -p $GOPATH/src/example.com/sratchpad/uuidhello
$ cd $GOPATH/src/example.com/sratchpad/uuidhello
$ cat <<EOF > hello.go
package main
import (
"fmt"
"github.com/gofrs/uuid"
)
func main() { fmt.Println(uuid.Must(uuid.NewV4())) }
EOF
# 5. Build using Go 1.9.7, then run successfully:
$ go1.9.7 build .
$ ./uuidhello
e3ef4eea-6df5-420e-a6b7-39e3b2be0927 That behavior demonstrated there is part of the "minimal module awareness" that was added to Go versions 1.9.7+, 1.10.3+ and non-module-mode 1.11 so that code built with those releases can properly consume v2+ modules without requiring modification of pre-existing code. That behavior is covered in a little more detail here:
And as @markbates already demonstrated above in #61 (comment), code that has opted in to modules using Go 1.11 ends up working as well. The net of all that is that IF you are willing to require clients to use versions Go 1.9.7+, 1.10.3+, and 1.11, then I think things work. However, if you want to support versions older than Go 1.9.7, then the All that said, I am not sure what is the best alternative to support the particular goals of this project. I am just a member of the community trying to share my personal understanding of how things currently work, but I am certainly happy to learn more, and apologies in advance if anything I've said here is off-base. |
@thepudds you're missing the point. there is NO SINGLE import path that works for EVERYONE. If you use If use If use As someone out there writing code in the real world, I need to support everyone. I feel as though I have clearly demonstrated this is broken on this ticket. |
I apologize if my tone is strong on that, but I continue to fight this same issue across many repos because it is not clearly understood and can easily be broken if not done correctly. This is only a problem if you care about those either using mods/ or not using mods. If you don't care, then this isn't an issue. |
Hi @markbates no worries, we are all on a voyage of discovery here. ;-) The main distinction I was trying to draw is that IF support is restricted to Go 1.9.7+, 1.10.3+ and 1.11, then I think "things work" (and without requiring use of a Supporting older Go versions like Go 1.8 is a bit trickier, though. |
Thanks for the detailed report. I think we should do everything we can to support all users, and as many Go versions as we can. It is still not clear to me exactly what we should do, though. @markbates says we should use a On the other hand, @bcmills says we should use a In any case, it seems like moving one version of the package into a |
I'm with fine with either Packr is |
Hmm, looking at it more, it seems like we should have bumped major versions when adding modules support, but we didn't. Is that the cause of Given that we, unfortunately, didn't bump major versions, what is the best course of action now? Should we rectify the mistake by moving to |
Yeah, the "logic" (I mean modules logic) is to use the last version that didn't have a My vote, is |
Okay. Sorry if I'm being obtuse, but I want to make sure we get everything right, so I will recap. My understanding is that for maximum compatibility, we should:
Does that sound right? |
You should remove the root go.mod as well, since root is actually v3.
…On Nov 19, 2018, 10:49 PM -0500, Andrei Tudor Călin ***@***.***>, wrote:
Okay. Sorry if I'm being obtuse, but I want to make sure we get everything right, so I will recap. My understanding is that for maximum compatibility, we should:
• leave the current contents of the root directory untouched
• create a copy of the code in a /v4 subdirectory
• create a go.mod with module github.com/gofrs/uuid/v4 in the /v4 subdirectory
• update the documentation to recommend github.com/gofrs/uuid/v4 as the one true import path that works for everyone
• push all of this up, then cut v4.0.0
Does that sound right?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Create a new /v4 directory, containing a copy of the existing code, allowing the package to move forward and be consumed by all users under a unified import path: github.com/gofrs/uuid/v4. Remove go.mod file from the top level directory and add it to the v4 directory. Update v3 to v4 in go.mod. Update documentation to reflect the change: Recommend v4.0.0+ as the go-to version for new users and existing modules users. Recommend v2.1.0 under github.com/gofrs/uuid as the go-to version for users looking for a replacement for satori/go.uuid at v1.2.0. Document the two different import paths and their behavior. Fixes #61.
I agree with @markbates: if existing call sites are written against (The presence of the |
Note that |
Two related but perhaps separable questions might be: Q1. What does the gofrs organization view as the best way forward for the Q2. Is the There is a discussion going on elsewhere within the gofrs team regarding Q1, I think. One semi-related question: does anyone know the minimum version of Go required for https://gobuffalo.io/en/docs/installation#requirements
But I am not a |
Regarding:
Having looked at it a bit more, as far as I can tell:
Of course, happy to learn more here, and this is not based off of any type of exhausting testing or assessment. |
Go 1.9.7+, the same requirements as gobuffalo/buffalo. |
Once again, YES IT IS BROKEN if you care about supporting everyone with the same import path. Please stop arguing that point, everyone else agrees it is broken.
…-----------
Mark Bates
On Nov 20, 2018, 2:51 PM -0500, thepudds ***@***.***>, wrote:
Regarding:
> Q2. Is the gofrs/uuid repo broken as it stands today?
Having looked at it a bit more, as far as I can tell:
• It seems the gofrs/uuid repo in effect currently requires Go 1.9.7+, 1.10.3+ or 1.11.
• The gofrs/uuid repo in its current state seems to work with those versions of Go.
• However, it might not have been intentional that gofrs/uuid in effect requires Go 1.9.7+, 1.10.3+ or 1.11.
Of course, happy to learn more here, and this is not based off of any type of exhausting testing or assessment.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@markbates, we're all trying to figure out a useful path forward. Please be patient and charitable. You say:
But you haven't said what the concrete issue is. If Is the problem:
|
What about the forwarding declarations? Did you catch that part of the proposed solution? Have you looked at c6f696b? Is this not acceptable either? Are we breaking current /v3 callers altogether? |
@markbates Please don't apologize for being frustrated; it's on the Go authors for pushing modules on to us. I'm getting more and more frustrated trying to defend the choices to outsides / newcomers to Go, especially when I don't believe in it myself. |
@acln0 I think the streams may have been crossed with my edit:
|
You are proposing to intentionally break the builds of callers who are using the We made a mistake introducing the go.mod file as we did, and now we need to own up to that mistake, not break people's builds because of our personal opinions. |
@acln0 Everyone here has commit access and can pursue anything they want. I am not a decider, gate-keeper, or benevolent dictator. I am offering my opinion of what I don't wish to support or pursue, if others in the Gofrs wish to purse that I am not a blocking voice. And to that point, since it seems my dislike of modules has become so contentious to the Gofrs organization and my intent when starting the group, I hereby relieve myself of technical involvement in deciding in this issue and others. |
In other words, move forward how y'all feel appropriate on this issue. Let me know what I can do to support that decision. |
It's worth doing some homework on this to understand what exactly we're going to break and how. We should test with multiple toolchain versions, We're also going to provide a detailed experience report to the Go authors if any interesting findings come out of it. |
Step 1 in removing go modules opt-in support without breaking any builds.
Hi @markbates, After quite a bit of deliberation over the span of a month, we decided that the best thing to do to deal with this issue was to remove module support until it becomes more mature. We realize that this is likely less than ideal for you. But this decision comes based on several factors:
We feel that the best solution to address the above problems and provide a single canonical path that resolves to the latest version is to drop support for modules in the interim and release 3.2.0. This will allow all consumers on 3.2.0 to once again import without the /vN path and have version consistency. Module-based consumers will not be able to upgrade to 3.2.0 until they remove the The README update in #67 offers some additional context and what precisely will be conveyed to consumers of this dependency as they upgrade to v3.2.0 or beyond from the module supported versions. Thanks for reporting this issue and your continued patience with us as we worked through this. |
@DamareYoh Thank you for adding the summary here. In the interest of full transparency because there's a lot of context in this issue: as |
Removing modules in v3 was what I was hoping for, so I’m happy. I would love to see a /v4 that did have modules though. :)
…On Jan 11, 2019, 12:35 PM -0500, Tim Heckman ***@***.***>, wrote:
@DamareYoh Thank you for adding the summary here. In the interest of full transparency because there's a lot of context in this issue: as modules becomes mature, and other things happen in the ecosystem to better support interoperability, we will adopt modules so that we are able to meet the needs of the community.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
With the introduction of the
go.mod
file and declaration ofgithub.ghproxy.top/gofrs/uuid/v3
there is no longer a single import path that works correctly for both modules and non-modules users.This has become an issue with gobuffalo/pop and other Buffalo projects.
Below you find a selection of
go get
statements that represent the different import paths and what happens when trying to use them in different environments.Go >1.9.7 (or
GO111MODULE=off
)Go 1.11 (
GO111MODULE=on
)The text was updated successfully, but these errors were encountered: