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

Comments

@rogpeppe
Copy link
Contributor

commented Feb 24, 2018

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 Altoros/gosigma#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

This comment has been minimized.

Copy link
Contributor

commented Feb 25, 2018

Dup of #23974 I believe.

@kardianos

This comment has been minimized.

Copy link
Contributor

commented Feb 28, 2018

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

@kardianos kardianos closed this Feb 28, 2018

@rogpeppe

This comment has been minimized.

Copy link
Contributor Author

commented Feb 28, 2018

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

@utrack

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

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.

@IngCr3at1on

This comment has been minimized.

Copy link

commented Apr 11, 2018

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Apr 18, 2018

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.
Projects
None yet
8 participants
You can’t perform that action at this time.