-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: go list filtering is too coarse #30592
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
Comments
This seems like a very specific need; why not build a simple Go program to perform this with https://golang.org/pkg/go/build/? Also, as explained in #30504, it's not clear that it would be possible for |
I agree with @mvdan that this doesn't seem to make sense for the go tool. If we did add something to the go tool, what specifically do you suggest? |
The problem with such an approach is that the sanity checks you code end up diverging from the sanity checks go upstream builds in its own tools, and this divergence is the source of tricky bugs.
I want to load a Go module because Go is moving to modules. The sources of a module are a directory tree not a single package. |
So you want to list all source files for a Go module? What does that have to do with |
or
(and I know the difference between tags and arches is quite weak in Go right now but for an integrator they are not the same thing at all, one is a technical target, the other a functional one) |
Because we integrate for a specific OS, and the support files for other OSes cost us all the other OS-specific imports in those files, when we have no use for them. |
I personally think this is unlikely to happen in Also note that the Finally, it seems to me like I still think this should be a separate tool; for one, I've never heard of anyone else with these specific needs. If you think this is a very common need, it would be helpful to give some proof or examples.
Your tool could be built on top of |
That's just adding an indirection to get to the files part.
That is nice to know thanks
That's why I wrote “I know the difference between tags and arches is quite weak in Go right now but for an integrator they are not the same thing at all, one is a technical target, the other a functional one“ You can change your functional build target. You can not change the arches you build for (not if you want the result to run on the target hardware).
It's a Linux distribution need. We distribute for Linux, thus, we care only about a single system. We build lots of apps, and arches, thus we care about all build tags and arches. We reprocess upstream source files, because if they had no need of reprocessing, our users would just get them directly, without using distribution packages. Reprocessing implies lots of filtering and selecting steps. And, it's quite painful to report all that to Go upstream, because the generic answer is "why are you doing all those distributor things, we find no need for them". We do those things because we are a distributor and they constitute the distributor raison d'être. The go project does not do that because it's not a distributor (and violently does not want to be, hence the emphasis in shipping everything unchanged). |
@bcmills for further comments. |
sounds like we agree it's too niche for go. |
I need
go list ./...
to print all the files involved in testing or building on the linuxGOOS
, regardless of the target architecture or project-specific constrains such asselinux
orapparmor
.Unfortunately
IgnoredGoFiles
does not cut it because it also includes files for other systems, and windows for example is so different from linux that it pulls it all lots of things I have no use for and can not satisfy in my environment.So
go list ./...
needs a way to set some form of context, different from everything or current systemgo/packages
does not cut it either because as far as I can see its scope is package-specific when I need a module scope (./...
)The text was updated successfully, but these errors were encountered: