Skip to content
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

x/vgo: canonical import path checking breaks some existing packages #24102

Closed
rogpeppe opened this issue Feb 24, 2018 · 8 comments
Closed

x/vgo: canonical import path checking breaks some existing packages #24102

rogpeppe opened this issue Feb 24, 2018 · 8 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@rogpeppe
Copy link
Contributor

go version devel +104445e Wed Feb 7 19:22:09 2018 +0000 linux/amd64 vgo:2018-02-20.1

I'm creating this issue to record the issue. It may be that nothing should be done but get the repo to fix their import paths.

See https://github.com/Altoros/gosigma/issues/2

This issue causes vgo to fail with this error:

vgo: github.com/altoros/gosigma: module path of repo is github.com/Altoros/gosigma, not github.com/altoros/gosigma (wrong case)

It imports OK when using the normal go tool.

@gopherbot gopherbot added this to the vgo milestone Feb 24, 2018
@yansal
Copy link
Contributor

yansal commented Feb 25, 2018

Dup of #23974 I believe.

@kardianos
Copy link
Contributor

I agree this is a duplicate. Closing in favor of linked issue in previous comment.

@rogpeppe
Copy link
Contributor Author

FWIW I don't think this is exactly the same issue, as the repository in question here has neither been redirected or renamed.

@utrack
Copy link

utrack commented Mar 13, 2018

I'd suggest reopening this issue @kardianos - it's not about renames.
If a package path (username?) has uppercase letters in his nickname then vgo breaks the build, ex.:

vgo: resolving import "github.com/Sirupsen/logrus"
vgo: import "github.com/utrack/dplay-go" ->
        import "github.com/Sirupsen/logrus": module path of repo is github.com/sirupsen/logrus, not github.com/Sirupsen/logrus (wrong case)

@kardianos kardianos reopened this Mar 13, 2018
@rsc
Copy link
Contributor

rsc commented Mar 27, 2018

Probably this check is too picky, but I'm not 100% sure what to replace it with.

FWIW, it's not the case that vgo just rejects upper-case letters (it's rejecting lower case for altoros). It rejects import paths that don't match the spelling used on GitHub, specifically to avoid thinking that github.com/Altoros/gosigma and github.com/altoros/gosigma are different import paths. Note that the github account is Altoros not altoros.

@rsc rsc added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Mar 30, 2018
@IngCr3at1on
Copy link

just out of curiosity @rsc do you mind if I ask why it can't be made to fetch the repo into the expected path (it resolved, seems like an error should only occur if resolution fails entirely); I'm sure I'm missing something obvious I'd just like to know what it is? 😄

@bleggett
Copy link

bleggett commented Apr 17, 2018

Since AFAIK the case mismatch doesn't seem to prevent stock go from compiling and running the code, I'd suggest that this should be true of vgo as well, unless there's a technical obstacle to that. If vgo is smart enough to correctly identify the problem, it should be smart enough to warn the user and move on.

Making this a vgo build warning would be the ideal outcome, if that warning could be output on every invocation of build, or at least on initial fetch, but that is probably easier said than done.

@gopherbot
Copy link

Change https://golang.org/cl/107657 mentions this issue: cmd/go/internal/modfetch: update for new gitrepo backend

@golang golang locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

8 participants