You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Foxy's documentation describes the "manager-timeout" config option as being a nullable integer, with the default being null. In Composer 2.3, the ProcessExecutor class has been updated, and its setTimeout method now requires an int value for the timeout parameter. This makes Foxy's default configuration incompatible with Composer 2.3+.
Here's the stack trace thrown when using the default configuration with Composer 2.3:
Merging Composer dependencies in the asset package
yarn check v1.22.18
success Folder in sync.
Done in 0.44s.
Updating yarn dependencies
In ProcessExecutor.php line 388:
[TypeError]
Argument 1 passed to Composer\Util\ProcessExecutor::setTimeout() must be of the type int, null given, called in /home/nicholas/projects/test/vendor/foxy/foxy/Asset/AbstractAssetManage
r.php on line 210
Exception trace:
at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/src/Composer/Util/ProcessExecutor.php:388
Composer\Util\ProcessExecutor::setTimeout() at /home/nicholas/projects/test/vendor/foxy/foxy/Asset/AbstractAssetManager.php:210
Foxy\Asset\AbstractAssetManager->run() at /home/nicholas/projects/test/vendor/foxy/foxy/Solver/Solver.php:103
Foxy\Solver\Solver->solve() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/src/Composer/Plugin/PluginManager.php(273) : eval()'d code:205
Foxy\Foxy_composer_tmp0->solveAssets() at n/a:n/a
call_user_func() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:202
Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:125
Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/src/Composer/Installer.php:372
Composer\Installer->run() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/src/Composer/Command/UpdateCommand.php:241
Composer\Command\UpdateCommand->execute() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/vendor/symfony/console/Command/Command.php:298
Symfony\Component\Console\Command\Command->run() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/vendor/symfony/console/Application.php:1015
Symfony\Component\Console\Application->doRunCommand() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/vendor/symfony/console/Application.php:299
Symfony\Component\Console\Application->doRun() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/src/Composer/Console/Application.php:334
Composer\Console\Application->doRun() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/vendor/symfony/console/Application.php:171
Symfony\Component\Console\Application->run() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/src/Composer/Console/Application.php:130
Composer\Console\Application->run() at phar:///home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar/bin/composer:83
require() at /home/nicholas/.phpenv/versions/7.4.28/composer/composer.phar:29
A workaround for now is to set a non-null "manager-timeout" value in your composer.json ("300" is the default in Composer):
I'll note that Foxy's behavior has always been wrong here-- the docblock for that Composer method has always specified that timeout should be an integer. It's only breaking now because Composer is enforcing that.
I feel like the fix here is to simply not call Composer\Util\ProcessExecutor::setTimeout() if "manager-timeout" is null, thereby keeping Composer's default timeout in place. I can submit a PR for this if that sounds okay.
The timeout could be null because the ProcessExecutor class uses the Symfony Process component whose timeout may be null, cf. the constructor of the Process class and that the property was not Typed. It was therefore reasonable to consider the PHP doc as incomplete, which often happens, and not as a deliberate choice of the developers.
Now that the property is Typed, it is therefore necessary to use the constant PHP_INT_MAX to obtain a pseudo equivalent to an unlimited timeout. The method Foxy\Config\Config::get() has a second argument to set a default value.
Foxy's documentation describes the "manager-timeout" config option as being a nullable integer, with the default being null. In Composer 2.3, the ProcessExecutor class has been updated, and its setTimeout method now requires an int value for the timeout parameter. This makes Foxy's default configuration incompatible with Composer 2.3+.
Here's the stack trace thrown when using the default configuration with Composer 2.3:
A workaround for now is to set a non-null "manager-timeout" value in your composer.json ("300" is the default in Composer):
The text was updated successfully, but these errors were encountered: