Skip to content

Commit

Permalink
Fix ProcessExecutor bootstrapping in monorepo-helper
Browse files Browse the repository at this point in the history
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: composer/composer#10703

Change-Id: I0af1c8f8f5badb0594c978a9c5dc8361e7bd6b81
Issue-Link: https://project.pronovix.net/issues/18528
  • Loading branch information
lekob committed Jul 25, 2022
1 parent 91efa67 commit 6dfeac3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Composer/Plugin.php
Expand Up @@ -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.
Expand Down Expand Up @@ -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 = '';

Expand Down

0 comments on commit 6dfeac3

Please sign in to comment.