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

cmd/go: check for change in custom import path repo even without import comment #16471

Closed
jba opened this issue Jul 22, 2016 · 4 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@jba
Copy link
Contributor

jba commented Jul 22, 2016

  1. What version of Go are you using (go version)? go 1.6

This is a re-open of #10952. The issue was that a change to the form of a repo's URL would lead to an erroneous error during "go get -u". In that case, the error alluded to a custom import path even though there wasn't one.

The fix was to only perform the check if the package had an import comment. This conflates having a custom import path with having an import comment. If (a) there is a custom import path, (b) there is no import comment, and (c) the repo pointed to by the import path changes, then "go get -u" will incorrectly pull from the old repo.

The right fix is to resolve the import path to a repo URL, and compare that to the origin of the local repo.

@quentinmit quentinmit added this to the Go1.8 milestone Jul 29, 2016
@quentinmit
Copy link
Contributor

Can you please provide sample code/setup that demonstrates this problem?

@quentinmit quentinmit added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 6, 2016
@rsc
Copy link
Contributor

rsc commented Oct 21, 2016

The bug report has enough information to reproduce the problem.

@rsc rsc added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Oct 21, 2016
@gopherbot
Copy link

CL https://golang.org/cl/31658 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/32641 mentions this issue.

gopherbot pushed a commit that referenced this issue Nov 3, 2016
The goal of the test is to provoke a custom import path check error,
which will contain the current repo path, to see that it says ssh:// in it.

But the fix to #16471 made the test no longer provoke that error.
Provoke the error by checking out from rsc.io instead of github.com/rsc.

Fixes #17701.

Change-Id: I750ffda2ff59c2be8e111d26160997214a73fd9a
Reviewed-on: https://go-review.googlesource.com/32641
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Nov 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants