mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Merge branch 'main' into remove-icu-backend
This commit is contained in:
commit
0156f33a20
@ -9,17 +9,19 @@
|
||||
"lib-base",
|
||||
"micro"
|
||||
],
|
||||
"lib-depends-macos": [
|
||||
"lib-base",
|
||||
"micro",
|
||||
"libxml2"
|
||||
],
|
||||
"lib-suggests-linux": [
|
||||
"libacl",
|
||||
"brotli",
|
||||
"watcher"
|
||||
],
|
||||
"lib-suggests-unix": [
|
||||
"lib-suggests-macos": [
|
||||
"brotli",
|
||||
"watcher"
|
||||
],
|
||||
"lib-depends-macos": [
|
||||
"libxml2"
|
||||
]
|
||||
},
|
||||
"micro": {
|
||||
|
||||
@ -34,7 +34,7 @@ use Symfony\Component\Console\Application;
|
||||
*/
|
||||
final class ConsoleApplication extends Application
|
||||
{
|
||||
public const string VERSION = '2.7.3';
|
||||
public const string VERSION = '2.7.4';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@ -103,9 +103,8 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
);
|
||||
}
|
||||
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec(
|
||||
$php_configure_env . ' ' .
|
||||
$this->seekPhpSrcLogFileOnException(fn () => shell()->cd(SOURCE_PATH . '/php-src')->exec(
|
||||
$php_configure_env . ' ' .
|
||||
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
||||
($enableCli ? '--enable-cli ' : '--disable-cli ') .
|
||||
($enableFpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
|
||||
@ -118,7 +117,7 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
$zts .
|
||||
$maxExecutionTimers .
|
||||
$this->makeStaticExtensionArgs() . ' '
|
||||
);
|
||||
));
|
||||
|
||||
$this->emitPatchPoint('before-php-make');
|
||||
SourcePatcher::patchBeforeMake($this);
|
||||
|
||||
@ -118,9 +118,8 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
}
|
||||
|
||||
$embed_type = getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') ?: 'static';
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec(
|
||||
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
||||
$this->seekPhpSrcLogFileOnException(fn () => shell()->cd(SOURCE_PATH . '/php-src')->exec(
|
||||
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
||||
($enableCli ? '--enable-cli ' : '--disable-cli ') .
|
||||
($enableFpm ? '--enable-fpm ' : '--disable-fpm ') .
|
||||
($enableEmbed ? "--enable-embed={$embed_type} " : '--disable-embed ') .
|
||||
@ -132,7 +131,7 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
$zts .
|
||||
$this->makeStaticExtensionArgs() . ' ' .
|
||||
$envs_build_php
|
||||
);
|
||||
));
|
||||
|
||||
$this->emitPatchPoint('before-php-make');
|
||||
SourcePatcher::patchBeforeMake($this);
|
||||
|
||||
@ -6,6 +6,7 @@ namespace SPC\builder\unix;
|
||||
|
||||
use SPC\builder\BuilderBase;
|
||||
use SPC\builder\linux\SystemUtil as LinuxSystemUtil;
|
||||
use SPC\exception\SPCException;
|
||||
use SPC\exception\SPCInternalException;
|
||||
use SPC\exception\ValidationException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
@ -338,4 +339,20 @@ abstract class UnixBuilderBase extends BuilderBase
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek php-src/config.log when building PHP, add it to exception.
|
||||
*/
|
||||
protected function seekPhpSrcLogFileOnException(callable $callback): void
|
||||
{
|
||||
try {
|
||||
$callback();
|
||||
} catch (SPCException $e) {
|
||||
if (file_exists(SOURCE_PATH . '/php-src/config.log')) {
|
||||
$e->addExtraLogFile('php-src config.log', 'php-src.config.log');
|
||||
copy(SOURCE_PATH . '/php-src/config.log', SPC_LOGS_DIR . '/php-src.config.log');
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ trait libxml2
|
||||
);
|
||||
|
||||
if ($this instanceof LinuxLibraryBase) {
|
||||
$cmake->addConfigureArgs('-DIconv_IS_BUILD_IN=OFF');
|
||||
$cmake->addConfigureArgs('-DIconv_IS_BUILT_IN=OFF');
|
||||
}
|
||||
|
||||
$cmake->build();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user