From 71083bb0a4a9d846865ee812b04a692825512d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 21 Aug 2023 09:30:46 +0200 Subject: [PATCH 01/13] feat: add support for libphp and the embed SAPI --- src/SPC/builder/BuilderBase.php | 3 ++ src/SPC/builder/linux/LinuxBuilder.php | 36 +++++++++++++++++++---- src/SPC/builder/macos/MacOSBuilder.php | 40 ++++++++++++++++++++------ src/SPC/command/BuildCliCommand.php | 7 +++-- src/globals/defines.php | 3 +- 5 files changed, 71 insertions(+), 18 deletions(-) diff --git a/src/SPC/builder/BuilderBase.php b/src/SPC/builder/BuilderBase.php index 1c3c84fb9..472d93821 100644 --- a/src/SPC/builder/BuilderBase.php +++ b/src/SPC/builder/BuilderBase.php @@ -252,6 +252,9 @@ public function getBuildTypeName(int $type): string if (($type & BUILD_TARGET_FPM) === BUILD_TARGET_FPM) { $ls[] = 'fpm'; } + if (($type & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED) { + $ls[] = 'embed'; + } return implode(', ', $ls); } diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index 431fe4901..16533c651 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -179,6 +179,11 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void $zts = ''; } + $enableCli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI; + $enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM; + $enableMicro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO; + $enableEmbed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED; + shell()->cd(SOURCE_PATH . '/php-src') ->exec( './configure ' . @@ -189,12 +194,13 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void '--disable-all ' . '--disable-cgi ' . '--disable-phpdbg ' . - '--enable-cli ' . - '--enable-fpm ' . + ($enableCli ? '--enable-cli ' : '') . + ($enableFpm ? '--enable-fpm ' : '') . + ($enableEmbed ? '--enable-embed=static ' : '') . $json_74 . $zts . $maxExecutionTimers . - '--enable-micro=all-static ' . + ($enableMicro ? '--enable-micro=all-static ' : '') . $this->makeExtensionArgs() . ' ' . $envs ); @@ -203,18 +209,22 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void $this->cleanMake(); - if (($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI) { + if ($enableCli) { logger()->info('building cli'); $this->buildCli($extra_libs, $use_lld); } - if (($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM) { + if ($enableFpm) { logger()->info('building fpm'); $this->buildFpm($extra_libs, $use_lld); } - if (($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO) { + if ($enableMicro) { logger()->info('building micro'); $this->buildMicro($extra_libs, $use_lld, $cflags); } + if ($enableEmbed) { + logger()->info('building embed'); + $this->buildEmbed($extra_libs, $use_lld); + } if (php_uname('m') === $this->getOption('arch')) { $this->sanityCheck($build_target); @@ -306,4 +316,18 @@ public function buildFpm(string $extra_libs, string $use_lld): void $this->deployBinary(BUILD_TARGET_FPM); } + + public function buildEmbed(string $extra_libs, string $use_lld): void + { + $vars = SystemUtil::makeEnvVarString([ + 'EXTRA_CFLAGS' => '-g -Os -fno-ident ' . implode(' ', array_map(fn ($x) => "-Xcompiler {$x}", $this->tune_c_flags)), + 'EXTRA_LIBS' => $extra_libs, + 'EXTRA_LDFLAGS_PROGRAM' => "{$use_lld} -all-static", + ]); + + shell() + ->cd(SOURCE_PATH . '/php-src') + ->exec('sed -i "s|//lib|/lib|g" Makefile') + ->exec('make INSTALL_ROOT=' . BUILD_ROOT_PATH . " -j{$this->concurrency} {$vars} install"); + } } diff --git a/src/SPC/builder/macos/MacOSBuilder.php b/src/SPC/builder/macos/MacOSBuilder.php index 0e8c98f00..c87c9d2c1 100644 --- a/src/SPC/builder/macos/MacOSBuilder.php +++ b/src/SPC/builder/macos/MacOSBuilder.php @@ -151,6 +151,11 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void $json_74 = $this->getPHPVersionID() < 80000 ? '--enable-json ' : ''; $zts = $this->getOption('enable-zts', false) ? '--enable-zts --disable-zend-signals ' : ''; + $enableCli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI; + $enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM; + $enableMicro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO; + $enableEmbed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED; + shell()->cd(SOURCE_PATH . '/php-src') ->exec( './configure ' . @@ -162,9 +167,10 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void '--disable-all ' . '--disable-cgi ' . '--disable-phpdbg ' . - '--enable-cli ' . - '--enable-fpm ' . - '--enable-micro ' . + ($enableCli ? '--enable-cli ' : '') . + ($enableFpm ? '--enable-fpm ' : '') . + ($enableEmbed ? '--enable-embed=static ' : '') . + ($enableMicro ? '--enable-micro ' : '') . $json_74 . $zts . $this->makeExtensionArgs() . ' ' . @@ -175,18 +181,22 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void $this->cleanMake(); - if (($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI) { + if ($enableCli) { logger()->info('building cli'); $this->buildCli(); } - if (($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM) { + if ($enableFpm) { logger()->info('building fpm'); $this->buildFpm(); } - if (($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO) { + if ($enableMicro) { logger()->info('building micro'); $this->buildMicro(); } + if ($enableEmbed) { + logger()->info('building embed'); + $this->buildEmbed(); + } if (php_uname('m') === $this->getOption('arch')) { $this->sanityCheck($build_target); @@ -207,7 +217,7 @@ public function buildCli(): void { $vars = SystemUtil::makeEnvVarString([ 'EXTRA_CFLAGS' => '-g -Os', // with debug information, but optimize for size - 'EXTRA_LIBS' => "{$this->getOption('extra-libs')} -lresolv", // link resolv library (macOS need it) + 'EXTRA_LIBS' => "{$this->getOption('extra-libs')} -lresolv", // link resolv library (macOS needs it) ]); $shell = shell()->cd(SOURCE_PATH . '/php-src'); @@ -237,7 +247,7 @@ public function buildMicro(): void $vars = [ // with debug information, optimize for size, remove identifiers, patch fake cli for micro 'EXTRA_CFLAGS' => '-g -Os -fno-ident' . $enable_fake_cli, - // link resolv library (macOS need it) + // link resolv library (macOS needs it) 'EXTRA_LIBS' => "{$this->getOption('extra-libs')} -lresolv", ]; if (!$this->getOption('no-strip', false)) { @@ -260,7 +270,7 @@ public function buildFpm(): void { $vars = SystemUtil::makeEnvVarString([ 'EXTRA_CFLAGS' => '-g -Os', // with debug information, but optimize for size - 'EXTRA_LIBS' => "{$this->getOption('extra-libs')} -lresolv", // link resolv library (macOS need it) + 'EXTRA_LIBS' => "{$this->getOption('extra-libs')} -lresolv", // link resolv library (macOS needs it) ]); $shell = shell()->cd(SOURCE_PATH . '/php-src'); @@ -270,4 +280,16 @@ public function buildFpm(): void } $this->deployBinary(BUILD_TARGET_FPM); } + + public function buildEmbed(): void + { + $vars = SystemUtil::makeEnvVarString([ + 'EXTRA_CFLAGS' => '-g -Os', // with debug information, but optimize for size + 'EXTRA_LIBS' => "{$this->getOption('extra-libs')} -lresolv", // link resolv library (macOS needs it) + ]); + + shell() + ->cd(SOURCE_PATH . '/php-src') + ->exec('make INSTALL_ROOT=' . BUILD_ROOT_PATH . " -j{$this->concurrency} {$vars} install"); + } } diff --git a/src/SPC/command/BuildCliCommand.php b/src/SPC/command/BuildCliCommand.php index 517f30d76..ee461793a 100644 --- a/src/SPC/command/BuildCliCommand.php +++ b/src/SPC/command/BuildCliCommand.php @@ -25,7 +25,8 @@ public function configure(): void $this->addOption('build-micro', null, null, 'build micro'); $this->addOption('build-cli', null, null, 'build cli'); $this->addOption('build-fpm', null, null, 'build fpm'); - $this->addOption('build-all', null, null, 'build cli, micro, fpm'); + $this->addOption('build-embed', null, null, 'build embed'); + $this->addOption('build-all', null, null, 'build cli, micro, fpm, embed'); $this->addOption('no-strip', null, null, 'build without strip, in order to debug and load external extensions'); $this->addOption('enable-zts', null, null, 'enable ZTS support'); $this->addOption('with-hardcoded-ini', 'I', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Patch PHP source code, inject hardcoded INI'); @@ -43,13 +44,15 @@ public function handle(): int $rule = $rule | ($this->getOption('build-cli') ? BUILD_TARGET_CLI : BUILD_TARGET_NONE); $rule = $rule | ($this->getOption('build-micro') ? BUILD_TARGET_MICRO : BUILD_TARGET_NONE); $rule = $rule | ($this->getOption('build-fpm') ? BUILD_TARGET_FPM : BUILD_TARGET_NONE); + $rule = $rule | ($this->getOption('build-embed') ? BUILD_TARGET_EMBED : BUILD_TARGET_NONE); $rule = $rule | ($this->getOption('build-all') ? BUILD_TARGET_ALL : BUILD_TARGET_NONE); if ($rule === BUILD_TARGET_NONE) { $this->output->writeln('Please add at least one build target!'); $this->output->writeln("\t--build-cli\tBuild php-cli SAPI"); $this->output->writeln("\t--build-micro\tBuild phpmicro SAPI"); $this->output->writeln("\t--build-fpm\tBuild php-fpm SAPI"); - $this->output->writeln("\t--build-all\tBuild all SAPI: cli, micro, fpm"); + $this->output->writeln("\t--build-embed\tBuild embed SAPI/libphp"); + $this->output->writeln("\t--build-all\tBuild all SAPI: cli, micro, fpm, embed"); return static::FAILURE; } try { diff --git a/src/globals/defines.php b/src/globals/defines.php index 28473296a..150b27533 100644 --- a/src/globals/defines.php +++ b/src/globals/defines.php @@ -43,7 +43,8 @@ const BUILD_TARGET_CLI = 1; // build cli const BUILD_TARGET_MICRO = 2; // build micro const BUILD_TARGET_FPM = 4; // build fpm -const BUILD_TARGET_ALL = 7; // build all +const BUILD_TARGET_EMBED = 8; // build embed +const BUILD_TARGET_ALL = 15; // build all // doctor error fix policy const FIX_POLICY_DIE = 1; // die directly From 1743a1a7901255d3c109d5eb38d066e00f46c346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 30 Aug 2023 17:47:29 +0200 Subject: [PATCH 02/13] workaround for macOS --- src/SPC/builder/macos/MacOSBuilder.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/macos/MacOSBuilder.php b/src/SPC/builder/macos/MacOSBuilder.php index c87c9d2c1..65a7ebe42 100644 --- a/src/SPC/builder/macos/MacOSBuilder.php +++ b/src/SPC/builder/macos/MacOSBuilder.php @@ -290,6 +290,15 @@ public function buildEmbed(): void shell() ->cd(SOURCE_PATH . '/php-src') - ->exec('make INSTALL_ROOT=' . BUILD_ROOT_PATH . " -j{$this->concurrency} {$vars} install"); + ->exec('make INSTALL_ROOT=' . BUILD_ROOT_PATH . " -j{$this->concurrency} {$vars} install") + // https://github.com/php/php-src/issues/12082 + ->exec('rm -Rf ' . BUILD_ROOT_PATH . '/lib/php-o') + ->exec('mkdir ' . BUILD_ROOT_PATH . '/lib/php-o') + ->cd(BUILD_ROOT_PATH . '/lib/php-o') + ->exec('ar x ' . BUILD_ROOT_PATH . '/lib/libphp.a') + ->exec('ls') + ->exec('rm ' . BUILD_ROOT_PATH . '/lib/libphp.a') + ->exec('ar rcs ' . BUILD_ROOT_PATH . '/lib/libphp.a *.o') + ->exec('rm -Rf ' . BUILD_ROOT_PATH . '/lib/php-o'); } } From bbf193bad3adee3ca607ae769ddab94a5e8e9c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 30 Aug 2023 18:14:59 +0200 Subject: [PATCH 03/13] remove useless ls --- src/SPC/builder/macos/MacOSBuilder.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/SPC/builder/macos/MacOSBuilder.php b/src/SPC/builder/macos/MacOSBuilder.php index 65a7ebe42..d87c8c532 100644 --- a/src/SPC/builder/macos/MacOSBuilder.php +++ b/src/SPC/builder/macos/MacOSBuilder.php @@ -291,12 +291,11 @@ public function buildEmbed(): void shell() ->cd(SOURCE_PATH . '/php-src') ->exec('make INSTALL_ROOT=' . BUILD_ROOT_PATH . " -j{$this->concurrency} {$vars} install") - // https://github.com/php/php-src/issues/12082 + // Workaround for https://github.com/php/php-src/issues/12082 ->exec('rm -Rf ' . BUILD_ROOT_PATH . '/lib/php-o') ->exec('mkdir ' . BUILD_ROOT_PATH . '/lib/php-o') ->cd(BUILD_ROOT_PATH . '/lib/php-o') ->exec('ar x ' . BUILD_ROOT_PATH . '/lib/libphp.a') - ->exec('ls') ->exec('rm ' . BUILD_ROOT_PATH . '/lib/libphp.a') ->exec('ar rcs ' . BUILD_ROOT_PATH . '/lib/libphp.a *.o') ->exec('rm -Rf ' . BUILD_ROOT_PATH . '/lib/php-o'); From 34cb10a07a114034be92062ecdc491a7a575b5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 30 Aug 2023 22:46:04 +0200 Subject: [PATCH 04/13] use lixml GH mirror because gitlab.gnome.org is down --- config/source.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/source.json b/config/source.json index 2f1e2e418..3c052a26d 100644 --- a/config/source.json +++ b/config/source.json @@ -249,7 +249,7 @@ }, "libxml2": { "type": "url", - "url": "https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.9.14/libxml2-v2.9.14.tar.gz", + "url": "https://github.com/GNOME/libxml2/archive/refs/tags/v2.9.14.tar.gz", "license": { "type": "file", "path": "Copyright" From eb07934e6e6288af9fa45fc402480da09c5e1cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Sat, 2 Sep 2023 21:25:33 +0200 Subject: [PATCH 05/13] explicitly disable unneeded SAPIs --- src/SPC/builder/linux/LinuxBuilder.php | 8 ++++---- src/SPC/builder/macos/MacOSBuilder.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index 16533c651..0e7d0e372 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -194,13 +194,13 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void '--disable-all ' . '--disable-cgi ' . '--disable-phpdbg ' . - ($enableCli ? '--enable-cli ' : '') . - ($enableFpm ? '--enable-fpm ' : '') . - ($enableEmbed ? '--enable-embed=static ' : '') . + ($enableCli ? '--enable-cli ' : '--disable-cli ') . + ($enableFpm ? '--enable-fpm ' : '--disable-fpm ') . + ($enableEmbed ? '--enable-embed=static ' : '--disable-embed ') . $json_74 . $zts . $maxExecutionTimers . - ($enableMicro ? '--enable-micro=all-static ' : '') . + ($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') . $this->makeExtensionArgs() . ' ' . $envs ); diff --git a/src/SPC/builder/macos/MacOSBuilder.php b/src/SPC/builder/macos/MacOSBuilder.php index d87c8c532..d179a1bcc 100644 --- a/src/SPC/builder/macos/MacOSBuilder.php +++ b/src/SPC/builder/macos/MacOSBuilder.php @@ -167,10 +167,10 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void '--disable-all ' . '--disable-cgi ' . '--disable-phpdbg ' . - ($enableCli ? '--enable-cli ' : '') . - ($enableFpm ? '--enable-fpm ' : '') . - ($enableEmbed ? '--enable-embed=static ' : '') . - ($enableMicro ? '--enable-micro ' : '') . + ($enableCli ? '--enable-cli ' : '--disable-cli ') . + ($enableFpm ? '--enable-fpm ' : '--disable-fpm ') . + ($enableEmbed ? '--enable-embed=static ' : '--disable-embed ') . + ($enableMicro ? '--enable-micro ' : '--disable-micro ') . $json_74 . $zts . $this->makeExtensionArgs() . ' ' . From cb670e3067ba2524c08b5cffe5ebd2f5256080aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 4 Sep 2023 22:51:30 +0200 Subject: [PATCH 06/13] fix: replace down URL --- config/source.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config/source.json b/config/source.json index 3c052a26d..8ccb74160 100644 --- a/config/source.json +++ b/config/source.json @@ -357,9 +357,8 @@ } }, "pkg-config": { - "type": "filelist", - "url": "https://pkgconfig.freedesktop.org/releases/", - "regex": "/href=\"(?pkg-config-(?[^\"]+)\\.tar\\.gz)\"/", + "type": "url", + "url": "https://gitlab.freedesktop.org/pkg-config/pkg-config/-/archive/pkg-config-0.29.2/pkg-config-pkg-config-0.29.2.tar.gz", "license": { "type": "file", "path": "COPYING" From 2f3ca553133765eb45b55ea1a28c8462620d66c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 11 Sep 2023 14:30:42 +0200 Subject: [PATCH 07/13] Revert "fix: replace down URL" This reverts commit 6eadbca21bf9a3b57058160a2f7ea8f4cc5f21dd. --- config/source.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/source.json b/config/source.json index 8ccb74160..3c052a26d 100644 --- a/config/source.json +++ b/config/source.json @@ -357,8 +357,9 @@ } }, "pkg-config": { - "type": "url", - "url": "https://gitlab.freedesktop.org/pkg-config/pkg-config/-/archive/pkg-config-0.29.2/pkg-config-pkg-config-0.29.2.tar.gz", + "type": "filelist", + "url": "https://pkgconfig.freedesktop.org/releases/", + "regex": "/href=\"(?pkg-config-(?[^\"]+)\\.tar\\.gz)\"/", "license": { "type": "file", "path": "COPYING" From 7c78003c9f2223b00a53e5274afba2c6f0e1c5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 11 Sep 2023 15:54:20 +0200 Subject: [PATCH 08/13] temporary workaround for PECL certificate expiration --- src/SPC/store/Downloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SPC/store/Downloader.php b/src/SPC/store/Downloader.php index c8bdf1799..514fc1af2 100644 --- a/src/SPC/store/Downloader.php +++ b/src/SPC/store/Downloader.php @@ -395,7 +395,7 @@ public static function curlDown(string $url, string $path, string $method = 'GET }; $headerArg = implode(' ', array_map(fn ($v) => '"-H' . $v . '"', $headers)); $check = !defined('DEBUG_MODE') ? 's' : '#'; - $cmd = "curl -{$check}fSL -o \"{$path}\" {$methodArg} {$headerArg} \"{$url}\""; + $cmd = "curl -{$check}fSLk -o \"{$path}\" {$methodArg} {$headerArg} \"{$url}\""; f_passthru($cmd); } } From eb8cefd9ca29d6eb31a4248edd242582b940ae10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 11 Sep 2023 19:37:09 +0200 Subject: [PATCH 09/13] always enable micro --- src/SPC/builder/linux/LinuxBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index 0e7d0e372..cf0b88125 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -200,7 +200,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void $json_74 . $zts . $maxExecutionTimers . - ($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') . + '--enable-micro=all-static ' . $this->makeExtensionArgs() . ' ' . $envs ); From 6d375203f6a66e2510017d87adcf290e26ced452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 11 Sep 2023 22:22:20 +0200 Subject: [PATCH 10/13] Revert "temporary workaround for PECL certificate expiration" This reverts commit 7c78003c9f2223b00a53e5274afba2c6f0e1c5db. --- src/SPC/store/Downloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SPC/store/Downloader.php b/src/SPC/store/Downloader.php index 514fc1af2..c8bdf1799 100644 --- a/src/SPC/store/Downloader.php +++ b/src/SPC/store/Downloader.php @@ -395,7 +395,7 @@ public static function curlDown(string $url, string $path, string $method = 'GET }; $headerArg = implode(' ', array_map(fn ($v) => '"-H' . $v . '"', $headers)); $check = !defined('DEBUG_MODE') ? 's' : '#'; - $cmd = "curl -{$check}fSLk -o \"{$path}\" {$methodArg} {$headerArg} \"{$url}\""; + $cmd = "curl -{$check}fSL -o \"{$path}\" {$methodArg} {$headerArg} \"{$url}\""; f_passthru($cmd); } } From 832ac64aa131cfdb4df7d1851338ffad80c1cf88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 11 Sep 2023 22:22:41 +0200 Subject: [PATCH 11/13] Revert "always enable micro" This reverts commit eb8cefd9ca29d6eb31a4248edd242582b940ae10. --- src/SPC/builder/linux/LinuxBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index cf0b88125..0e7d0e372 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -200,7 +200,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void $json_74 . $zts . $maxExecutionTimers . - '--enable-micro=all-static ' . + ($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') . $this->makeExtensionArgs() . ' ' . $envs ); From 9e9e3e20b334974ef4ebe76fee78f576fb36b038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 11 Sep 2023 22:26:26 +0200 Subject: [PATCH 12/13] static opcache patch --- src/SPC/builder/linux/LinuxBuilder.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index 0e7d0e372..ef458c814 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -319,6 +319,8 @@ public function buildFpm(string $extra_libs, string $use_lld): void public function buildEmbed(string $extra_libs, string $use_lld): void { + SourcePatcher::patchMicro(['static_opcache']); + $vars = SystemUtil::makeEnvVarString([ 'EXTRA_CFLAGS' => '-g -Os -fno-ident ' . implode(' ', array_map(fn ($x) => "-Xcompiler {$x}", $this->tune_c_flags)), 'EXTRA_LIBS' => $extra_libs, From c548c01a0d98b67c1291a02807f93613e41c8323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 11 Sep 2023 23:00:26 +0200 Subject: [PATCH 13/13] --disable-opcache-jit --- src/SPC/builder/linux/LinuxBuilder.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index ef458c814..7859139e1 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -196,7 +196,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void '--disable-phpdbg ' . ($enableCli ? '--enable-cli ' : '--disable-cli ') . ($enableFpm ? '--enable-fpm ' : '--disable-fpm ') . - ($enableEmbed ? '--enable-embed=static ' : '--disable-embed ') . + ($enableEmbed ? '--enable-embed=static --disable-opcache-jit ' : '--disable-embed ') . $json_74 . $zts . $maxExecutionTimers . @@ -319,8 +319,6 @@ public function buildFpm(string $extra_libs, string $use_lld): void public function buildEmbed(string $extra_libs, string $use_lld): void { - SourcePatcher::patchMicro(['static_opcache']); - $vars = SystemUtil::makeEnvVarString([ 'EXTRA_CFLAGS' => '-g -Os -fno-ident ' . implode(' ', array_map(fn ($x) => "-Xcompiler {$x}", $this->tune_c_flags)), 'EXTRA_LIBS' => $extra_libs,