Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1468bb9
Add commit tests
crazywhalecc Jun 13, 2025
45ec0ce
Add checkout
crazywhalecc Jun 13, 2025
3a0d21e
Support multi-line
crazywhalecc Jun 13, 2025
fe455bf
Fix shared-extensions as optional
crazywhalecc Jun 13, 2025
6253b7a
Next pr, I won't run
crazywhalecc Jun 13, 2025
e5cd3ad
Next pr, I won't run
crazywhalecc Jun 13, 2025
0e88cdb
Add shared extension parser
crazywhalecc Jun 14, 2025
3a64fee
Change test strategy for commit tests
crazywhalecc Jun 18, 2025
68548cf
Wrap it to test test test
crazywhalecc Jun 18, 2025
2bfc8e9
Test test
crazywhalecc Jun 18, 2025
cb0a90d
Add source hash comparator & refactor download lock
crazywhalecc Jun 14, 2025
57b2278
Define env in phpunit.xml
crazywhalecc Jun 16, 2025
5cb107b
Test test
crazywhalecc Jun 18, 2025
7057a13
Trigger extension test
crazywhalecc Jun 18, 2025
7178308
Use new trigger test message
crazywhalecc Jun 18, 2025
c1870af
add frankenphp sapi
henderkes Jun 18, 2025
f64eb0d
build for bsd and macos too
henderkes Jun 18, 2025
c1e6832
cs fix
henderkes Jun 18, 2025
92338d4
don't bake the rpath in, otherwise we might run into issues when load…
henderkes Jun 18, 2025
c46f851
watcher...
henderkes Jun 18, 2025
abf3bfb
suggest watcher
henderkes Jun 18, 2025
dca43d6
nicer escaping
henderkes Jun 18, 2025
d635b10
specify system gcc to build xcaddy in spc-gnu-docker
henderkes Jun 18, 2025
d094824
--with github.com/dunglas/caddy-cbrotli requires brotli
henderkes Jun 18, 2025
e71f762
support building static frankenphp
henderkes Jun 18, 2025
f37c863
only needed on linux
henderkes Jun 18, 2025
d58534b
add support for frankenphp directory from file system, instead of pul…
henderkes Jun 18, 2025
82ee6f0
allow specifying if we want to build embed shared or static
henderkes Jun 18, 2025
a1e76d9
remove watcher suggestion
henderkes Jun 18, 2025
8c6a708
ah, the infamous arm64 bug with -fpic vs -fPIC
henderkes Jun 18, 2025
04cefda
Merge pull request #774 from crazywhalecc/fix/arm64-musl
henderkes Jun 18, 2025
b4168d0
Add test extensions as trigger
crazywhalecc Jun 18, 2025
f7a3f80
Add test extensions as trigger
crazywhalecc Jun 18, 2025
24e19de
Merge pull request #768 from crazywhalecc/ci/commit-tests
crazywhalecc Jun 18, 2025
f10ba86
add extension test for frankenphp
henderkes Jun 18, 2025
65b828c
embed version information
henderkes Jun 18, 2025
eee2ff6
don't embed minor version when loading libphp.so
henderkes Jun 18, 2025
ae56931
Remove go download from doctor
crazywhalecc Jun 18, 2025
8e2dffc
Add frankenphp sapi embed build at build command, not constant
crazywhalecc Jun 18, 2025
f709f3b
Add custom package downloader and extractor
crazywhalecc Jun 18, 2025
92284e9
Refactor go and frankenphp downloads and builds
crazywhalecc Jun 18, 2025
d6858e1
phpstan fix
crazywhalecc Jun 18, 2025
74b1dda
Fix test-extensions.php
crazywhalecc Jun 18, 2025
4ecaffd
Fix test-extensions.php
crazywhalecc Jun 18, 2025
becee5b
Use version instead of -v
crazywhalecc Jun 18, 2025
a76f49f
Remove libxml2 requirement for linux
crazywhalecc Jun 18, 2025
1a164fa
Merge pull request #775 from crazywhalecc/sapi/frankenphp-prerequisites
henderkes Jun 19, 2025
15979d4
fix double path
henderkes Jun 19, 2025
cb010d8
there's no documented functionality to download without building - xc…
henderkes Jun 19, 2025
b42409e
LD_LIBRARY_PATH for frankenphp sanity check
henderkes Jun 19, 2025
7dc3b7c
Merge remote-tracking branch 'origin/main' into sapi/frankenphp
crazywhalecc Jun 19, 2025
804468f
refactor common exec code out
henderkes Jun 19, 2025
16fccf8
Merge remote-tracking branch 'origin/sapi/frankenphp' into sapi/frank…
henderkes Jun 19, 2025
6e70f16
Merge remote-tracking branch 'origin/docs' into sapi/frankenphp
henderkes Jun 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
> If a modification is not involved, please skip it directly.

- [ ] If you modified `*.php`, run `composer cs-fix` at local machine.
- [ ] If it's an extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`.
- [ ] If you changed the behavior of static-php-cli, update docs in `./docs/`.
- [ ] If you updated `config/xxx.json` content, run `bin/spc dev:sort-config xxx`.
- If you modified `*.php` or `*.json`, run them locally to ensure your changes are valid:
- [ ] `PHP_CS_FIXER_IGNORE_ENV=1 composer cs-fix`
- [ ] `composer analyse`
- [ ] `composer test`
- [ ] `bin/spc dev:sort-config`
- If it's an extension or dependency update, please ensure the following:
- [ ] Add your test combination to `src/globals/test-extensions.php`.
- [ ] If adding new or fixing bugs, add commit message containing `extension test` or `test extensions` to trigger full test suite.
8 changes: 3 additions & 5 deletions .github/workflows/ext-matrix-tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: "Extension matrix tests"
name: "Extension Matrix Tests"

on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/ext-matrix-tests.yml'
push:

jobs:
test:
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
runs-on: ${{ matrix.operating-system }}
if: contains(github.event.head_commit.message, 'extension test') || contains(github.event.head_commit.message, 'test extensions')
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion bin/spc-gnu-docker
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ENV PATH="/app/bin:/cmake/bin:$PATH"
ENV SPC_LIBC=glibc

ADD ./config/env.ini /app/config/env.ini
RUN bin/spc doctor --auto-fix --debug
RUN CC=gcc bin/spc doctor --auto-fix --debug

RUN curl -o make.tgz -fsSL https://ftp.gnu.org/gnu/make/make-4.4.tar.gz && \
tar -zxvf make.tgz && \
Expand Down
11 changes: 7 additions & 4 deletions config/env.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ SPC_CONCURRENCY=${CPU_COUNT}
SPC_SKIP_PHP_VERSION_CHECK="no"
; Ignore some check item for bin/spc doctor command, comma separated (e.g. SPC_SKIP_DOCTOR_CHECK_ITEMS="if homebrew has installed")
SPC_SKIP_DOCTOR_CHECK_ITEMS=""
; extra modules that xcaddy will include in the FrankenPHP build
SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES="--with github.com/dunglas/frankenphp/caddy --with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain/caddy --with github.com/dunglas/caddy-cbrotli"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these modules required all the time? If so, it would be better to add them as dependencies directly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are used in the official frankenphp build, so I set it as an overridable option.

I personally build without vulcain but with caddy cache and supervisor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(also, again, can't download them earlier as it's part of xcaddy's process)


; EXTENSION_DIR where the built php will look for extension when a .ini instructs to load them
; only useful for builds targeting not pure-static linking
; default paths
Expand All @@ -68,8 +71,8 @@ CXX=${SPC_LINUX_DEFAULT_CXX}
AR=${SPC_LINUX_DEFAULT_AR}
LD=ld.gold
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
SPC_DEFAULT_C_FLAGS="-fpic -Os"
SPC_DEFAULT_CXX_FLAGS="-fpic -Os"
SPC_DEFAULT_C_FLAGS="-fPIC -Os"
SPC_DEFAULT_CXX_FLAGS="-fPIC -Os"
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
SPC_EXTRA_LIBS=
; upx executable path
Expand All @@ -89,15 +92,15 @@ SPC_CMD_VAR_PHP_EMBED_TYPE="static"

; *** default build vars for building php ***
; CFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fpie"
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fPIE"
; CPPFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
; LDFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
; LIBS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_LIBS="-ldl -lpthread -lm"
; EXTRA_CFLAGS for `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fpie ${SPC_DEFAULT_C_FLAGS}"
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE ${SPC_DEFAULT_C_FLAGS}"
; EXTRA_LIBS for `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm"
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
Expand Down
12 changes: 12 additions & 0 deletions config/pkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,17 @@
"extract-files": {
"upx-*-win64/upx.exe": "{pkg_root_path}/bin/upx.exe"
}
},
"go-mod-frankenphp-x86_64-linux": {
"type": "custom"
},
"go-mod-frankenphp-aarch64-linux": {
"type": "custom"
},
"go-mod-frankenphp-x86_64-macos": {
"type": "custom"
},
"go-mod-frankenphp-aarch64-macos": {
"type": "custom"
}
}
3 changes: 3 additions & 0 deletions docs/deps-craft-yml.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ build-options:
# Set micro SAPI as win32 mode, without this, micro SAPI will be compiled as a console application (only for Windows, default: false)
enable-micro-win32: false

# Build options for shared extensions (list or comma-separated are both accepted)
shared-extensions: [ ]

# Download options
download-options:
# Use custom url for specified sources, format: "{source-name}:{url}" (e.g. "php-src:https://example.com/php-8.4.0.tar.gz")
Expand Down
23 changes: 23 additions & 0 deletions src/SPC/builder/BuilderBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ public function getBuildTypeName(int $type): string
if (($type & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED) {
$ls[] = 'embed';
}
if (($type & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP) {
$ls[] = 'frankenphp';
}
return implode(', ', $ls);
}

Expand Down Expand Up @@ -507,6 +510,26 @@ public function emitPatchPoint(string $point_name): void
}
}

public function checkBeforeBuildPHP(int $rule): void
{
if (($rule & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP) {
// frankenphp only support linux and macOS
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();
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");
}
// frankenphp needs libxml2 libs
if (PHP_OS_FAMILY === 'Darwin' && !$this->getLib('libxml2')) {
throw new WrongUsageException('FrankenPHP SAPI for macOS requires libxml2 library, please include `xml` extension in your build.');
}
}
}

/**
* Generate micro extension test php code.
*/
Expand Down
5 changes: 5 additions & 0 deletions src/SPC/builder/freebsd/BSDBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
$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;
$enableFrankenphp = ($build_target & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP;

shell()->cd(SOURCE_PATH . '/php-src')
->exec(
Expand Down Expand Up @@ -143,6 +144,10 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
}
$this->buildEmbed();
}
if ($enableFrankenphp) {
logger()->info('building frankenphp');
$this->buildFrankenphp();
}
}

public function testPHP(int $build_target = BUILD_TARGET_NONE)
Expand Down
33 changes: 19 additions & 14 deletions src/SPC/builder/linux/LinuxBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
$config_file_scan_dir = $this->getOption('with-config-file-scan-dir', false) ?
('--with-config-file-scan-dir=' . $this->getOption('with-config-file-scan-dir') . ' ') : '';

$enable_cli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI;
$enable_fpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM;
$enable_micro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO;
$enable_embed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED;
$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;
$enableFrankenphp = ($build_target & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP;

$mimallocLibs = $this->getLib('mimalloc') !== null ? BUILD_LIB_PATH . '/mimalloc.o ' : '';
// prepare build php envs
Expand All @@ -125,7 +126,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
]);

// process micro upx patch if micro sapi enabled
if ($enable_micro) {
if ($enableMicro) {
if (version_compare($this->getMicroVersion(), '0.2.0') < 0) {
// for phpmicro 0.1.x
$this->processMicroUPXLegacy();
Expand All @@ -137,10 +138,10 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
shell()->cd(SOURCE_PATH . '/php-src')
->exec(
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
($enable_cli ? '--enable-cli ' : '--disable-cli ') .
($enable_fpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
($enable_embed ? "--enable-embed={$embed_type} " : '--disable-embed ') .
($enable_micro ? '--enable-micro=all-static ' : '--disable-micro ') .
($enableCli ? '--enable-cli ' : '--disable-cli ') .
($enableFpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
($enableEmbed ? "--enable-embed={$embed_type} " : '--disable-embed ') .
($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') .
$config_file_path .
$config_file_scan_dir .
$disable_jit .
Expand All @@ -156,25 +157,29 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void

$this->cleanMake();

if ($enable_cli) {
if ($enableCli) {
logger()->info('building cli');
$this->buildCli();
}
if ($enable_fpm) {
if ($enableFpm) {
logger()->info('building fpm');
$this->buildFpm();
}
if ($enable_micro) {
if ($enableMicro) {
logger()->info('building micro');
$this->buildMicro();
}
if ($enable_embed) {
if ($enableEmbed) {
logger()->info('building embed');
if ($enable_micro) {
if ($enableMicro) {
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/Makefile', 'OVERALL_TARGET =', 'OVERALL_TARGET = libphp.la');
}
$this->buildEmbed();
}
if ($enableFrankenphp) {
logger()->info('building frankenphp');
$this->buildFrankenphp();
}
}

public function testPHP(int $build_target = BUILD_TARGET_NONE)
Expand Down
5 changes: 5 additions & 0 deletions src/SPC/builder/macos/MacOSBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
$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;
$enableFrankenphp = ($build_target & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP;

// prepare build php envs
$mimallocLibs = $this->getLib('mimalloc') !== null ? BUILD_LIB_PATH . '/mimalloc.o ' : '';
Expand Down Expand Up @@ -180,6 +181,10 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
}
$this->buildEmbed();
}
if ($enableFrankenphp) {
logger()->info('building frankenphp');
$this->buildFrankenphp();
}
}

public function testPHP(int $build_target = BUILD_TARGET_NONE)
Expand Down
76 changes: 76 additions & 0 deletions src/SPC/builder/unix/UnixBuilderBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
use SPC\store\Config;
use SPC\store\Downloader;
use SPC\store\FileSystem;
use SPC\util\DependencyUtil;
use SPC\util\SPCConfigUtil;
Expand Down Expand Up @@ -218,6 +219,21 @@ protected function sanityCheck(int $build_target): void
throw new RuntimeException('embed failed sanity check: run failed. Error message: ' . implode("\n", $output));
}
}

// sanity check for frankenphp
if (($build_target & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP) {
logger()->info('running frankenphp sanity check');
$frankenphp = BUILD_BIN_PATH . '/frankenphp';
if (!file_exists($frankenphp)) {
throw new RuntimeException('FrankenPHP binary not found: ' . $frankenphp);
}
[$ret, $output] = shell()
->setEnv(['LD_LIBRARY_PATH' => BUILD_LIB_PATH])
->execWithResult("{$frankenphp} version");
if ($ret !== 0 || !str_contains(implode('', $output), 'FrankenPHP')) {
throw new RuntimeException('FrankenPHP failed sanity check: ret[' . $ret . ']. out[' . implode('', $output) . ']');
}
}
}

/**
Expand Down Expand Up @@ -277,4 +293,64 @@ protected function patchPhpScripts(): void
FileSystem::writeFile(BUILD_BIN_PATH . '/php-config', $php_config_str);
}
}

/**
* @throws WrongUsageException
* @throws RuntimeException
*/
protected function buildFrankenphp(): void
{
$os = match (PHP_OS_FAMILY) {
'Linux' => 'linux',
'Windows' => 'win',
'Darwin' => 'macos',
'BSD' => 'freebsd',
default => throw new RuntimeException('Unsupported OS: ' . PHP_OS_FAMILY),
};
$arch = arch2gnu(php_uname('m'));

// define executables for go and xcaddy
$xcaddy_exec = PKG_ROOT_PATH . "/go-mod-frankenphp-{$arch}-{$os}/bin/xcaddy";

$nobrotli = $this->getLib('brotli') === null ? ',nobrotli' : '';
$nowatcher = $this->getLib('watcher') === null ? ',nowatcher' : '';
$xcaddyModules = getenv('SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES');
// make it possible to build from a different frankenphp directory!
if (!str_contains($xcaddyModules, '--with github.com/dunglas/frankenphp')) {
$xcaddyModules = '--with github.com/dunglas/frankenphp ' . $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);
}
$lrt = PHP_OS_FAMILY === 'Linux' ? '-lrt' : '';
$releaseInfo = json_decode(Downloader::curlExec('https://api.github.com/repos/php/frankenphp/releases/latest'), true);
$frankenPhpVersion = $releaseInfo['tag_name'];
$libphpVersion = $this->getPHPVersion();
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {
$libphpVersion = preg_replace('/\.\d$/', '', $libphpVersion);
}
$debugFlags = $this->getOption('--with-debug') ? "'-w -s' " : '';

$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",
'GOPATH' => PKG_ROOT_PATH . '/go',
'CGO_ENABLED' => '1',
'CGO_CFLAGS' => $config['cflags'],
'CGO_LDFLAGS' => "{$config['ldflags']} {$config['libs']} {$lrt}",
'XCADDY_GO_BUILD_FLAGS' => '-buildmode=pie ' .
'-ldflags \"-linkmode=external -extldflags \'-pie\' ' . $debugFlags .
'-X \'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ' .
"{$frankenPhpVersion} PHP {$libphpVersion} Caddy'\\\" " .
"-tags=nobadger,nomysql,nopgx{$nobrotli}{$nowatcher}",
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
];
shell()->cd(BUILD_BIN_PATH)
->setEnv($env)
->exec("{$xcaddy_exec} build --output frankenphp {$xcaddyModules}");
}
}
Loading