Skip to content

Commit 0156f33

Browse files
authored
Merge branch 'main' into remove-icu-backend
2 parents df8b2db + e35d6c2 commit 0156f33

File tree

6 files changed

+31
-14
lines changed

6 files changed

+31
-14
lines changed

config/lib.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
"lib-base",
1010
"micro"
1111
],
12+
"lib-depends-macos": [
13+
"lib-base",
14+
"micro",
15+
"libxml2"
16+
],
1217
"lib-suggests-linux": [
1318
"libacl",
1419
"brotli",
1520
"watcher"
1621
],
17-
"lib-suggests-unix": [
22+
"lib-suggests-macos": [
1823
"brotli",
1924
"watcher"
20-
],
21-
"lib-depends-macos": [
22-
"libxml2"
2325
]
2426
},
2527
"micro": {

src/SPC/ConsoleApplication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
final 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
{

src/SPC/builder/linux/LinuxBuilder.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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);

src/SPC/builder/macos/MacOSBuilder.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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);

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use SPC\builder\BuilderBase;
88
use SPC\builder\linux\SystemUtil as LinuxSystemUtil;
9+
use SPC\exception\SPCException;
910
use SPC\exception\SPCInternalException;
1011
use SPC\exception\ValidationException;
1112
use 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
}

src/SPC/builder/unix/library/libxml2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function build(): void
3030
);
3131

3232
if ($this instanceof LinuxLibraryBase) {
33-
$cmake->addConfigureArgs('-DIconv_IS_BUILD_IN=OFF');
33+
$cmake->addConfigureArgs('-DIconv_IS_BUILT_IN=OFF');
3434
}
3535

3636
$cmake->build();

0 commit comments

Comments
 (0)