From 5730c24c9258e05ca85035ca41170f806c43066e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Jun 2022 13:30:39 +0200 Subject: [PATCH 1/2] Rethrow path repo init failures with path information, closes #10845 --- src/Composer/Repository/PathRepository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Repository/PathRepository.php b/src/Composer/Repository/PathRepository.php index 3335f0a79..bd32d3612 100644 --- a/src/Composer/Repository/PathRepository.php +++ b/src/Composer/Repository/PathRepository.php @@ -213,7 +213,11 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn } } - $this->addPackage($this->loader->load($package)); + try { + $this->addPackage($this->loader->load($package)); + } catch (\Exception $e) { + throw new \RuntimeException('Failed loading the package in '.$composerFilePath, 0, $e); + } } } From 690ab5166a2a5ef6db7125ca8346970c9832590e Mon Sep 17 00:00:00 2001 From: Marek Stipek Date: Wed, 15 Jun 2022 18:01:53 +0200 Subject: [PATCH 2/2] Ignoring passed arguments for @putenv, closes #10846 --- src/Composer/EventDispatcher/EventDispatcher.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index 74ec3459d..dd68cc0cc 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -243,7 +243,14 @@ class EventDispatcher } } else { $args = implode(' ', array_map(array('Composer\Util\ProcessExecutor', 'escape'), $event->getArguments())); - $exec = $callable . ($args === '' ? '' : ' '.$args); + + // @putenv does not receive arguments + if (strpos($callable, '@putenv ') === 0) { + $exec = $callable; + } else { + $exec = $callable . ($args === '' ? '' : ' '.$args); + } + if ($this->io->isVerbose()) { $this->io->writeError(sprintf('> %s: %s', $event->getName(), $exec)); } elseif ($event->getName() !== '__exec_command') {