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: "go get" fails on import path patterns with wildcards ("...") [1.10 backport] #29247

Closed
gopherbot opened this issue Dec 14, 2018 · 2 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Milestone

Comments

@gopherbot
Copy link

@bcmills requested issue #29241 to be considered for backport to the next 1.10 minor release.

@gopherbot, please backport to 1.11 and 1.10 immediately: this is a major regression.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Dec 14, 2018
@gopherbot gopherbot added this to the Go1.10.7 milestone Dec 14, 2018
@bcmills bcmills self-assigned this Dec 14, 2018
@bcmills bcmills added the CherryPickApproved Used during the release process for point releases label Dec 14, 2018
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Dec 14, 2018
@gopherbot
Copy link
Author

Change https://golang.org/cl/154111 mentions this issue: [release-branch.go1.10] cmd/go/internal/get: move wildcard-trimming to before CheckImportPath

@gopherbot
Copy link
Author

Closed by merging 25bee96 to release-branch.go1.10.

gopherbot pushed a commit that referenced this issue Dec 14, 2018
…o before CheckImportPath

Previously, RepoRootForImportPath trimmed certain "..." wildcards from
package patterns (even though its name suggests that the argument must
be an actual import path). It trimmed at the first path element that
was literally "..." (although wildcards in general may appear within a
larger path element), and relied on a subsequent check in
RepoRootForImportPath to catch confusing resolutions.

However, that causes 'go get' with wildcard patterns in fresh paths to
fail as of CL 154101: a wildcard pattern is not a valid import path,
and fails the path check. (The existing Test{Vendor,Go}Get* packages
in go_test.go and vendor_test.go catch the failure, but they are all
skipped when the "-short" flag is set — including in all.bash — and we
had forgotten to run them separately.)

We now trim the path before any element that contains a wildcard, and
perform the path check (and repo resolution) on only that prefix. It
is possible that the expanded path after fetching the repo will be
invalid, but a repository can contain directories that are not valid
import paths in general anyway.

Fixes #29247

Change-Id: I70fb2f7fc6603b7d339fd6c02e8cdeacfc93fc4b
Reviewed-on: https://go-review.googlesource.com/c/154108
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/154111
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
@golang golang locked and limited conversation to collaborators Dec 14, 2019
@rsc rsc unassigned bcmills Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants