From b602b19f6dae8792cf8814fd4408ec9b524474e4 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 12 Jul 2021 15:09:59 +0200 Subject: [PATCH] Fix archive command now that zips are extracted async, refs composer/satis#655 --- src/Composer/Package/Archiver/ArchiveManager.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Composer/Package/Archiver/ArchiveManager.php b/src/Composer/Package/Archiver/ArchiveManager.php index 3025878d7..13dd7c7fe 100644 --- a/src/Composer/Package/Archiver/ArchiveManager.php +++ b/src/Composer/Package/Archiver/ArchiveManager.php @@ -16,6 +16,7 @@ use Composer\Downloader\DownloadManager; use Composer\Package\RootPackageInterface; use Composer\Util\Filesystem; use Composer\Util\Loop; +use Composer\Util\SyncHelper; use Composer\Json\JsonFile; use Composer\Package\CompletePackageInterface; @@ -149,8 +150,9 @@ class ArchiveManager try { // Download sources $promise = $this->downloadManager->download($package, $sourcePath); - $this->loop->wait(array($promise)); - $this->downloadManager->install($package, $sourcePath); + SyncHelper::await($this->loop, $promise); + $promise = $this->downloadManager->install($package, $sourcePath); + SyncHelper::await($this->loop, $promise); } catch (\Exception $e) { $filesystem->removeDirectory($sourcePath); throw $e;