-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Parallel runner not fixing any files #8014
Comments
@X-Coder264 could it be related to #8013, or you don't use |
I don't use |
I will assume 3.57.1 is not fixing the issue. Can you provide similar reproduce method to following ?
|
@keradus You assumed correctly, 3.57.1 is not fixing the issue for me. The weird thing is I've tried the parallel runner on another project (that one doesn't use I'll remove the shim and install the non shim version tomorrow and see if that changes anything. If it doesn't I'll try to see what's going on with Xdebug if I'll have the time. |
Ok, I found the difference between the config of those two projects. In the project in which the parallel runner does not work at all there are these two lines at the top of the CS fixer config file: require \dirname(__DIR__, 3) . '/vendor/autoload.php';
require \dirname(__DIR__, 3) . '/vendor/kubawerlos/php-cs-fixer-custom-fixers/bootstrap.php'; If I just comment out the first line along with all the custom fixers that are configured like |
ideally, please share example repo to reproduce (you do not need to expose whole source code you have, just minimum reproducable example). For now, you are only one who can evidence and debug the issue. |
This is something I noticed right after you reported the problem (using shim package), this should be verified in the first place. If I remember correctly I've been testing parallel runner using locally built PHAR file, but never tested shim installation. |
@keradus I've been trying to create a minimal reproducer but so far I was unable to do so. All I can confirm for now is that if I remove |
I failed to reproduce with shim. if you cannot create minimal reproducer on your side, are you OK to grant temporary access to repo you experience the issue ? |
Sorry, I don't have the permissions on Github to give access to the project repository even if I wanted to. |
are you able to create new repo with very limited content, that is allowing to reproduce issue you are facing ? |
Just chiming in here for what it's worth, but we're having the exact same issue. Works fine at the moment without parallel checks, but does nothing when enabled. I can simplify our config to the following:
Which shows the progress bar but changes nothing to the files (for which I used the wrong code style for the 2 rules above):
Will try to recreate a reproducible example later. |
@sebastiaanluca @enp-mrygiel how do you install Fixer? Shim package or something different? |
Not sure what the shim package is, but just |
Hi!
The output of the first command is:
|
Interesting, but I still can't reproduce it locally. When I run parallel analysis on Fixer's repo with a directory path as CLI argument, it's running correctly. Please guys, can anyone extract minimal reproducer repo so we can take a look what's happening there? |
Just more context: in fact it works on Apple M1 with 10 CPUs and it fails on Apple M3 with 12 cores. Even if we reduce (on M3) the number of cores in docker to 10 or less, it always uses 12 cores. Here is the output on an M1 which always works:
Hope it can help... |
Interesting... I have M1 and even if I explicitly configure more processes than I have available cores, it still works... ./php-cs-fixer check
PHP CS Fixer 3.57.3-DEV 7th Gear by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.4
Running analysis on 15 cores with 50 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from "/Volumes/Projects/~Github/PHP-CS-Fixer/PHP-CS-Fixer/.php-cs-fixer.php".
1118/1118 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Found 0 of 1118 files that can be fixed in 12.627 seconds, 22.00 MB memory use @potsky do you use CPU auto-detection? Can you test on M3 with explicit |
Yes @Wirone we use |
@Wirone We have tested on a M3 with |
@potsky , you think you can provide sth?
|
I have a M1 so I cannot provide anything directly, I will check tomorrow with my colleague @sylouuu if he can test some things and provide more information |
I have the same behavior. The weird thing is that's it's working well inside PHPStorm terminal, but stuck at 0% when using iTerm2. Both with the same codebase, with zsh and the same PHP version. It doesn't seem hardware-related, at least on my side. 🤷♂️ |
Really interesting 🤔 It works on my Mac M1 with iTerm2 terminal. |
In our CI it works on PHP 7.4-8.4, on Linux, MacOS and Windows. Locally I use parallel runner on MacOS (M1) within iTerm2 and PHPStorm's terminal (the new one, but also the old one which just spawns the same ZSH session as iTerm2). Tested also with built-in Terminal (v2.14), also works properly. It works for files configured in the config file, but also when I set file/dir as a CLI command argument... I don't have any reproducer currently and can't help 🙁. |
Problem description
After enabling the parallel runner no files are being fixed anymore. It seems like CS fixer just finishes the process with the progress bar still being at 0%.
Minimal reproducer
This is a simplified version of the config that I have that reproduces this problem and I've changed on purpose one method in my
src
folder toabstract protected function getType(): ?DocumentType;
After the fixer runs I'd expect to get
abstract protected function getType(): null|DocumentType;
as a result.Running
php-cs-fixer fix --no-interaction --diff -vvv --using-cache=no
with this config without the parallel runner results in the file being fixed:If I enable the parallel runner the file does not get fixed and the output is:
Fixer version
3.57.0
PHP version
8.2.18
How do you run Fixer?
Composer Shim package (binary only)
Contribution Checks
The text was updated successfully, but these errors were encountered: