Check lib-suggest before packing libs

This commit is contained in:
crazywhalecc 2025-06-22 13:52:53 +08:00
parent 1a4296386a
commit 1409d1b47b
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

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