-
Notifications
You must be signed in to change notification settings - Fork 540
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
Discussion: Break go get
compabibility
#498
Comments
@mattfarina thank you for opening this issue and being open to thoughts from the community. #298 is at least part of what prompted this issue. I, and many others on that thread, would like to be able to use Glide in conjunction with GitHub Enterprise and other code hosting solutions without resorting to adding the ".git" suffix all over the place. Note that currently the only workaround is to not only add ".git" to glide.yaml, but to add it to every place in your source code where the package name appears, as well as to rename the relevant directories in GOPATH to include the ".git" suffix.
For my public projects, I will continue to maintain I would be curious to hear if anyone would be adversely affected by breaking |
No. I don't want Glide to be orthogonal to Go's build process; instead it should work with & enhance it. One reason I use Makefiles to manage my projects' build processes instead of something like gb is because it replaces Go's toolchain and the surrounding ecosystem instead of enhanching it. Sure, the To that end, if Glide were to break compatibility, I'd just have to stop using new versions of Glide. As crappy of a boyfriend it makes me, I think this is the classic Elaine issue from Seinfeld. I won't date someone who is a bad breaker upper. In this case it means I don't want to buy into a tool that I cannot easily replace if something happens to its maintainer or its direction. I love Glide today because even with all the tremendous value it adds, if @mattfarina turned out to be an alien who is returning to his home planet and taking his code with him, ultimately it won't be the end of the world. I may have to replace Glide, but I won't have to shift my understanding of my projects' entire dependency workflows. |
I never include the extension and it works fine for me. |
An issue brought up in other tickets... just to add context... is the Great Firewall of China that blocks some requests to sites that offer the Without suggesting how to fix this it is one that would be nice to fix because there are so many users there. @albrow GitHub Enterprise is an easy-ish one to make better without breaking compatibility (technically). In a This isn't a break in compatibility for the |
IMO, the case @mattfarina presented in the OP actually has very little to do with glide. This is the kind of thing that's easy to go in circles on, because the question we're asking is kinda circular:
The glide, even today, has different, more variable answers for the first, and a looser, though still mostly single answer to the second. That
So, as @albrow pointed out over in #298, adding the Take, for example, the particular case presented in the OP:
The only reason we're talking about this case is because the obvious transformation from
is TOTALLY Moreover, the red herring is harmful - it takes us wandering into the territory of the second question I initially gave - "what import path does a given network URL correspond to?" Here's why:
Bottom line: we can't answer any of these classes of questions, or even know how to apply configuration that a user has explicitly given, until we've inspected the source. And THAT is itself version-specific...because what if the author of So, my thought: glide has already broken - repo-patterns
- my-ghe
- pattern: '^(?P<importroot>(?P<root>github\.example\.com)/([A-Za-z0-9][-A-Za-z0-9]*[A-Za-z0-9]/[A-Za-z0-9_.\-]+))(?P<packages>(?:/[A-Za-z0-9_.\-]+)*)$' Total pseudocode there, but the point is, named capture groups with specific, magic names, which we could then plug in to a generic matching algorithm. People can write support for their own hosting platforms into their |
I disagree that enabling a package to point to a different repo location is breaking compatibility. I guess I need |
Maybe it is just silly semantics - we do need a definition. But import rewriting, while IMO worth contemplating, should not be conflated into this property. It's a wholly different kind of operation relying on a different class of information. Some kind of declarative solution, whether it's the regex or something else, should be sufficient for this need, and render glide no more "broken" than it already is. |
Hey, I'm all against import rewriting. I thought that's what you were suggesting. My point is if Glide didn't enable importing forks into primary repo locations, import rewriting would be required. Glide avoids this by virtue of what I mentioned. To me that doesn't break |
sorry, i edited that too much, i meant:
to be in an agree-y tone, not a disagree-y tone :) |
I was drafting a response to point this out, but it seems @sdboyer beat me to it :) In my opinion, there is not much merit in continuing to discuss whether Glide should break compatibility with This may be obvious, but no one has mentioned it yet. Even without specifying custom remote locations, it is trivial to set up a project which works with Glide and does not work with If you care about strict compatibility with |
I think we need to define compatibility so let me take a shot.
Glide The way to look at solving for this is from a user experience point of view. What experience will give the users the fewest WTF moments and why? |
I wholeheartedly agree.
I want to ask for some clarification. It seems to me that the only advantage of adhering to this definition of compatibility is that you can run Would you agree with these statements? Are there any other advantages of adhering to this definition that I did not mention? |
I did have a head scratcher because I assumed the example in the opening post should work but didn't. However in some cases it looks like it works, for example Because of that I think the example in the opening post should work in the same way. |
Maybe it can be implemented as a command flag. |
@mattfarina it's been more than a month since we've heard from you on this thread. I don't see how the definition you have proposed is helpful for developers. I would love to hear some examples or learn more about your reasoning. I already mentioned that by design Glide will install different versions of a repository compared to Furthermore, since Glide currently allows you to specify a different remote location via the I have provided two reasons why your definition of compatibility with #298, which partly sparked this discussion, describes a real-world annoyance that I and others have run into. Unless you can provide counterexamples, I maintain that fixing that issue will definitively not break compatibility with As I have already mentioned, if you care about I would appreciate hearing your thoughts. |
The definition I was referring to, in terms of scope, is with the paths used in For example, when Each of these works with The question is, should Glide instead allow you to map: - package: foo/bar
repo: https://git.example.com/baz/foo.git
subpackages:
- bar
When it comes to the version of the source to use there is an intentional break. |
No, it should not be allowed. |
I would like to add a use case here. I have to use a VSTS git repo and I would like to use glide. The issue is that those repo don't use the .git extension (and in addition the url has a space in it...): https://mycompany.visualstudio.com/a%20name%20with%20space/_git/mypackage Today I use glide like that:
it does not spit out any error and does seems to install & update the dependency but its far from ideal. I don't think I should have to manually ignore all the subpackage in my package. |
@Cedric-Venet is |
@sdboyer yes the pattern seems to be [acount].visualstudio.com/[project]/_git/[repo] so adding a pattern would be great, but I am not sure it would solve my use case as go did not seems to access import with space in it and using %20 neither so even if glide where to get the dependency correctly, I could not use them without having some way to alias it. |
@mattfarina I understand pretty well what your stance is. I'm moreso asking why? Given the points I have brought up, how does adhering to this definition of compatibility help developers? Among other things, I'm asking why should we allow this: - package: github.com/someuser/differentrepo
repo: https://git.example.com/baz/foo.git
subpackages:
- bar And not this? - package: foo/bar
repo: https://git.example.com/baz/foo.git
subpackages:
- bar |
In
glide.yaml
files thepackage
needs to be compatible with names thatgo get
can fetch. This is true even for cases where arepo
is specified to get the package from. This helps us to maintain compatibility withgo
tools including the names referenced in the source.But, on multiple occasions people have wanted to specify something like:
And then reference
example.com/foo/bar/baz
in theirimport
statements.This will break compatibility with
go get
. This is the case you can'tgo get example.com/foo/bar/baz
.Instead you'd need to
go get example.com/foo/bar.git/baz
but that also means your import statements need to reflect that path.So, should Glide break with
go
or stay compatible? Why? What implications concern you?The text was updated successfully, but these errors were encountered: