|
16 | 16 | use SPC\toolchain\GccNativeToolchain; |
17 | 17 | use SPC\toolchain\ToolchainManager; |
18 | 18 | use SPC\util\DependencyUtil; |
| 19 | +use SPC\util\GlobalEnvManager; |
19 | 20 | use SPC\util\SPCConfigUtil; |
20 | 21 | use SPC\util\SPCTarget; |
21 | 22 |
|
@@ -134,8 +135,8 @@ protected function sanityCheck(int $build_target): void |
134 | 135 | if (($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED) { |
135 | 136 | logger()->info('running embed sanity check'); |
136 | 137 | $sample_file_path = SOURCE_PATH . '/embed-test'; |
137 | | - if (!is_dir($sample_file_path) && !mkdir($sample_file_path) && !is_dir($sample_file_path)) { |
138 | | - throw new SPCInternalException("Failed to create directory: {$sample_file_path}"); |
| 138 | + if (!is_dir($sample_file_path)) { |
| 139 | + @mkdir($sample_file_path); |
139 | 140 | } |
140 | 141 | // copy embed test files |
141 | 142 | copy(ROOT_DIR . '/src/globals/common-tests/embed.c', $sample_file_path . '/embed.c'); |
@@ -267,8 +268,6 @@ protected function patchPhpScripts(): void |
267 | 268 | /** |
268 | 269 | * Process the --with-frankenphp-app option |
269 | 270 | * Creates app.tar and app.checksum in source/frankenphp directory |
270 | | - * |
271 | | - * @return bool True if the app.tar was created successfully, false otherwise |
272 | 271 | */ |
273 | 272 | protected function processFrankenphpApp(): void |
274 | 273 | { |
@@ -313,11 +312,11 @@ protected function getFrankenPHPVersion(): string |
313 | 312 |
|
314 | 313 | protected function buildFrankenphp(): void |
315 | 314 | { |
| 315 | + GlobalEnvManager::addPathIfNotExists(GoXcaddy::getEnvironment()['PATH']); |
316 | 316 | $this->processFrankenphpApp(); |
317 | 317 | $nobrotli = $this->getLib('brotli') === null ? ',nobrotli' : ''; |
318 | 318 | $nowatcher = $this->getLib('watcher') === null ? ',nowatcher' : ''; |
319 | 319 | $xcaddyModules = getenv('SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES'); |
320 | | - // Check if we have a custom app.tar in source/frankenphp |
321 | 320 | $frankenphpSourceDir = SOURCE_PATH . '/frankenphp'; |
322 | 321 |
|
323 | 322 | $xcaddyModules = preg_replace('#--with github.com/dunglas/frankenphp(=\S+)?#', '', $xcaddyModules); |
|
0 commit comments