- Windows 10,
- MinGW-W64 (5.3.0-<i686,x86_64),
- MSYS2 (4.3.42(4)-release-(x86_64-pc-msys)),
- Python (2.7.11),
- SCons (2.4.1),
- MESA (11.1.*-dev from git-repository).
For <i686,x86_64> builds got error:
scons.py build=release platform=windows toolchain=mingw machine=x86_64 libgl-gdi
Archiving build\windows-x86\mesa\libmesa.a ...
Compiling src\gallium\auxiliary\draw\draw_pipe_twoside.c ...
The command line is too long.
scons: *** [build\windows-x86_64\mesa\libmesa.a] Error 1
scons: building terminated because of errors.
I found that it's very similar to which was reported four years ago:
"The command line is too long..."
(details at https://lists.freedesktop.org/archives/mesa-users/2012-October/000496.html ).
Other users also experienced it:
"Compiling Mesa natively on Windows using GCC with SCons results in "the command line is too long" error during linking..."
(details at https://wiki.qt.io/Cross_compiling_Mesa_for_Windows ).
While looking for solution, found in SCons wiki:
"MingW had some problems during the link phase of the build process. It turned out our link lines were in excess of 10000 characters, and this was causing some major grief with python calling spawn()..."
(details at https://bitbucket.org/scons/scons/wiki/LongCmdLinesOnWin32 ).
I assume this error last for such long, because testing of MESA builds using MinGW* was made on Linux with cross-compiling to Windows. Could it be fixed?
Created attachment 121672 [details]
sample of too long command line
I believe that this issue is not that specific to mesa and/or the build system.
I've had similar experience with piglit (which uses cmake). The workaround I used was to use the shortest path possible for the repo and install location (iirc I used e:\p\ and e:\i\ respectively)
The mesa MSVC builds have been running fine  but I'm wondering if we cannot wire up the mingw/mingw-w64 ones ?
> I believe that this issue is not that specific to mesa and/or the build system.
Yes, that issue is somewhere between Windows and SCons. More details at https://bitbucket.org/scons/scons/wiki/LongCmdLinesOnWin32 , as I wrote above.
> use the shortest path possible for the repo and install location (iirc I used e:\p\ and e:\i\ respectively)
I assume that would be acceptable not for all users (Linux users don't have such restrictions). But Mesa builds using MinGW-W64 fails even from e:\p\ directory, because 'ar' utility receive command line with about 12,355 symbols (see attachment above), while Windows limit seems to be 10,000 symbols.
As I understood your sample relates to Mesa builds using LLVM, while my error report relates to builds using MinGW-W64.
(In reply to Emil Velikov from comment #2)
> I believe that this issue is not that specific to mesa and/or the build
> I've had similar experience with piglit (which uses cmake). The workaround I
> used was to use the shortest path possible for the repo and install location
> (iirc I used e:\p\ and e:\i\ respectively)
Unlike CMake, SCons uses option files with MSVC, so this doesn't affect MSVC.
It can pass as many options as theres free space in the hard drive.
It's just SCons + MinGW on Windows.
> The mesa MSVC builds have been running fine but I'm wondering if we
> cannot wire up the mingw/mingw-w64 ones ?
First need to fix this bug before it's worthwhile.
(In reply to sav_ix from comment #0)
> While looking for solution, found in SCons wiki:
> "MingW had some problems during the link phase of the build process. It
> turned out our link lines were in excess of 10000 characters, and this was
> causing some major grief with python calling spawn()..."
> (details at https://bitbucket.org/scons/scons/wiki/LongCmdLinesOnWin32 ).
We probably need something like this.
It's not the first time SCons usage of CRT exec causes problems.
We also had random build failures with SCons on Windows with parallel builds because the CRT is not thread safe.
It would be great if SCons migrated to subprocess.
I tried to update mesa/scons/fixes.py with the hack from https://bitbucket.org/scons/scons/wiki/LongCmdLinesOnWin32 without success.
The snippet from https://bitbucket.org/scons/scons/wiki/LongCmdLinesOnWin32 is missing the defition of `escape`
I also tried using subprocess but it fails.
Honestly, the only solution IMO is to fix upstream scons/src/engine/SCons/Platform/win32.py file...
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/913.