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: all pattern in per package flags is inaccurate in module mode #71318

Open
matloob opened this issue Jan 17, 2025 · 0 comments
Open

cmd/go: all pattern in per package flags is inaccurate in module mode #71318

matloob opened this issue Jan 17, 2025 · 0 comments
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@matloob
Copy link
Contributor

matloob commented Jan 17, 2025

all has a slightly different meaning in module mode than it does in GOPATH mode. In GOPATH mode, it's pretty much everything:

In GOPATH mode, "all" expands to all packages found in all the GOPATH trees.

But in module mode, "all"

expands to the set of "packages in the main module (or workspace modules) and their dependencies, including dependencies needed by tests of any of those"

according to go help packages.

We don't seem to handle this correctly when processing "all" in -coverpkg and the per package flags -asmflags, -gccgoflags, -gcflags, and -ldflags. The cmd/go/internal/load.MatchPackage function just matches every package for all.

@matloob matloob changed the title cmd/go: all pattern in per package flags is not totally correct in module mode cmd/go: all pattern in per package flags is inaccurate in module mode Jan 17, 2025
@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 17, 2025
@mknyszek mknyszek added this to the Backlog milestone Jan 17, 2025
@mknyszek mknyszek added the GoCommand cmd/go label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants