Closed Bilge closed 4 years ago
Currently, that is intended behaviour. You can find additional information here: https://github.com/phpro/grumphp/blob/master/src/GrumPHP/Util/Platform.php#L19 https://support.microsoft.com/en-us/kb/830473
The problem is that the CLI input string on cmd.exe is limited to 8191 characters. Tasks like phplint
and phpcs
contain the paths to the files that are being checked. During a run command, the list of files wil exceed this amount which results in some strange errors on windows.
That is why I've choosen to display the error message and mark the test as skipped.
I would accept a PR which contains a better solution.
Why don't you just break it down into multiple invocations?
On 16 Jan 2017 07:50, "Toon Verwerft" notifications@github.com wrote:
Currently, that is intended behaviour. You can find additional information here: https://github.com/phpro/grumphp/blob/master/src/ GrumPHP/Util/Platform.php#L19 https://support.microsoft.com/en-us/kb/830473
The problem is that the CLI input string on cmd.exe is limited to 8191 characters. Tasks like phplint and phpcs contain the paths to the files that are being checked. During a run command, the list of files wil exceed this amount which results in some strange errors on windows.
That is why I've choosen to display the error message and mark the test as skipped.
I would accept a PR which contains a better solution.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/phpro/grumphp/issues/275#issuecomment-272793881, or mute the thread https://github.com/notifications/unsubscribe-auth/AAcuYjNlR0Zn3IlfjKjAGkviIufMzozwks5rSyEngaJpZM4Lj4T_ .
That's a possible solution but it would require code changes in multiple tasks: Most of the tasks run only one process. Maybe the processes part could be abstracted into a new layer so that it doesn't matter if one or multiple tasks are started. The problem is only on Windows, so for other OS a split-up is not really necessary.
The problem is only on Windows, so for other OS a split-up is not really necessary.
I'm not sure that's true. That's what the xargs
command was created for, and as it shows us, the typical Linux limit is very generous.
$ xargs --show-limits POSIX upper limit on argument length (this system): 2607529 POSIX smallest allowable upper limit on argument length (all systems): 4096 Maximum length of command we could actually use: 2595666 Size of command buffer we are actually using: 131072
It is quite possible you just haven't hit the 2MB command line limit in any of your projects or tests but this remains a dormant problem waiting to happen.
I don't think I am going to hit the unix limit anytime soon, but I do agree that it is an issue. If you are committing 2MB of filenames at once, it might be easier to just run the executables on all the files. The same goes for Windows: if the limit is hit, it might be easier to just run the executables without the file list. What do you think?
it might be easier to just run the executables on all the files
Absolutely not, for the following reasons.
I'm also running into this issue. There is no fix for this yet?
Update: When running tortoise git grumphp works. But it doesn't and brings the limit error when I run it manually using the Windows Powershell.
There is no fix for this yet?
Why do you ask that like it could have just magically fixed itself? If you're not going to put the work in, nothing's going to happen.
Fixed in #796
Hey! Same problem with phpmd and phpstan tasks!
Phpcs
andPhpLint
tasks are skipped on Windows 7 due to "the windows cmd input limit". As I understand, this error message is generated by GrumPHP so it is this project's prerogative to devise a suitable workaround for running these tasks on Windows.My configuration Default.
Steps to reproduce:
bin/grumphp run
Result: