File tree Expand file tree Collapse file tree 4 files changed +24
-9
lines changed
Expand file tree Collapse file tree 4 files changed +24
-9
lines changed Original file line number Diff line number Diff line change 3434 */
3535final class ConsoleApplication extends Application
3636{
37- public const string VERSION = '2.7.3 ' ;
37+ public const string VERSION = '2.7.4 ' ;
3838
3939 public function __construct ()
4040 {
Original file line number Diff line number Diff line change @@ -103,9 +103,8 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
103103 );
104104 }
105105
106- shell ()->cd (SOURCE_PATH . '/php-src ' )
107- ->exec (
108- $ php_configure_env . ' ' .
106+ $ this ->seekPhpSrcLogFileOnException (fn () => shell ()->cd (SOURCE_PATH . '/php-src ' )->exec (
107+ $ php_configure_env . ' ' .
109108 getenv ('SPC_CMD_PREFIX_PHP_CONFIGURE ' ) . ' ' .
110109 ($ enableCli ? '--enable-cli ' : '--disable-cli ' ) .
111110 ($ enableFpm ? '--enable-fpm ' . ($ this ->getLib ('libacl ' ) !== null ? '--with-fpm-acl ' : '' ) : '--disable-fpm ' ) .
@@ -118,7 +117,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
118117 $ zts .
119118 $ maxExecutionTimers .
120119 $ this ->makeStaticExtensionArgs () . ' '
121- );
120+ ) );
122121
123122 $ this ->emitPatchPoint ('before-php-make ' );
124123 SourcePatcher::patchBeforeMake ($ this );
Original file line number Diff line number Diff line change @@ -118,9 +118,8 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
118118 }
119119
120120 $ embed_type = getenv ('SPC_CMD_VAR_PHP_EMBED_TYPE ' ) ?: 'static ' ;
121- shell ()->cd (SOURCE_PATH . '/php-src ' )
122- ->exec (
123- getenv ('SPC_CMD_PREFIX_PHP_CONFIGURE ' ) . ' ' .
121+ $ this ->seekPhpSrcLogFileOnException (fn () => shell ()->cd (SOURCE_PATH . '/php-src ' )->exec (
122+ getenv ('SPC_CMD_PREFIX_PHP_CONFIGURE ' ) . ' ' .
124123 ($ enableCli ? '--enable-cli ' : '--disable-cli ' ) .
125124 ($ enableFpm ? '--enable-fpm ' : '--disable-fpm ' ) .
126125 ($ enableEmbed ? "--enable-embed= {$ embed_type } " : '--disable-embed ' ) .
@@ -132,7 +131,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
132131 $ zts .
133132 $ this ->makeStaticExtensionArgs () . ' ' .
134133 $ envs_build_php
135- );
134+ ) );
136135
137136 $ this ->emitPatchPoint ('before-php-make ' );
138137 SourcePatcher::patchBeforeMake ($ this );
Original file line number Diff line number Diff line change 66
77use SPC \builder \BuilderBase ;
88use SPC \builder \linux \SystemUtil as LinuxSystemUtil ;
9+ use SPC \exception \SPCException ;
910use SPC \exception \SPCInternalException ;
1011use SPC \exception \ValidationException ;
1112use SPC \exception \WrongUsageException ;
@@ -338,4 +339,20 @@ protected function buildFrankenphp(): void
338339 }
339340 }
340341 }
342+
343+ /**
344+ * Seek php-src/config.log when building PHP, add it to exception.
345+ */
346+ protected function seekPhpSrcLogFileOnException (callable $ callback ): void
347+ {
348+ try {
349+ $ callback ();
350+ } catch (SPCException $ e ) {
351+ if (file_exists (SOURCE_PATH . '/php-src/config.log ' )) {
352+ $ e ->addExtraLogFile ('php-src config.log ' , 'php-src.config.log ' );
353+ copy (SOURCE_PATH . '/php-src/config.log ' , SPC_LOGS_DIR . '/php-src.config.log ' );
354+ }
355+ throw $ e ;
356+ }
357+ }
341358}
You can’t perform that action at this time.
0 commit comments