From 69ad568ee8cca1d04aed179b46b6cd7b05067d4c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 14:46:26 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prepare.php | 2 +- sapi/src/Extension.php | 16 +++++++++ sapi/src/Preprocessor.php | 49 ++++++++++++++++++++++++--- sapi/src/builder/extension/swoole.php | 20 ++++++----- 4 files changed, 74 insertions(+), 13 deletions(-) diff --git a/prepare.php b/prepare.php index 1e65a07d55..8b0fe32fd1 100755 --- a/prepare.php +++ b/prepare.php @@ -27,7 +27,7 @@ // Download swoole-src if (!is_dir(__DIR__ . '/ext/swoole')) { - shell_exec(__DIR__ . '/sapi/scripts/download-swoole-src-archive.sh'); + //shell_exec(__DIR__ . '/sapi/scripts/download-swoole-src-archive.sh'); } // Compile directly on the host machine, not in the docker container diff --git a/sapi/src/Extension.php b/sapi/src/Extension.php index fc9d681898..c056cc3f8b 100644 --- a/sapi/src/Extension.php +++ b/sapi/src/Extension.php @@ -7,6 +7,9 @@ class Extension extends Project public string $options = ''; public string $peclVersion = ''; + public string $pieVersion = ''; + public string $pieName = ''; + public array $dependentExtensions = []; public function withOptions(string $options): static @@ -26,4 +29,17 @@ public function withDependentExtensions(string ...$extensions): static $this->dependentExtensions += $extensions; return $this; } + + public function withPieVersion(string $pieVersion): static + { + $this->pieVersion = $pieVersion; + return $this; + } + + public function withPieName(string $pieName): static + { + $this->pieName = $pieName; + return $this; + } + } diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 3da0fd4d0a..a4fe8f4b8b 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -339,6 +339,39 @@ protected function downloadFile(string $url, string $file, ?object $project = nu } } + public function downloadFileWithPie(string $pieName, string $pieVersion, string $file, string $path, object $project): void + { + $workdir = $this->getWorkDir(); + $cmd = <<skipHashVerify and $project->enableHashVerify) { + if (!$project->hashVerify($file)) { + throw new Exception("The {$project->hashAlgo} of downloaded file[$file] is inconsistent with the configuration"); + } + } + } + /** * @param Library $lib * @throws Exception @@ -396,8 +429,10 @@ public function addLibrary(Library $lib): void public function addExtension(Extension $ext): void { - if ($ext->peclVersion) { - $ext->file = $ext->name . '-' . $ext->peclVersion . '.tgz'; + if ($ext->peclVersion || $ext->pieVersion) { + $extensionVersion = !empty($ext->peclVersion) ? $ext->peclVersion : $ext->pieVersion; + $downloadType = $ext->peclVersion ? 'pecl' : 'pie'; + $ext->file = $ext->name . '-' . $extensionVersion . '.tgz'; $ext->path = $this->extensionDir . '/' . $ext->file; $ext->url = "https://pecl.php.net/get/{$ext->file}"; @@ -411,8 +446,14 @@ public function addExtension(Extension $ext): void } if (!$this->getInputOption('skip-download')) { if (!is_file($ext->path) or filesize($ext->path) === 0) { - echo "[Extension] {$ext->file} not found, downloading: " . $ext->url . PHP_EOL; - $this->downloadFile($ext->url, $ext->path, $ext); + if ($downloadType === 'pecl') { + echo "[Extension] {$ext->file} not found, downloading: " . $ext->url . PHP_EOL; + $this->downloadFile($ext->url, $ext->path, $ext); + } else { + echo "[Extension] {$ext->file} not found, download with pie.phar " . $ext->homePage . PHP_EOL; + $this->downloadFileWithPie($ext->pieName, $ext->pieVersion, $ext->file, $ext->path, $ext); + } + } else { echo "[Extension] file cached: " . $ext->file . PHP_EOL; } diff --git a/sapi/src/builder/extension/swoole.php b/sapi/src/builder/extension/swoole.php index 6213b213f4..68c62a43c4 100644 --- a/sapi/src/builder/extension/swoole.php +++ b/sapi/src/builder/extension/swoole.php @@ -31,14 +31,18 @@ $p->withExportVariable('URING_LIBS', '$(pkg-config --libs --static liburing)'); } - $p->addExtension((new Extension('swoole')) - ->withHomePage('https://github.com/swoole/swoole-src') - ->withLicense('https://github.com/swoole/swoole-src/blob/master/LICENSE', Extension::LICENSE_APACHE2) - ->withManual('https://wiki.swoole.com/#/') - ->withOptions(implode(' ', $options)) - ->withBuildCached(false) - ->withDependentLibraries(...$dependentLibraries) - ->withDependentExtensions(...$dependentExtensions)); + $p->addExtension( + (new Extension('swoole')) + ->withHomePage('https://github.com/swoole/swoole-src') + ->withLicense('https://github.com/swoole/swoole-src/blob/master/LICENSE', Extension::LICENSE_APACHE2) + ->withManual('https://wiki.swoole.com/#/') + ->withOptions(implode(' ', $options)) + ->withBuildCached(false) + ->withDependentLibraries(...$dependentLibraries) + ->withDependentExtensions(...$dependentExtensions) + ->withPieName('swoole/swoole') + ->withPieVersion('v6.1.6') + ); $p->withVariable('LIBS', '$LIBS ' . ($p->isMacos() ? '-lc++' : '-lstdc++')); $p->withExportVariable('CARES_CFLAGS', '$(pkg-config --cflags --static libcares)'); From 557c5afbdc028bf66c5a5ea5a1635ee1f9393bdd Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 16:19:53 +0800 Subject: [PATCH 02/17] update auto cache pool --- .github/workflows/auto-cache-pool-tarball.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-cache-pool-tarball.yml b/.github/workflows/auto-cache-pool-tarball.yml index 3b251b3974..c768db16c4 100644 --- a/.github/workflows/auto-cache-pool-tarball.yml +++ b/.github/workflows/auto-cache-pool-tarball.yml @@ -84,8 +84,8 @@ jobs: composer install --no-interaction --no-autoloader --no-scripts --profile composer dump-autoload --optimize --profile - php prepare.php +inotify +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 - php prepare.php +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 @macos + php prepare.php +inotify +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 --without-docker + php prepare.php +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 @macos --without-docker php sapi/scripts/download-php-src-archive.php echo 'cygwin: https://www.cygwin.com/COPYING' >> bin/LICENSE From f3f819d690b075457227faa72d0a36dc70fe2179 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 16:28:19 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/Preprocessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index a4fe8f4b8b..5037bdabf0 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -349,7 +349,7 @@ public function downloadFileWithPie(string $pieName, string $pieVersion, string cd {$workdir}/var/ BASE_DIR=\$(pie show | grep 'Using pie.json: ' | awk -F 'pie.json: ' '{ print $2 }' | sed 's/pie.json//') pie info {$pieName}:{$pieVersion} -pie download {$pieName}:{$pieVersion} +pie download {$pieName}:{$pieVersion} --skip-enable-extension cd \${BASE_DIR}/vendor/{$pieName} tar -czf "{$workdir}/var/ext/{$file}" . cp -f {$workdir}/var/ext/{$file} {$path} From fba499c6f85ad6ff71923c2863e24655db3697a5 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 16:33:15 +0800 Subject: [PATCH 04/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux-glibc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-glibc.yml b/.github/workflows/linux-glibc.yml index 28e9b59f78..cc6bf50e12 100644 --- a/.github/workflows/linux-glibc.yml +++ b/.github/workflows/linux-glibc.yml @@ -99,7 +99,7 @@ jobs: composer install --no-interaction --no-autoloader --no-scripts --profile composer dump-autoload --optimize --profile - php prepare.php --with-libavif + php prepare.php --with-libavif --without-docker sudo apt update bash ./sapi/scripts/install-deps-on-ubuntu.sh From d8e5b667558e255797c23bc40ce1138cb02ac3db Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 16:35:18 +0800 Subject: [PATCH 05/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/windows-msys2.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml index 82bbdb0118..5b8116bdae 100644 --- a/.github/workflows/windows-msys2.yml +++ b/.github/workflows/windows-msys2.yml @@ -47,7 +47,8 @@ jobs: - name: prepare build environment shell: msys2 {0} run: | - bash ./sapi/quickstart/windows/msys2-build/install-msys2.sh + bash sapi/quickstart/windows/msys2-build/install-msys2.sh + bash sapi/download-box/download-box-get-archive-from-server.sh - name: install deps lib with source code shell: msys2 {0} From e33c2a7b5390a4843a2f0cf33f0a37995207dd7b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 16:50:30 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-cache-pool-tarball.yml | 4 ++-- prepare.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-cache-pool-tarball.yml b/.github/workflows/auto-cache-pool-tarball.yml index c768db16c4..8ad59a2765 100644 --- a/.github/workflows/auto-cache-pool-tarball.yml +++ b/.github/workflows/auto-cache-pool-tarball.yml @@ -84,8 +84,8 @@ jobs: composer install --no-interaction --no-autoloader --no-scripts --profile composer dump-autoload --optimize --profile - php prepare.php +inotify +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 --without-docker - php prepare.php +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 @macos --without-docker + php prepare.php +inotify +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 + php prepare.php +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 @macos = php sapi/scripts/download-php-src-archive.php echo 'cygwin: https://www.cygwin.com/COPYING' >> bin/LICENSE diff --git a/prepare.php b/prepare.php index 8b0fe32fd1..40fa41c8b0 100755 --- a/prepare.php +++ b/prepare.php @@ -31,7 +31,7 @@ } // Compile directly on the host machine, not in the docker container -if ($p->getInputOption('without-docker') || ($p->isMacos())) { +if ($p->getInputOption('without-docker') || ($p->isMacos()) || ($p->isLinux() && (!is_file('/.dockerenv')))) { $p->setWorkDir(__DIR__); $p->setBuildDir(__DIR__ . '/thirdparty'); } From 969d65df0ed799ff064d2c794567e6dbdb0d5543 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 16:50:48 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-cache-pool-tarball.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-cache-pool-tarball.yml b/.github/workflows/auto-cache-pool-tarball.yml index 8ad59a2765..3b251b3974 100644 --- a/.github/workflows/auto-cache-pool-tarball.yml +++ b/.github/workflows/auto-cache-pool-tarball.yml @@ -85,7 +85,7 @@ jobs: composer dump-autoload --optimize --profile php prepare.php +inotify +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 - php prepare.php +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 @macos = + php prepare.php +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 @macos php sapi/scripts/download-php-src-archive.php echo 'cygwin: https://www.cygwin.com/COPYING' >> bin/LICENSE From c2058c2f09b00b0ddac2babbfd06af42171733fe Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 17:59:15 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux-aarch64.yml | 2 +- .github/workflows/linux-x86_64.yml | 2 +- .github/workflows/macos-aarch64.yml | 2 +- .github/workflows/macos-x86_64.yml | 2 +- setup-php-runtime.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux-aarch64.yml b/.github/workflows/linux-aarch64.yml index d25111e95b..03b2e2327b 100644 --- a/.github/workflows/linux-aarch64.yml +++ b/.github/workflows/linux-aarch64.yml @@ -95,7 +95,7 @@ jobs: mkdir -p bin/ mkdir -p runtime/ test -f runtime/php && rm -f runtime/php - if [ ! -f runtime/php/php ] ; then + if [ ! -f runtime/php/pie ] ; then bash setup-php-runtime.sh fi bash sapi/download-box/download-box-get-archive-from-server.sh diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml index b0034b33f0..0e4ab704f7 100644 --- a/.github/workflows/linux-x86_64.yml +++ b/.github/workflows/linux-x86_64.yml @@ -95,7 +95,7 @@ jobs: mkdir -p bin/ mkdir -p runtime/ test -f runtime/php && rm -f runtime/php - if [ ! -f runtime/php/php ] ; then + if [ ! -f runtime/php/pie ] ; then bash setup-php-runtime.sh fi bash sapi/download-box/download-box-get-archive-from-server.sh diff --git a/.github/workflows/macos-aarch64.yml b/.github/workflows/macos-aarch64.yml index 61226e828b..31b3cefb40 100644 --- a/.github/workflows/macos-aarch64.yml +++ b/.github/workflows/macos-aarch64.yml @@ -90,7 +90,7 @@ jobs: mkdir -p bin/ mkdir -p runtime/ test -f runtime/php && rm -f runtime/php - if [ ! -f runtime/php/php ] ; then + if [ ! -f runtime/php/pie ] ; then bash setup-php-runtime.sh fi bash sapi/download-box/download-box-get-archive-from-server.sh diff --git a/.github/workflows/macos-x86_64.yml b/.github/workflows/macos-x86_64.yml index 625dc09231..75d442a37d 100644 --- a/.github/workflows/macos-x86_64.yml +++ b/.github/workflows/macos-x86_64.yml @@ -90,7 +90,7 @@ jobs: mkdir -p bin/ mkdir -p runtime/ test -f runtime/php && rm -f runtime/php - if [ ! -f runtime/php/php ] ; then + if [ ! -f runtime/php/pie ] ; then bash setup-php-runtime.sh fi bash sapi/download-box/download-box-get-archive-from-server.sh diff --git a/setup-php-runtime.sh b/setup-php-runtime.sh index 17931779a1..0621068ff8 100644 --- a/setup-php-runtime.sh +++ b/setup-php-runtime.sh @@ -51,7 +51,7 @@ esac APP_VERSION='v5.1.3' APP_NAME='swoole-cli' VERSION='v5.1.3.0' -PIE_VERSION="1.2.1" +PIE_VERSION="1.3.5" # 查看pie最新版本 https://github.com/php/pie/releases/latest cd ${__PROJECT__} From efcdaee3f2ac4e42149bee6b855c673043cdec2a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 18:02:40 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/Preprocessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 5037bdabf0..6315a62453 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -347,9 +347,9 @@ public function downloadFileWithPie(string $pieName, string $pieVersion, string export PIE_WORKING_DIRECTORY={$workdir}/var/ext/pie/ test -d \$PIE_WORKING_DIRECTORY || mkdir -p \$PIE_WORKING_DIRECTORY cd {$workdir}/var/ +pie download {$pieName}:{$pieVersion} --skip-enable-extension BASE_DIR=\$(pie show | grep 'Using pie.json: ' | awk -F 'pie.json: ' '{ print $2 }' | sed 's/pie.json//') pie info {$pieName}:{$pieVersion} -pie download {$pieName}:{$pieVersion} --skip-enable-extension cd \${BASE_DIR}/vendor/{$pieName} tar -czf "{$workdir}/var/ext/{$file}" . cp -f {$workdir}/var/ext/{$file} {$path} From e4e5f55fc43eede0365a106ecedeb00e3d3ae7e6 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 18:09:03 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/Preprocessor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 6315a62453..1cab65ce5d 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -348,7 +348,8 @@ public function downloadFileWithPie(string $pieName, string $pieVersion, string test -d \$PIE_WORKING_DIRECTORY || mkdir -p \$PIE_WORKING_DIRECTORY cd {$workdir}/var/ pie download {$pieName}:{$pieVersion} --skip-enable-extension -BASE_DIR=\$(pie show | grep 'Using pie.json: ' | awk -F 'pie.json: ' '{ print $2 }' | sed 's/pie.json//') +pie show {$pieName}:{$pieVersion} +BASE_DIR=\$(pie show {$pieName}:{$pieVersion} | grep 'Using pie.json: ' | awk -F 'pie.json: ' '{ print $2 }' | sed 's/pie.json//') pie info {$pieName}:{$pieVersion} cd \${BASE_DIR}/vendor/{$pieName} tar -czf "{$workdir}/var/ext/{$file}" . From 86ac082ccf20665e65f06eb2f07c5a5064ff0721 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 18:13:03 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/Preprocessor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 1cab65ce5d..4b7fb4e38e 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -348,9 +348,9 @@ public function downloadFileWithPie(string $pieName, string $pieVersion, string test -d \$PIE_WORKING_DIRECTORY || mkdir -p \$PIE_WORKING_DIRECTORY cd {$workdir}/var/ pie download {$pieName}:{$pieVersion} --skip-enable-extension -pie show {$pieName}:{$pieVersion} -BASE_DIR=\$(pie show {$pieName}:{$pieVersion} | grep 'Using pie.json: ' | awk -F 'pie.json: ' '{ print $2 }' | sed 's/pie.json//') pie info {$pieName}:{$pieVersion} +pie show +BASE_DIR=\$(pie show | grep 'Using pie.json: ' | awk -F 'pie.json: ' '{ print $2 }' | sed 's/pie.json//') cd \${BASE_DIR}/vendor/{$pieName} tar -czf "{$workdir}/var/ext/{$file}" . cp -f {$workdir}/var/ext/{$file} {$path} From 5bf68de655543394c16dfaebaba20a6cc30a599e Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 19:57:26 +0800 Subject: [PATCH 12/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/Preprocessor.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 4b7fb4e38e..8501f95e64 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -343,11 +343,11 @@ public function downloadFileWithPie(string $pieName, string $pieVersion, string { $workdir = $this->getWorkDir(); $cmd = << Date: Wed, 7 Jan 2026 20:02:45 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/Preprocessor.php | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 8501f95e64..4507edb2cb 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -350,6 +350,7 @@ public function downloadFileWithPie(string $pieName, string $pieVersion, string pie download {$pieName}:{$pieVersion} pie info {$pieName}:{$pieVersion} pie show +exit 0 BASE_DIR=\$(pie show | grep 'Using pie.json: ' | awk -F 'pie.json: ' '{ print $2 }' | sed 's/pie.json//') cd \${BASE_DIR}/vendor/{$pieName} tar -czf "{$workdir}/var/ext/{$file}" . From 61e576a4c8bf255a220f613f38b7c55c7a11d25b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 21:25:21 +0800 Subject: [PATCH 14/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95=20=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/SWOOLE-VERSION.conf | 2 +- sapi/src/Preprocessor.php | 19 ++++++++++++------- sapi/src/builder/extension/swoole.php | 4 ++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/sapi/SWOOLE-VERSION.conf b/sapi/SWOOLE-VERSION.conf index b2c63a1c1b..4871c222ec 100644 --- a/sapi/SWOOLE-VERSION.conf +++ b/sapi/SWOOLE-VERSION.conf @@ -1 +1 @@ -v6.1.3 +v6.1.6 diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 4507edb2cb..0a3414158f 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -346,20 +346,25 @@ public function downloadFileWithPie(string $pieName, string $pieVersion, string test -f {$workdir}/runtime/php/php && export PATH={$workdir}/runtime/php/:\$PATH ; export PIE_WORKING_DIRECTORY={$workdir}/var/ext/pie/ test -d \$PIE_WORKING_DIRECTORY || mkdir -p \$PIE_WORKING_DIRECTORY ; -cd {$workdir}/var/ -pie download {$pieName}:{$pieVersion} -pie info {$pieName}:{$pieVersion} -pie show -exit 0 -BASE_DIR=\$(pie show | grep 'Using pie.json: ' | awk -F 'pie.json: ' '{ print $2 }' | sed 's/pie.json//') -cd \${BASE_DIR}/vendor/{$pieName} +cd {$workdir}/var/ext/ +TEMP_FILE=$(mktemp) && echo "TEMP_FILE: \${TEMP_FILE}" ; +{ pie download {$pieName}:{$pieVersion} ; } > \${TEMP_FILE} 2>&1 +cat \${TEMP_FILE} +SOURCE_CODE_DIR=\$(cat \${TEMP_FILE} | grep 'source to: ' | awk -F 'source to: ' '{ print $2 }') +rm -f \${TEMP_FILE} +echo "{$pieName}:{$pieVersion} source code: \${SOURCE_CODE_DIR}" +pie info {$pieName}:{$pieVersion}; +cd \${SOURCE_CODE_DIR} tar -czf "{$workdir}/var/ext/{$file}" . cp -f {$workdir}/var/ext/{$file} {$path} cd {$workdir} EOF; echo $cmd; echo PHP_EOL; + echo '------------RUNNING START-------------'; + echo PHP_EOL; echo `$cmd`; + echo '------------RUNNING END-------------'; echo PHP_EOL; $file = $path; die(0); diff --git a/sapi/src/builder/extension/swoole.php b/sapi/src/builder/extension/swoole.php index 68c62a43c4..100c049e01 100644 --- a/sapi/src/builder/extension/swoole.php +++ b/sapi/src/builder/extension/swoole.php @@ -30,7 +30,7 @@ $p->withExportVariable('URING_CFLAGS', '$(pkg-config --cflags --static liburing)'); $p->withExportVariable('URING_LIBS', '$(pkg-config --libs --static liburing)'); } - + $swoole_version = trim(file_get_contents(__DIR__ . '/../../../SWOOLE-VERSION.conf')); $p->addExtension( (new Extension('swoole')) ->withHomePage('https://github.com/swoole/swoole-src') @@ -41,7 +41,7 @@ ->withDependentLibraries(...$dependentLibraries) ->withDependentExtensions(...$dependentExtensions) ->withPieName('swoole/swoole') - ->withPieVersion('v6.1.6') + ->withPieVersion($swoole_version) ); $p->withVariable('LIBS', '$LIBS ' . ($p->isMacos() ? '-lc++' : '-lstdc++')); From ae6ad796c47be71768efa10d16816d63d885322b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 21:33:40 +0800 Subject: [PATCH 15/17] update prepare.php --- prepare.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/prepare.php b/prepare.php index 40fa41c8b0..1d1707bbc6 100755 --- a/prepare.php +++ b/prepare.php @@ -46,7 +46,12 @@ if ($p->isMacos()) { $p->setExtraLdflags(''); - $homebrew_prefix = trim(shell_exec('brew --prefix')); + exec("brew --prefix 2>&1", $output, $result_code); + if ($result_code == 0) { + $homebrew_prefix = trim(implode(' ', $output)); + } else { + $homebrew_prefix = ""; + } $p->withBinPath($homebrew_prefix . '/opt/flex/bin') ->withBinPath($homebrew_prefix . '/opt/bison/bin') ->withBinPath($homebrew_prefix . '/opt/libtool/bin') From 41691be339a09bd6ca7bdb8babc8de11c55635de Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 21:39:16 +0800 Subject: [PATCH 16/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95=20=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/Preprocessor.php | 1 - 1 file changed, 1 deletion(-) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 0a3414158f..63a51cc2ca 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -367,7 +367,6 @@ public function downloadFileWithPie(string $pieName, string $pieVersion, string echo '------------RUNNING END-------------'; echo PHP_EOL; $file = $path; - die(0); // 下载失败 if (!is_file($file) or filesize($file) == 0) { throw new Exception("with pie Downloading file[" . basename($file) . "] from failed"); From 1dcb719683de76b81fbc18a6f0d91556260f2056 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 21:46:58 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20pie=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=A9=E5=B1=95=20=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux-glibc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-glibc.yml b/.github/workflows/linux-glibc.yml index cc6bf50e12..3580cfe5a6 100644 --- a/.github/workflows/linux-glibc.yml +++ b/.github/workflows/linux-glibc.yml @@ -85,7 +85,7 @@ jobs: mkdir -p bin/ mkdir -p runtime/ test -f runtime/php && rm -f runtime/php - if [ ! -f runtime/php/php ] ; then + if [ ! -f runtime/php/pie ] ; then bash setup-php-runtime.sh fi bash sapi/download-box/download-box-get-archive-from-server.sh