/dev/null | grep -v '/32/' | head -n 1"); $line = trim((string) $output); if ($line !== '') { $located = $line; break; } } if ($located) { $found[] = $located; } } GlobalEnvManager::putenv('SPC_EXTRA_RUNTIME_OBJECTS=' . implode(' ', $found)); $extra_libs = getenv('SPC_EXTRA_LIBS') ?: ''; if (!str_contains($extra_libs, '-lunwind')) { // Add unwind library if not already present $extra_libs = trim($extra_libs . ' -lunwind'); GlobalEnvManager::putenv("SPC_EXTRA_LIBS={$extra_libs}"); } } /** * @throws WrongUsageException */ public function afterInit(): void { if (!is_dir(Zig::getEnvironment()['PATH'])) { throw new WrongUsageException('You are building with zig, but zig is not installed, please install zig first. (You can use `doctor` command to install it)'); } GlobalEnvManager::addPathIfNotExists(Zig::getEnvironment()['PATH']); } }