From 823b26fbb9711e0b4439489e09fd6ba40a21e16d Mon Sep 17 00:00:00 2001 From: henderkes Date: Mon, 16 Feb 2026 13:33:47 +0700 Subject: [PATCH] patch frankenphp build for new xcaddy release --- src/SPC/builder/unix/UnixBuilderBase.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/unix/UnixBuilderBase.php b/src/SPC/builder/unix/UnixBuilderBase.php index 464c9b2f..8ac4f9e3 100644 --- a/src/SPC/builder/unix/UnixBuilderBase.php +++ b/src/SPC/builder/unix/UnixBuilderBase.php @@ -411,10 +411,17 @@ abstract class UnixBuilderBase extends BuilderBase $nowatcher = $this->getLib('watcher') === null ? ',nowatcher' : ''; $xcaddyModules = getenv('SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES'); $frankenphpSourceDir = getenv('FRANKENPHP_SOURCE_PATH') ?: SOURCE_PATH . '/frankenphp'; + FileSystem::replaceFileStr( + $frankenphpSourceDir . '/caddy/php-server.go', + 'config, _, err := caddycmd.LoadConfig', + 'config, _, _, err := caddycmd.LoadConfig' + ); $xcaddyModules = preg_replace('#--with github.com/dunglas/frankenphp\S*#', '', $xcaddyModules); $xcaddyModules = "--with github.com/dunglas/frankenphp={$frankenphpSourceDir} " . - "--with github.com/dunglas/frankenphp/caddy={$frankenphpSourceDir}/caddy {$xcaddyModules}"; + "--with github.com/dunglas/frankenphp/caddy={$frankenphpSourceDir}/caddy " . + "--with github.com/caddyserver/caddy/v2=github.com/henderkes/caddy/v2@master " . + "{$xcaddyModules}"; if ($this->getLib('brotli') === null && str_contains($xcaddyModules, '--with github.com/dunglas/caddy-cbrotli')) { logger()->warning('caddy-cbrotli module is enabled, but brotli library is not built. Disabling caddy-cbrotli.'); $xcaddyModules = str_replace('--with github.com/dunglas/caddy-cbrotli', '', $xcaddyModules);