From 1409d1b47b2dbd6110d7134ead35d9a601e6ab5b Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sun, 22 Jun 2025 13:52:53 +0800 Subject: [PATCH] Check lib-suggest before packing libs --- src/SPC/command/dev/PackLibCommand.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/SPC/command/dev/PackLibCommand.php b/src/SPC/command/dev/PackLibCommand.php index d0d9797e..d7afc9f3 100644 --- a/src/SPC/command/dev/PackLibCommand.php +++ b/src/SPC/command/dev/PackLibCommand.php @@ -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