-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: in module root, go list {module-root}/... behaves differently than go list ./..., yet go mod tidy removes go.sum entry needed for former #51283
Comments
Note, this issue was discovered in CL 387014 because the Go build system currently runs I'm not sure which format is better for TryBots to use (I thought they'd be pretty much interchangeable), and it's not hard for us to change it if desired. But that should be a separate issue. |
Also worth noting a difference in error text between when
Notice the helpful The Go 1.18 draft release notes mention:
Since x/exp/shiny only recently became a separate module (previously all of its packages were inside x/exp), and neither x/exp nor x/exp/shiny modules provide a package at import path |
Indeed. The reason However, So unfortunately, I'm not entirely sure about the right path forward here. It seems wasteful in the general case to add a checksum for the selected version of |
Ah, this distinction is very helpful to be aware of and certainly explains this, thanks. Do you know if it is already documented somewhere? I tried looking at https://pkg.go.dev/cmd/go#hdr-Relative_import_paths (and the rest of that page) and https://go.dev/ref/mod, but couldn't spot it so far. (Perhaps documenting it is a part of future work, if so, that's not a problem.) |
I expected the difference to be mentioned in https://pkg.go.dev/cmd/go@master#hdr-Package_lists_and_patterns, but it doesn't appear to be there. 🤔 |
So is this all Working As Intended?
Getting back to this CL, if "go mod tidy" is still a no-op in my x/exp/shiny directory, should I manually edit the go.sum file, in order to pass the trybots? |
@nigeltao Take a look at #51283 (comment). I suggest using Since this issue is still open, I understand there's a chance something will change in the future, but existing Go versions are working as described above. I've opened #51455 to consider changing the TryBot behavior to test packages in each module via the "./..." import path pattern instead of "{module-root}/...". |
I think #51455 is clearly the correct short-term fix. I do not see manual edits to the |
For a longer-term fix, we could consider adding a However, that would lose some test fidelity: it would test each package against the MVS solution for the I think if we did that we would also need the TryBots to check that |
I think both the x/exp specifics and coordinator testing strategy (#51455) are in an okay shape by now, and not in scope of the problem described in the initial report here. Since it has the Thinking label, I think it's okay to be in Backlog so there's no timing pressure to find the optimal cmd/go solution here. I'll tentatively move it there as a next step (since I filed the issue), and Bryan or Michael can feel free to refine the milestone further as needed. |
Change https://go.dev/cl/455916 mentions this issue: |
The new version handles the supportsFeatureSet deprecation on macOS 13. That deprecation was causing a warning that the builders promoted to a test failure. Also run 'go mod tidy' here now that go.dev/issue/51455 is fixed. Fixes golang/go#57140. Updates golang/go#51283. Change-Id: I8e25e736409c5472214428fcda9cccc46020b0c8 Reviewed-on: https://go-review.googlesource.com/c/exp/+/455916 Reviewed-by: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
It reproduces with
go1.18rc1
.Not really viable to test with Go 1.17.7 because it happens in a module whose go.mod file has
go 1.18
, sogo1.17.7 mod tidy
refuses to run on it:What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I ran
go mod tidy
inside a module that declaresgo 1.18
. It removed one line from go.sum. Then I tried runninggo list {module-root}/...
andgo list ./...
while being at the module root directory, without using the new workspace mode (that is,go env GOWORK
output was blank).(See the bottom of this issue for a sequence of exact commands that reproduce the issue.)
What did you expect to see?
I expected both
go list {module-root}/...
andgo list ./...
to work, and produce identical output, given the current working directory is the module root.(I also expected that the amount of work needed to process these two relative and full import path patterns would be approximately the same. If that's not the case, I'm interested in learning what makes them different.)
What did you see instead?
Running
go mod tidy
causes the following line to be removed from go.sum:Then, when I ran
go list {module-root}/...
, it failed:Notably, it's saying the go.sum entry from
golang.org/x/[email protected]
is missing, the very same one thatgo mod tidy
removed earlier.go list ./...
works well.If I manually add the missing go.sum entry back, then the longer go list invocation produces an identical result:
Sequence of commands to reproduce
CC @bcmills, @matloob.
The text was updated successfully, but these errors were encountered: