-
-
Notifications
You must be signed in to change notification settings - Fork 333
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] Enable parallel on downgrade build on not started with ^(vendor|utils) #1621
Conversation
All checks have passed 🎉 @TomasVotruba it is ready for review. |
I've just merged #1610 Could you check what effect it has on this PR? |
@TomasVotruba enabling [NOTE] Downgrading 'vendor/symfony/console' directory
[ERROR] Could not process "" file, due to:
"Child process error: PHP Fatal error: Declaration of
Rector\Core\DependencyInjection\Loader\ConfigurableCallValuesCollectingPhpFileLoader::load($resource, ?string
$type = null): void must be compatible with
Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load($resource, $type = null) in
src/DependencyInjection/Loader/ConfigurableCallValuesCollectingPhpFileLoader.php:26
Fatal error: Declaration of
Rector\Core\DependencyInjection\Loader\ConfigurableCallValuesCollectingPhpFileLoader::load($resource, ?string
$type = null): void must be compatible with
Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load($resource, $type = null) in
src/DependencyInjection/Loader/ConfigurableCallValuesCollectingPhpFileLoader.php:26
".
[ERROR] Could not process "" file, due to:
"Child process error: PHP Fatal error: Declaration of
Rector\Core\DependencyInjection\Loader\ConfigurableCallValuesCollectingPhpFileLoader::load($resource, ?string
$type = null): void must be compatible with
Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load($resource, $type = null) in
src/DependencyInjection/Loader/ConfigurableCallValuesCollectingPhpFileLoader.php:26
Fatal error: Declaration of
Rector\Core\DependencyInjection\Loader\ConfigurableCallValuesCollectingPhpFileLoader::load($resource, ?string
$type = null): void must be compatible with
Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load($resource, $type = null) in
src/DependencyInjection/Loader/ConfigurableCallValuesCollectingPhpFileLoader.php:26
".
[ERROR] Could not process "" file, due to:
"Child process error: PHP Fatal error: Declaration of
Rector\Core\DependencyInjection\Loader\ConfigurableCallValuesCollectingPhpFileLoader::load($resource, ?string
$type = null): void must be compatible with
Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load($resource, $type = null) in
src/DependencyInjection/Loader/ConfigurableCallValuesCollectingPhpFileLoader.php:26
Fatal error: Declaration of
Rector\Core\DependencyInjection\Loader\ConfigurableCallValuesCollectingPhpFileLoader::load($resource, ?string
$type = null): void must be compatible with
Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load($resource, $type = null) in
src/DependencyInjection/Loader/ConfigurableCallValuesCollectingPhpFileLoader.php:26
".
[ERROR] Could not process "" file, due to:
"Child process error: PHP Fatal error: Declaration of
Rector\Core\DependencyInjection\Loader\ConfigurableCallValuesCollectingPhpFileLoader::load($resource, ?string
$type = null): void must be compatible with
Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load($resource, $type = null) in
src/DependencyInjection/Loader/ConfigurableCallValuesCollectingPhpFileLoader.php:26
Fatal error: Declaration of
Rector\Core\DependencyInjection\Loader\ConfigurableCallValuesCollectingPhpFileLoader::load($resource, ?string
$type = null): void must be compatible with
Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load($resource, $type = null) in
src/DependencyInjection/Loader/ConfigurableCallValuesCollectingPhpFileLoader.php:26 |
d1ccb2f
to
fd2ce4b
Compare
I see. The parallel cannot be used in downgrade, as one process downgrades a We should upgrade the |
fd2ce4b
to
2c46b1e
Compare
I've merged the rectify PR, could you rebase on |
@TomasVotruba rebased, I updated for more specific directory that need to be excluded in parallel process 2c46b1e I added Original The script updated to not use parallel for the following directory started with: (vendor/(symfony|symplify|rector)|src|utils) I tried and it seems working. |
All checks have passed 🎉 @TomasVotruba I think it is ready, let's give it a try? |
build/downgrade-rector.sh
Outdated
if [[ "$directory" =~ ^(vendor/(symfony|symplify|rector)|src|utils).* ]]; then | ||
php -d memory_limit=-1 bin/rector process $directory --config build/config/config-downgrade.php --working-dir $BUILD_DIRECTORY --ansi | ||
else | ||
php -d memory_limit=-1 bin/rector process $directory --config build/config/config-downgrade-parallel.php --working-dir $BUILD_DIRECTORY --ansi | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep the former single command, as this will be very confusing for anyone who wants to downgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will move config to variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried updated script to move to variable:
if [[ "$directory" =~ ^(vendor/(symfony|symplify|rector)|src|utils).* ]]; then
config="build/config/config-downgrade.php"
else
config="build/config/config-downgrade-parallel.php"
fi
# --working-dir is needed, so "SKIP" parameter is applied in absolute path of nested directory
php -d memory_limit=-1 bin/rector process $directory --config $config --working-dir $BUILD_DIRECTORY --ansi
it seems I got error on php 7.4:
➜ rector-build git:(downgrade-parallel) ✗ /opt/homebrew/Cellar/php@7.4/7.4.26_2/bin/php bin/rector -vvv --debug
[ERROR] syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE)
probably I wrote something wrong in the script that possibly make variable not overriden in next iteration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is strange, still not work even with unset variable in end of each iteration:
for directory in $directories; do
echo "[NOTE] Downgrading '$directory' directory\n"
if [[ "$directory" =~ ^(vendor/(symfony|symplify|rector)|src|utils).* ]]; then
CONFIG_PATH_DOWNGRADE="build/config/config-downgrade.php"
else
CONFIG_PATH_DOWNGRADE="build/config/config-downgrade-parallel.php"
fi
# --working-dir is needed, so "SKIP" parameter is applied in absolute path of nested directory
php -d memory_limit=-1 bin/rector process $directory --config $CONFIG_PATH_DOWNGRADE --working-dir $BUILD_DIRECTORY --ansi
unset CONFIG_PATH_DOWNGRADE
done
I think this might be related to #1613 (comment) So we should fix that one first, then see if helps here. |
It seems not working after rebase, even with if else direct: if [[ "$directory" =~ ^(vendor/(symfony|symplify|rector)|src|utils).* ]]; then
php -d memory_limit=-1 bin/rector process $directory --config build/config/config-downgrade.php --working-dir $BUILD_DIRECTORY --ansi
else
php -d memory_limit=-1 bin/rector process $directory --config build/config/config-downgrade-parallel.php --working-dir $BUILD_DIRECTORY --ansi
fi |
It seems solved with set back I updated the script to use variable config. |
@TomasVotruba it works now 🎉🎉🎉 |
All checks have passed 🎉 @TomasVotruba I think it is ready. |
Let's merge it for now to see the diff in the |
Ok, the script config;vendor/phpstan/phpdoc-parser/src;vendor/symfony/dependency-injection;vendor/symfony/console;vendor/symfony vendor/psr;vendor/symplify vendor/nikic src;packages;vendor/ssch;rules;utils;bin rector.php;vendor/bin;vendor/clue;vendor/composer;vendor/cweagans;vendor/doctrine;vendor/ergebnis;vendor/evenement;vendor/helmich;vendor/idiosyncratic;vendor/myclabs;vendor/nette;vendor/react;vendor/rector;vendor/sebastian;vendor/tracy;vendor/webmozart
build/downgrade-rector.sh: 36: Syntax error: "(" unexpected (expecting "then")
Error: Process completed with exit code 2. which working ok locally. |
I created PR #1625 to solve script downgrade error. |
@TomasVotruba this PR enabling parallel on downgrade build on directory list not start with
^(vendor|utils)
, with create extended config with enable parallel, because when directory list start with vendor or utils, it currently got notice error like in PR #1613 and #1610I tested locally and it seems working ok: