mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 07:15:38 +08:00
Merge branch 'main' into zig
This commit is contained in:
@@ -245,11 +245,15 @@ class DownloadCommand extends BaseCommand
|
||||
}
|
||||
// if download failed, we will try to download alternative sources
|
||||
logger()->warning("Download failed: {$e->getMessage()}");
|
||||
logger()->notice("Trying to download alternative sources for {$source}");
|
||||
$alt_sources = Config::getSource($source)['alt'] ?? null;
|
||||
if ($alt_sources === null) {
|
||||
logger()->warning("No alternative sources found for {$source}, using default alternative source");
|
||||
$alt_config = array_merge($config, $this->getDefaultAlternativeSource($source));
|
||||
} elseif ($alt_sources === false) {
|
||||
logger()->warning("No alternative sources found for {$source}, skipping alternative download");
|
||||
throw $e;
|
||||
} else {
|
||||
logger()->notice("Trying to download alternative sources for {$source}");
|
||||
$alt_config = array_merge($config, $alt_sources);
|
||||
}
|
||||
Downloader::downloadSource($source, $alt_config, $force_all || in_array($source, $force_list));
|
||||
|
||||
@@ -42,6 +42,15 @@ class PackLibCommand extends BuildCommand
|
||||
|
||||
$builder->proveLibs($libraries);
|
||||
$builder->validateLibsAndExts();
|
||||
|
||||
// before pack, check if the dependency tree contains lib-suggests
|
||||
foreach ($libraries as $lib) {
|
||||
if (Config::getLib($lib, 'lib-suggests', []) !== []) {
|
||||
logger()->critical("The library {$lib} has lib-suggests, packing [{$lib_name}] is not safe, abort !");
|
||||
return static::FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($builder->getLibs() as $lib) {
|
||||
if ($lib->getName() !== $lib_name) {
|
||||
// other dependencies: install or build, both ok
|
||||
|
||||
Reference in New Issue
Block a user