JakubOnderka / PHP-Parallel-Lint

This tool check syntax of PHP files faster than serial check with fancier output.
Other
647 stars 62 forks source link

weird error when ran under docker #79

Closed glensc closed 8 years ago

glensc commented 8 years ago

i get such error:

bash-4.3# ./parallel-lint bin/
PHP 5.3.29 | 10 parallel jobs
PHP Notice:  Undefined offset: 1 in /src/src/Process/SkipLintProcess.php on line 84
PHP Notice:  Undefined offset: 1 in /src/src/Process/SkipLintProcess.php on line 84
File bin/skip-linting.php has empty skip status. Please contact PHP Parallel Lint author.
bash-4.3#

however i tried to reproduce this using public debian image and can not reproduce there

this is how i prepared env, and it works here:

# docker run --rm -it debian
root@d8c5d8d45d2b:/# apt-get update
root@d8c5d8d45d2b:/# apt-get install -y php5-cli git curl
root@d8c5d8d45d2b:/# git clone https://github.com/JakubOnderka/PHP-Parallel-Lint -b v0.9.2 /src
root@d8c5d8d45d2b:/src# curl -SsfL https://raw.githubusercontent.com/composer/getcomposer.org/1b137f8bf6db3e79a38a5bc45324414a6b1f9df2/web/installer | php -- --quiet
root@d8c5d8d45d2b:/src# ./composer.phar install --no-dev

the actual container where problem occours is not public.

any ideas what can be wrong here, or what commands to run as test to figure out the problem?

JakubOnderka commented 8 years ago

You can try to edit src/Process/SkipLintProcess.php file and add new this line into processLines method:

var_dump($content);

run your command again and paste here an output?

glensc commented 8 years ago

ok. good grace. problem found:

bash-4.3# ./parallel-lint --ignore-fails bin/
PHP 5.3.29 | 10 parallel jobs
string(86) "
Fatal error: Call to undefined function preg_match() in Command line code on line 13
"
PHP Notice:  Undefined offset: 1 in /src/src/Process/SkipLintProcess.php on line 85
PHP Notice:  Undefined offset: 1 in /src/src/Process/SkipLintProcess.php on line 85
string(0) ""
string(0) ""
File bin/skip-linting.php has empty skip status. Please contact PHP Parallel Lint author.
bash-4.3# 

but imho it's wrong to discard STDERR, should print out messages from subshells printing to STDERR, you'd be expecting STDOUT stream for the content.

glensc commented 8 years ago

how many times the src/Process/SkipLintProcess.php is called out per recursive run of 100 files?

from code i read it takes bunch of filenames from STDIN, so perhaps remove the -n php commandline option when invoking it? as that's what's causing pcre extension be missing that you skip loading any extensions.

JakubOnderka commented 8 years ago

I think, it is wired that preg_match is loaded from module. But now are errors from SkipLint process properly showed.

glensc commented 7 years ago

@JakubOnderka could you please make new version?

glensc commented 7 years ago

seems there's even phar upload added to travis-ci, so new release would be super helpful not to build .phar on it's own