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: pass files to compile to compiler in a file instead of on the command line #37768
Comments
OSX has a limit of 256KB for a command line. I don't see any easy way to change that limit. We could try to pass the list of files to compile in a file instead of on the command line. If you're looking for a quick fix, maybe try making each file name shorter. Your names are at least Try passing the |
That is a lot of files. I'm assuming this is a generated package, rather than one hand-curated package that large? If so, #35950 may be relevant. |
but this can compile successfully on os 10.14.3 |
That's the same as 10.15.2. Who wrote that it works on 10.14.3? You're quoting that response, but I don't see the original post of that here. |
Reproduced, unable to build matterbridge on mac 10.15.3 (19D76):
Also reproduced with |
Some one please do |
I'm facing this issue also. This output is from a project I'm working on containing 1919 go files, details listed here: #38569
|
Could you list more of your compile command line? What, exactly, is underneath that I ask because I'm wondering whether file names are relative or absolute, how long they are, etc. If I'm correct that the command line limit is 256K, then you have file names >100 chars long on average. I want to see why those names need to be so long. Or see that they are shorter, and maybe that 256K limit is wrong. |
Sure, I see where you're coming from.
|
So that compiler command line is only 62529 bytes. That's ~4x smaller than the published OSX command line limit. I'm not sure what limit it is bumping up against, then. Maybe the go tool needs to set some shell parameter (ulimit? not sure)? When I paste that command line into my shell, I get:
Which means at least the compiler is starting up fine with that long a command line. |
I don't see anything wrong with Go per se. Here are 2 programs, one Go and one C.
Both run fine. But increase It is string length dependent. Replacing All of these limits are lower than a 256K command line limit would indicate. Is there some per-argument overhead, maybe? |
Looks like the compiler already has support for a file of input file names. |
Change https://golang.org/cl/229317 mentions this issue: |
I see the same bug(?) on OSX 10.12.6. That makes me thing this doesn't warrant a backport - it has been broken forever, both old Go versions and old OSX versions. |
The C program also works fine with The Go program works fine with I built Go using the change added by the commit mentioned by gopherbot above and I get the same behaviour. |
@ronanwatkins What OSX version did you test on? The CL above would not fix my test programs. It just fixes the file passing from the |
@randall77 Using macOS Catalina version 10.15.4 (19E287)
Hope it helps |
Fixes golang#37768 Change-Id: I799a8da632890ad7595697d461c90e3c4c065d95 Reviewed-on: https://go-review.googlesource.com/c/go/+/229317 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
go build bin/gameconfig/serverscript/scriptimpl/quest: /usr/local/go/pkg/tool/darwin_amd64/compile: fork/exec /usr/local/go/pkg/tool/darwin_amd64/compile: argument list too long
quest have 2510 files
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputThe text was updated successfully, but these errors were encountered: