Skip to content
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

PHPCS gets stuck creating file list when processing circular symlinks #1758

Closed
reedy opened this issue Nov 23, 2017 · 5 comments
Closed

PHPCS gets stuck creating file list when processing circular symlinks #1758

reedy opened this issue Nov 23, 2017 · 5 comments
Milestone

Comments

@reedy
Copy link

reedy commented Nov 23, 2017

This is fine on PHP_CodeSniffer 2.9.0, but on 3.1.1, running phpcs on this repo it gets stuck on Creating file list...

To reproduce:

git clone https://gerrit.wikimedia.org/r/operations/mediawiki-config
cd mediawiki-config
git fetch https://gerrit.wikimedia.org/r/operations/mediawiki-config refs/changes/65/367465/15 && git cherry-pick FETCH_HEAD
git submodule update --init --recursive
php composer.phar update
php multiversion/vendor/bin/phpcs -vvv .

Then it'll get to

Registered PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff
Registered PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff
Registered PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\BacktickOperatorSniff
Creating file list... 

In our CI, we get it timing out after 10 minutes

20:49:09   [Symfony\Component\Process\Exception\ProcessTimedOutException]     
20:49:09   The process "composer phpcs" exceeded the timeout of 600 seconds. 

Originally, we had some issues relating to symlinks, https://phabricator.wikimedia.org/T171510 which I think was "fixed" in #1438 (errors being the same "No PHP code was found in this file" etc) and therefore edcca45

Did that break something? The repo has quite a few symlinks...

Downstream task for this is https://phabricator.wikimedia.org/T181262

@gsherwood
Copy link
Member

Might have something to do with it:

$ cd mediawiki-config/portals/prod/wikimedia.org
$ ls -la
total 16
drwxr-xr-x+  4 gsherwood  staff   128 24 Nov 08:31 .
drwxr-xr-x+ 10 gsherwood  staff   320 24 Nov 08:31 ..
-rw-r--r--+  1 gsherwood  staff  7861 24 Nov 08:31 index.html
lrwxr-xr-x   1 gsherwood  staff     2 24 Nov 08:31 portal -> ..

PHPCS follows symlinks and it looks to be getting stuck around here. I'll see what I can do, but adding --ignore=*/portal/* to the CLI gets it going for now.

@reedy
Copy link
Author

reedy commented Nov 23, 2017

Ah, yes. That mess, I'd forgotten about that piece of work. Fresh pair of eyes is always useful, thanks!

Long filed over at https://phabricator.wikimedia.org/T151685

Let's add it to exclude-pattern

Cheers

@gsherwood
Copy link
Member

Let's add it to exclude-pattern

Good idea, although I will still try and fix this.

@gsherwood gsherwood changed the title Repo stuck on Creating file list... PHPCS gets stuck creating file list when processing circular symlinks Nov 23, 2017
@reedy
Copy link
Author

reedy commented Nov 23, 2017

That'd be great if you could 👍

gsherwood added a commit that referenced this issue Nov 23, 2017
@gsherwood
Copy link
Member

gsherwood commented Nov 23, 2017

I've had to re-introduce the realpath check and record already accepted paths, but it gets it working.

Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants