-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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: get reports "module source tree too big" #29210
Comments
macbookpro:github.com fredlee$ du -sm therecipe/ |
As I noted in https://golang.org/cl/150738: I had a look at Those files should be pruned from the module (either by pruning them from the repository itself, or by placing another At that point we may find that we need to adjust |
(CC @therecipe; see also therecipe/qt#726) |
Yeah, these files are only necessary for certain builds such as for HomeBrew and MacPorts builds on macOS or MSYS2 builds on Windows, as well as for an backward compatibility feature. It is planned to prune and segregate the Is there some technical reason for the size limitation? I did take a look at the patch to work around this and noted that there are also limits for the go.mod and License files in place. Which strikes me as odd tbh, I mean there is usually no reason for License files to exceede this limit, but why also limit the size of go.mod files? I would propose to remove these limits altogether, if there is no technical reason for them to be in place. Other people will otherwise rise additional issues down the line, if they try to bundle binaries and build something like https://pypi.org/project/tensorflow-gpu/#files in Go (which is 1GB uncompressed), one project in Go I know of that already does this is https://github.com/dontpanic92/wxGo (which is 400MB uncompressed). And I also planned to distribute binaries sometime in the future, to make the use of |
Why would those repos be relevant to the module limit? The
The |
Yeah, one could handle this in an additional build step, but what about C/C++ binaries someone wants to bundle to make ones repo "go get-able"? If there would be some way to execute arbitrary commands from the "go get" command than this wouldn't be an issue, but since there isn't the only idiomatic way to go about this is to bundle these binaries in the repo or in some platform specific extra dependency repo.
Yes, this holds some truth, but the setup requiered for the repo to work is usually a couple GB in size and so the size of these files can be easily neglected in most cases. However, is there any technical reason for the size limit of repos? |
If we find concrete examples of otherwise-module-compatible code that hits the size limit due to content actually needed for the module build, we can certainly consider increasing the limit.
For one, it detects modules that accidentally include large files that aren't relevant to module builds. 🙂 |
Okay, that was poorly phrased from my end.
Mh, yes that makes sense but wasn't really considered when resolving #25470 it seems However, you got me thinking. Can I simply create another module (i.e. create another go.mod file in If yes, than this would be a trivial fix from my side and I'm sorry that I wasted both of our time. |
That should work, I think. (If it does not, please file another issue and I'll investigate.) |
Okay, I looked into the module support. I think I start to undestand now how modules are intended to be used and it seems like I want to use them in a way they are not meant to be used. The long term plan is to also distribute versioned C binaries and header files to be used alongside pre-generated go code without the need for a custom build system (i.e. create a "go get-able" module), at that point the current size limit might be a problem as well. You already said that if I use an custom build system then
yes, I could fetch the indirectly go build related files at some point after "go get", but that makes things only unnecessarily complicated for everybody involved. I can agree with the reasoning behind these limits, but in my opinion they are only weak hurdles (which are also only weakly enforced #25470) to keep people on track. Btw, thanks for your time :) |
Okay, I worked around the size limit with therecipe/qt@5251d34#diff-4461efdc93245626ff859334a9abf39c for now. However I still think that the size limit shouldn't be enforced by the go tool and people should be able to decide for themselves. |
@bcmills - anything else to do here ? |
Don't think so. Folks can file separate issues if they discover other repositories that don't fit. |
macbookpro:tmp fredlee$ go env
how to fix it
The text was updated successfully, but these errors were encountered: