m-ab-s / media-autobuild_suite

This Windows Batchscript helps setup a Mingw-w64 compiler environment for building ffmpeg and other media tools under Windows.
GNU General Public License v3.0
1.56k stars 266 forks source link

Argument list too long #2782

Closed FrontierDK closed 2 weeks ago

FrontierDK commented 1 month ago

logs.zip

Hi all.

I am trying to build the non-free x86 shared build, but despite running the latest version, I get this error: LD libavcodec/avcodec-61.dll /bin/sh: line 1: /mingw32/bin/ccache: Argument list too long make: *** [/build/ffmpeg-git/ffbuild/library.mak:119: libavcodec/avcodec-61.dll] Error 126

Log file(s) attached as per request.

When searching the web, some suggest putting the argument list into a file. More here: https://stackoverflow.com/questions/52391581/mingw32-bin-curl-argument-list-too-long

L4cache commented 1 month ago

Is this the time we finally reached the command line length limit (again?)? I guess deduplicate linking flags is implemented some time in the past the limit was reached?

Put argument list into a file is not a common feature I suppose, but luckily GCC and Clang both support flags in a text file, the tricky part is that FFmpeg, like many other projects, is using build system, which may require a lot more effort to change.

L4cache commented 1 month ago

I can't reproduce this issue though...

FrontierDK commented 1 month ago

L4cache, try asking for a full shared x86 build, including libfdk, libjxl etc.

1480c1 commented 3 weeks ago

Running the same configuration (mabs.ini, ffmpeg_options and mpv_options) resulted in the build passing for me. What is the folder path mabs is in? Perhaps your base path is too long?

L4cache commented 3 weeks ago

Oh yeah, and somehow the msys2 environment (the shell?) supports a single argument length up to nearly 12 MiB... and the total command line length limit is probably even longer. So no need to worry that in any forseeable future as well...

/bin/bash -c "/bin/echo $(perl -e 'print"a"x12582885')"

FrontierDK commented 3 weeks ago

Running the same configuration (mabs.ini, ffmpeg_options and mpv_options) resulted in the build passing for me. What is the folder path mabs is in? Perhaps your base path is too long?

This worked, thank you. I had just used the full project name as a name for the root folder. Changing it to just "ffmpeg" enabled it to run all the way through :)

LigH-de commented 2 weeks ago

Happened to me too: logs.zip Base path is G;\MABS - so rather short.

Before that I tried to include librist, which still fails building

undefined reference to `BCryptGenRandom'

so I disabled it again in ffmpeg_options.txt; after that, building the dynamic ffmpeg started failing.


PS:

/bin/sh: line 1: /mingw64/bin/ccache: Argument list too long

I can't find in any log which command exactly it tried to execute. And the MinGW32 pass finished, probably because it loads a few less libraries (some only work in 64 bit code).

LigH-de commented 1 day ago

@rbouqueau confirms while testing to build GPAC and a dynamic ffmpeg, the bottleneck seems to be ccache.

Please re-open?

rbouqueau commented 1 day ago

I confirm I moved the build to a root folder and ccache still complained.