-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
plugins/Makefile: use files to avoid hitting ARG_MAX during build #775
base: main
Are you sure you want to change the base?
Conversation
When adding more modules to the build, ar will be passed far more .o files as arguments on the command line than the limits specified by most host kernels by default, which will cause the build to fail with "/bin/bash: Argument list too long" Using xargs can show you what these limits are on POSIX systems, e.g: $ xargs --show-limits Your environment variables take up 6774 bytes POSIX upper limit on argument length (this system): 2088330 POSIX smallest allowable upper limit on argument length (all systems): 4096 Maximum length of command we could actually use: 2081556 Size of command buffer we are actually using: 131072 Maximum parallelism (--max-procs must be no greater): 2147483647
803f806
to
6c8489f
Compare
are you actually hitting this limit? I dont understand what you are trying to do with the "file > " syntax |
Yeah, if you just add a few more submodules and compile a headless build, it will result in a string length far too large to work, ultimately throwing that bash error, due to the max argument size in the host kernel.
The file syntax thing confused me as well, but it's a feature of Make that I discovered in fixing this https://www.gnu.org/software/make/manual/html_node/File-Function.html All we're doing is putting |
It fails on mac due to inconsistencies between the GNU and BSD versions of make and ar (binutils). I can confirm when using GNU versions, this PR builds on my local mac machine. |
we cant assume the GNU version. Cardinal builds on BSD too which has the same situation |
Does that mean that BSD ar and make cannot read lists of args from files? If so, I don't see how this is going to be resolved on those platforms |
We should be able to use |
@falkTX I dare not ask what happens on Haiku. Where is your Haiku CI? :D |
When adding more modules to the build, ar will be passed far more .o files as arguments on the command line than the limits specified by most host kernels by default, which will cause the build to fail with
/bin/bash: Argument list too long
Using xargs can show you what these limits are on POSIX systems, e.g: