Add build function check for current OS and update validation logic

This commit is contained in:
crazywhalecc
2025-12-10 13:38:25 +08:00
parent 66d3af518b
commit 458af6ac78
5 changed files with 57 additions and 9 deletions

View File

@@ -306,7 +306,9 @@ class PackageLoader
}
}
// check stage exists
if (!$pkg->hasStage($stage_name)) {
// Skip validation if the package has no build function for current OS
// (e.g., libedit has BeforeStage for 'build' but only BuildFor('Darwin'/'Linux'))
if (!$pkg->hasStage($stage_name) && $pkg->hasBuildFunctionForCurrentOS()) {
throw new RegistryException("Package stage [{$stage_name}] is not registered in package [{$package_name}].");
}
}