From 6dfeac306f845b54ef7d582c62744ccc5c089f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9k=C3=B3=20Bertalan?= Date: Thu, 12 May 2022 16:37:30 +0200 Subject: [PATCH] Fix ProcessExecutor bootstrapping in monorepo-helper Without this fix Composer throws a LogicException with the message: "You must use the ProcessExecutor instance which is part of a Composer\Loop instance to be able to run async processes.", but only if the monorepo-helper is not run on the `master` or `main` branch. The inspiration for this fix was taken from the resolving commit of composer/composer issue #10703. See: https://github.com/composer/composer/issues/10703 Change-Id: I0af1c8f8f5badb0594c978a9c5dc8361e7bd6b81 Issue-Link: https://project.pronovix.net/issues/18528 --- src/Composer/Plugin.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Composer/Plugin.php b/src/Composer/Plugin.php index 038970a..531a3dd 100644 --- a/src/Composer/Plugin.php +++ b/src/Composer/Plugin.php @@ -33,7 +33,6 @@ use Composer\Plugin\PluginEvents; use Composer\Plugin\PluginInterface; use Composer\Util\Filesystem as ComposerFilesystem; -use Composer\Util\ProcessExecutor; /** * Monorepo Helper plugin definition. @@ -74,7 +73,7 @@ public function activate(Composer $composer, IOInterface $io): void return; } - $process = new ProcessExecutor($io); + $process = $composer->getLoop()->getProcessExecutor(); $monorepoRoot = $configuration->getForcedMonorepoRoot(); $output = '';