1
0
Fork 0

Handle dev extraction exit codes instead of completing broken lock with errors

pull/8684/head
Nils Adermann 2020-03-11 16:38:53 +01:00
parent 9c84f4d79f
commit ddb1e79bef
1 changed files with 8 additions and 2 deletions

View File

@ -429,7 +429,10 @@ class Installer
$this->io->writeError('Nothing to modify in lock file');
}
$this->extractDevPackages($lockTransaction, $platformRepo, $aliases, $policy);
$exitCode = $this->extractDevPackages($lockTransaction, $platformRepo, $aliases, $policy);
if ($exitCode !== 0) {
return $exitCode;
}
// write lock
$platformReqs = $this->extractPlatformRequirements($this->package->getRequires());
@ -542,7 +545,7 @@ class Installer
protected function extractDevPackages(LockTransaction $lockTransaction, $platformRepo, $aliases, $policy)
{
if (!$this->package->getDevRequires()) {
return array();
return 0;
}
$resultRepo = new ArrayRepository(array());
@ -570,12 +573,15 @@ class Installer
$solver = null;
} catch (SolverProblemsException $e) {
$this->io->writeError('<error>Unable to find a compatible set of packages based on your non-dev requirements alone.</error>', true, IOInterface::QUIET);
$this->io->writeError('Your requirements can be successfully resolved when require-dev packages are present.');
$this->io->writeError($e->getPrettyString($repositorySet, $request, $pool));
return max(1, $e->getCode());
}
$lockTransaction->setNonDevPackages($nonDevLockTransaction);
return 0;
}
/**