backport fixes from v2

This commit is contained in:
henderkes
2026-05-23 16:02:08 +07:00
parent 713f8255af
commit e7fb1e203f
5 changed files with 25 additions and 1 deletions

View File

@@ -10,8 +10,10 @@ use StaticPHP\Exception\ValidationException;
use StaticPHP\Package\PackageBuilder;
use StaticPHP\Package\PackageInstaller;
use StaticPHP\Registry\PackageLoader;
use StaticPHP\Toolchain\ToolchainManager;
use StaticPHP\Util\DependencyResolver;
use StaticPHP\Util\FileSystem;
use StaticPHP\Util\GlobalEnvManager;
use StaticPHP\Util\Pgo\PgoContext;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Output\OutputInterface;
@@ -44,6 +46,10 @@ class CraftCommand extends BaseCommand
// apply env
array_walk($craft['extra-env'], fn ($v, $k) => f_putenv("{$k}={$v}"));
// re-substitute env.ini's CC=${SPC_DEFAULT_CC} bindings.
ToolchainManager::initToolchain();
GlobalEnvManager::reapplyOsIni();
// stash craft for doctor checks that depend on what's being built (e.g. frankenphp → go-xcaddy)
ApplicationContext::set('craft', $craft);