From fbd6360bda60536567429fb30617da85644f0325 Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Thu, 19 Jun 2025 12:07:22 +0700 Subject: [PATCH] rename go-mod-frankenphp to go-xcaddy --- config/pkg.json | 8 ++++---- src/SPC/builder/BuilderBase.php | 6 +++--- src/SPC/builder/unix/UnixBuilderBase.php | 8 ++++---- src/SPC/command/CraftCommand.php | 6 +++--- .../store/pkg/{GoModFrankenphp.php => GoXcaddy.php} | 10 +++++----- src/globals/test-extensions.php | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) rename src/SPC/store/pkg/{GoModFrankenphp.php => GoXcaddy.php} (91%) diff --git a/config/pkg.json b/config/pkg.json index a2ec8a14..e0762cac 100644 --- a/config/pkg.json +++ b/config/pkg.json @@ -43,16 +43,16 @@ "upx-*-win64/upx.exe": "{pkg_root_path}/bin/upx.exe" } }, - "go-mod-frankenphp-x86_64-linux": { + "go-xcaddy-x86_64-linux": { "type": "custom" }, - "go-mod-frankenphp-aarch64-linux": { + "go-xcaddy-aarch64-linux": { "type": "custom" }, - "go-mod-frankenphp-x86_64-macos": { + "go-xcaddy-x86_64-macos": { "type": "custom" }, - "go-mod-frankenphp-aarch64-macos": { + "go-xcaddy-aarch64-macos": { "type": "custom" } } diff --git a/src/SPC/builder/BuilderBase.php b/src/SPC/builder/BuilderBase.php index 956aee6c..88e827c5 100644 --- a/src/SPC/builder/BuilderBase.php +++ b/src/SPC/builder/BuilderBase.php @@ -520,11 +520,11 @@ abstract class BuilderBase if (!in_array(PHP_OS_FAMILY, ['Linux', 'Darwin'])) { throw new WrongUsageException('FrankenPHP SAPI is only available on Linux and macOS!'); } - // frankenphp needs package go-mod-frankenphp installed - $pkg_dir = PKG_ROOT_PATH . '/go-mod-frankenphp-' . arch2gnu(php_uname('m')) . '-' . osfamily2shortname(); + // frankenphp needs package go-xcaddy installed + $pkg_dir = PKG_ROOT_PATH . '/go-xcaddy-' . arch2gnu(php_uname('m')) . '-' . osfamily2shortname(); if (!file_exists("{$pkg_dir}/bin/go") || !file_exists("{$pkg_dir}/bin/xcaddy")) { global $argv; - throw new WrongUsageException("FrankenPHP SAPI requires go-mod-frankenphp package, please install it first: {$argv[0]} install-pkg go-mod-frankenphp"); + throw new WrongUsageException("FrankenPHP SAPI requires the go-xcaddy package, please install it first: {$argv[0]} install-pkg go-xcaddy"); } // frankenphp needs libxml2 lib on macos, see: https://github.com/php/frankenphp/blob/main/frankenphp.go#L17 if (PHP_OS_FAMILY === 'Darwin' && !$this->getLib('libxml2')) { diff --git a/src/SPC/builder/unix/UnixBuilderBase.php b/src/SPC/builder/unix/UnixBuilderBase.php index df3ac3ba..e76dfa86 100644 --- a/src/SPC/builder/unix/UnixBuilderBase.php +++ b/src/SPC/builder/unix/UnixBuilderBase.php @@ -311,7 +311,7 @@ abstract class UnixBuilderBase extends BuilderBase $arch = arch2gnu(php_uname('m')); // define executables for go and xcaddy - $xcaddy_exec = PKG_ROOT_PATH . "/go-mod-frankenphp-{$arch}-{$os}/bin/xcaddy"; + $xcaddy_exec = PKG_ROOT_PATH . "/go-xcaddy-{$arch}-{$os}/bin/xcaddy"; $nobrotli = $this->getLib('brotli') === null ? ',nobrotli' : ''; $nowatcher = $this->getLib('watcher') === null ? ',nowatcher' : ''; @@ -342,9 +342,9 @@ abstract class UnixBuilderBase extends BuilderBase $config = (new SPCConfigUtil($this))->config($this->ext_list, $this->lib_list, with_dependencies: true); $env = [ - 'PATH' => PKG_ROOT_PATH . "/go-mod-frankenphp-{$arch}-{$os}/bin:" . getenv('PATH'), - 'GOROOT' => PKG_ROOT_PATH . "/go-mod-frankenphp-{$arch}-{$os}", - 'GOBIN' => PKG_ROOT_PATH . "/go-mod-frankenphp-{$arch}-{$os}/bin", + 'PATH' => PKG_ROOT_PATH . "/go-xcaddy-{$arch}-{$os}/bin:" . getenv('PATH'), + 'GOROOT' => PKG_ROOT_PATH . "/go-xcaddy-{$arch}-{$os}", + 'GOBIN' => PKG_ROOT_PATH . "/go-xcaddy-{$arch}-{$os}/bin", 'GOPATH' => PKG_ROOT_PATH . '/go', 'CGO_ENABLED' => '1', 'CGO_CFLAGS' => $config['cflags'], diff --git a/src/SPC/command/CraftCommand.php b/src/SPC/command/CraftCommand.php index 744d1c57..c8003a3e 100644 --- a/src/SPC/command/CraftCommand.php +++ b/src/SPC/command/CraftCommand.php @@ -68,10 +68,10 @@ class CraftCommand extends BaseCommand } // install go and xcaddy for frankenphp if (in_array('frankenphp', $craft['sapi'])) { - $retcode = $this->runCommand('install-pkg', 'go-mod-frankenphp'); + $retcode = $this->runCommand('install-pkg', 'go-xcaddy'); if ($retcode !== 0) { - $this->output->writeln('craft go-mod-frankenphp failed'); - $this->log("craft go-mod-frankenphp failed with code: {$retcode}", true); + $this->output->writeln('craft go-xcaddy failed'); + $this->log("craft go-xcaddy failed with code: {$retcode}", true); return static::FAILURE; } } diff --git a/src/SPC/store/pkg/GoModFrankenphp.php b/src/SPC/store/pkg/GoXcaddy.php similarity index 91% rename from src/SPC/store/pkg/GoModFrankenphp.php rename to src/SPC/store/pkg/GoXcaddy.php index e631cc8c..81f51266 100644 --- a/src/SPC/store/pkg/GoModFrankenphp.php +++ b/src/SPC/store/pkg/GoXcaddy.php @@ -9,15 +9,15 @@ use SPC\store\FileSystem; use SPC\store\LockFile; use SPC\util\GlobalEnvManager; -class GoModFrankenphp extends CustomPackage +class GoXcaddy extends CustomPackage { public function getSupportName(): array { return [ - 'go-mod-frankenphp-x86_64-linux', - 'go-mod-frankenphp-x86_64-macos', - 'go-mod-frankenphp-aarch64-linux', - 'go-mod-frankenphp-aarch64-macos', + 'go-xcaddy-x86_64-linux', + 'go-xcaddy-x86_64-macos', + 'go-xcaddy-aarch64-linux', + 'go-xcaddy-aarch64-macos', ]; } diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index db51db5e..8ec7d9ca 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -212,7 +212,7 @@ switch ($argv[1] ?? null) { break; case 'build_embed_cmd': if ($frankenphp) { - passthru("{$prefix}install-pkg go-mod-frankenphp --debug", $retcode); + passthru("{$prefix}install-pkg go-xcaddy --debug", $retcode); if ($retcode !== 0) { break; }