cmd/go: "malformed import path" in Go 1.16 for packages with path elements containing a leading dot #43985
Comments
Hmm, this package doesn't have a valid import path in module-aware mode. From
However, I'm guessing this isn't a package that's ever imported. Perhaps the |
Hrm, I'm not sure. We disallow a leading dot in general because it can make code harder to audit: in environments that hide dotfiles by default we don't want to hide the source code for the dependencies of a Go package, and path elements beginning with |
Correct. |
For a bit of context, I'm doing this because having a I'll leave it to @bcmills and @jayconrod to determine whether it's necessary to continue supporting this pattern given it used ti work in |
I think we should keep this open since it used to work, and in most other situations, the go command allows a package with an invalid import path to be named using a file path. Probably not for 1.16 at this point in the freeze though. |
After looking at this a bit further, I think we should close this. It's pretty ambiguous though. If more folks run into this issue in new situations, we can reconsider.
|
Just tried building on 1.16rc1 and this breaks our builds:
Is there any workaround available? |
See previously #34992. |
Change https://golang.org/cl/291389 mentions this issue: |
I did some investigation, and found that the prohibition on leading-dot elements was added in CL 124378, back in July 2018. We attempted to investigate the prevalence of these paths in the wild using the The only specific affected module we know of so far is After discussion with @rsc, @jayconrod, and @matloob, we're planning to leave this validation in place for Go 1.16. If we find more severe examples after the release, we can consider whether to relax the check in Go 1.16.1. If you are affected, please comment on this issue with the affected module path(s) and versions. |
…sallowed For #43985 Change-Id: I1a16f66800c5c648703f0a0d2ad75024525a710f Reviewed-on: https://go-review.googlesource.com/c/go/+/291389 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Thanks for the report Paul, and thanks for the discourse and debugging everyone. @bcmills you mailed and merged the documentation CL https://go-review.googlesource.com/c/go/+/291389, should we thus move this issue out of Go1.16 and roll it forward for Go1.17 and consider a backport if necessary for Go1.16.1, as you raised in #43985 (comment)? |
@odeke-em, I don't think this issue should be rolled forward to Go 1.17 since we don't plan to do anything more about it. Perhaps it should just be closed, but we discourage folks from commenting on closed issues and we are actually interested in receiving comments about concrete examples here. Maybe Unplanned is the right milestone for that. |
Awesome, thanks for the explanation and for moving it out of the Go1.16
milestone!
…On Tue, Feb 16, 2021 at 9:43 AM Bryan C. Mills ***@***.***> wrote:
@odeke-em <https://github.com/odeke-em>, I don't think this issue should
be rolled forward to Go 1.17 since we don't plan to do anything about it.
Perhaps it should just be closed, but we discourage folks from commenting
on closed issues and we *are* actually interested in receiving comments
about concrete examples here.
Maybe Unplanned is the right milestone for that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#43985 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFL3V3SWWQBF4UVK4HFR6TS7KVCXANCNFSM4WYQ3G2Q>
.
|
Actually, consumers of that package might also import packages from the If it only gets fixed in the latest release then consumers will also be forced to upgrade their Cadence server component (to ensure compatibility between the client and the server) or to stay on Go 1.15 until they do. |
The Gardener project (https://github.com/gardener) is affected by this change, too. |
Due to import restrictions: golang/go#43985
Due to import restrictions: golang/go#43985
This is an unexpected breaking change in Go 1.16 for all our builds using Raised initially here until I've found out that the issue is in All our |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Passing test
What did you see instead?
This has the effect of breaking commands like
go generate ./.github/workflows
I bisected this to 3a65abf
cc @bcmills @jayconrod
The text was updated successfully, but these errors were encountered: