Merge branch 'main' into zig

This commit is contained in:
Marc
2025-07-18 12:47:58 +07:00
committed by GitHub
7 changed files with 37 additions and 9 deletions

View File

@@ -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));

View File

@@ -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