Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5a6a333
Export php binary debug symbols for mac, linux and windows
crazywhalecc Oct 31, 2025
9738fcd
Update env.ini docs
crazywhalecc Oct 31, 2025
5e3e7ec
Update version to 2.7.7
crazywhalecc Oct 31, 2025
757af25
Suggestions
crazywhalecc Oct 31, 2025
f5d93d2
Merge branch 'main' into feat/no-strip
crazywhalecc Nov 6, 2025
f09c18e
Use separated deploy functions
crazywhalecc Nov 6, 2025
8c8cb70
phpstan fix
crazywhalecc Nov 6, 2025
a45f314
Remove for pure test
crazywhalecc Nov 6, 2025
f6b0914
Fix missing debug link and debug option
crazywhalecc Nov 6, 2025
f4b03ae
Introduce standalone DirDiff util class
crazywhalecc Nov 9, 2025
987ad4b
Use diff to detect and deploy-patch new shared extensions that built …
crazywhalecc Nov 9, 2025
9edb941
add --with-frankenphp-app option to embed an app
henderkes Sep 5, 2025
081e2d2
fix debugflags being backwards
henderkes Oct 28, 2025
fd2b7af
make --with-frankenphp-app=dir work with docker scripts
henderkes Nov 7, 2025
c911289
update freetype download to get latest version
henderkes Nov 8, 2025
541889d
update to rc4
henderkes Nov 9, 2025
64079d9
simplify regex
henderkes Nov 9, 2025
cff6ec1
Remove escape backslashes
crazywhalecc Nov 10, 2025
00050f4
Merge branch 'main' into feat/no-strip
henderkes Nov 11, 2025
09073c5
sort config and remove lonesome configure cflags
henderkes Nov 11, 2025
e2b80e7
update building of frankenphp
henderkes Nov 11, 2025
ee906aa
Merge remote-tracking branch 'origin/feat/no-strip' into frankenphp/mbed
henderkes Nov 11, 2025
8e4d4b7
suggestion
henderkes Nov 11, 2025
23c0d6f
simplify deployBinary a little bit
henderkes Nov 12, 2025
dc83282
remove SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS, use eu-strip (#966)
henderkes Nov 12, 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
51 changes: 24 additions & 27 deletions config/env.ini
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; static-php-cli (spc) env configuration
;
; This file is used to set default env vars for static-php-cli build.
; As dynamic build process, some of these vars can be overwritten by CLI options.
; And you can also overwrite these vars by setting them in your shell environment.
; The value should be changed only if you know what you are doing. Otherwise, please leave them as default.
;
; We need to use some pre-defined internal env vars, like `BUILD_ROOT_PATH`, `DOWNLOAD_PATH`, etc.
; Please note that these vars cannot be defined in this file, they are only be defined before static-php-cli running.
; Please note that these vars cannot be defined in this file, they should only be defined before static-php-cli running.
;
; Here's a list of env vars, these value cannot be changed anywhere:
; Here's a list of env vars, these variables will be defined if not defined:
;
; SPC_VERSION: the version of static-php-cli.
; WORKING_DIR: the working directory of the build process. (default: `$(pwd)`)
; ROOT_DIR: the root directory of static-php-cli. (default: `/path/to/static-php-cli`, when running in phar or micro mode: `phar://path/to/spc.phar`)
; BUILD_ROOT_PATH: the root path of the build process. (default: `$(pwd)/buildroot`)
; BUILD_INCLUDE_PATH: the path of the include files. (default: `$BUILD_ROOT_PATH/include`)
; BUILD_LIB_PATH: the path of the lib files. (default: `$BUILD_ROOT_PATH/lib`)
; BUILD_BIN_PATH: the path of the bin files. (default: `$BUILD_ROOT_PATH/bin`)
; PKG_ROOT_PATH: the root path of the package files. (default: `$(pwd)/pkgroot`)
; BUILD_MODULES_PATH: the path of the php modules (shared extensions) files. (default: `$BUILD_ROOT_PATH/modules`)
; PKG_ROOT_PATH: the root path of the package files. (default: `$(pwd)/pkgroot/$GNU_ARCH-{darwin|linux|windows}`)
; SOURCE_PATH: the path of the source files. (default: `$(pwd)/source`)
; DOWNLOAD_PATH: the path of the download files. (default: `$(pwd)/downloads`)
; CPU_COUNT: the count of the CPU cores. (default: `$(nproc)`)
; SPC_ARCH: the arch of the current system, for some libraries needed `--host=XXX` args. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`, `arm64`)
; GNU_ARCH: the GNU arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`)
; MAC_ARCH: the MAC arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `arm64`)
; PATH: (*nix only) static-php-cli will add `$BUILD_BIN_PATH` to PATH.
; PKG_CONFIG_PATH: (*nix only) static-php-cli will set `$BUILD_LIB_PATH/pkgconfig` to PKG_CONFIG_PATH.
;
; * These vars are only be defined in Unix (macOS, Linux, FreeBSD)Builder and cannot be changed anywhere:
; PATH: static-php-cli will add `$BUILD_BIN_PATH` to PATH.
; PKG_CONFIG: static-php-cli will set `$BUILD_BIN_PATH/pkg-config` to PKG_CONFIG.
; PKG_CONFIG_PATH: static-php-cli will set `$BUILD_LIB_PATH/pkgconfig` to PKG_CONFIG_PATH.
; Here's a list of env vars, these variables is defined in SPC and cannot be changed anywhere:
;
; * These vars are only be defined in LinuxBuilder and cannot be changed anywhere:
; SPC_LINUX_DEFAULT_CC: the default compiler for linux. (For alpine linux: `gcc`, default: `$GNU_ARCH-linux-musl-gcc`)
; SPC_LINUX_DEFAULT_CXX: the default c++ compiler for linux. (For alpine linux: `g++`, default: `$GNU_ARCH-linux-musl-g++`)
; SPC_LINUX_DEFAULT_AR: the default archiver for linux. (For alpine linux: `ar`, default: `$GNU_ARCH-linux-musl-ar`)
; SPC_EXTRA_PHP_VARS: the extra vars for building php, used in `configure` and `make` command.
; SPC_VERSION: the version of static-php-cli.
; WORKING_DIR: the working directory of the build process. (default: `$(pwd)`)
; ROOT_DIR: the root directory of static-php-cli. (default: `/path/to/static-php-cli`, when running in phar or micro mode: `phar://path/to/spc.phar`)
; CPU_COUNT: the count of the CPU cores. (default: `$(nproc)`)
; SPC_ARCH: the arch of the current system, for some libraries needed `--host=XXX` args. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`, `arm64`)
; GNU_ARCH: the GNU arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`)
; MAC_ARCH: the MAC arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `arm64`)
; PKG_CONFIG: (*nix only) static-php-cli will set `$BUILD_BIN_PATH/pkg-config` to PKG_CONFIG.
; SPC_LINUX_DEFAULT_CC: (linux only) the default compiler for linux. (For alpine linux: `gcc`, default: `$GNU_ARCH-linux-musl-gcc`)
; SPC_LINUX_DEFAULT_CXX: (linux only) the default c++ compiler for linux. (For alpine linux: `g++`, default: `$GNU_ARCH-linux-musl-g++`)
; SPC_LINUX_DEFAULT_AR: (linux only) the default archiver for linux. (For alpine linux: `ar`, default: `$GNU_ARCH-linux-musl-ar`)
; SPC_EXTRA_PHP_VARS: (linux only) the extra vars for building php, used in `configure` and `make` command.

[global]
; Build concurrency for make -jN, default is CPU_COUNT, this value are used in every libs.
Expand Down Expand Up @@ -109,9 +110,7 @@ SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --disable
; *** default build vars for building php ***
; embed type for php, static (libphp.a) or shared (libphp.so)
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
; CFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fPIE"
; EXTRA_CFLAGS for `make` php
; EXTRA_CFLAGS for `configure` and `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE ${SPC_DEFAULT_C_FLAGS}"
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
Expand Down Expand Up @@ -141,10 +140,8 @@ SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-
; *** default build vars for building php ***
; embed type for php, static (libphp.a) or shared (libphp.dylib)
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
; CFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -Werror=unknown-warning-option"
; EXTRA_CFLAGS for `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie ${SPC_DEFAULT_C_FLAGS}"
; EXTRA_CFLAGS for `configure` and `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Werror=unknown-warning-option ${SPC_DEFAULT_C_FLAGS}"

[freebsd]
; compiler environments
Expand Down
7 changes: 6 additions & 1 deletion config/lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"lib-depends-macos": [
"lib-base",
"micro",
"libxml2"
"libxml2",
"frankenphp"
],
"lib-suggests-linux": [
"libacl",
Expand All @@ -25,6 +26,10 @@
"watcher"
]
},
"frankenphp": {
"source": "frankenphp",
"type": "target"
},
"micro": {
"type": "target",
"source": "micro"
Expand Down
10 changes: 10 additions & 0 deletions config/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,16 @@
"path": "LICENSE.MIT"
}
},
"frankenphp": {
"type": "ghtar",
"repo": "php/frankenphp",
"prefer-stable": true,
"provide-pre-built": false,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"freetype": {
"type": "ghtagtar",
"repo": "freetype/freetype",
Expand Down
2 changes: 1 addition & 1 deletion src/SPC/ConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
final class ConsoleApplication extends Application
{
public const string VERSION = '2.7.6';
public const string VERSION = '2.7.7';

public function __construct()
{
Expand Down
10 changes: 10 additions & 0 deletions src/SPC/builder/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace SPC\builder;

use SPC\builder\unix\UnixBuilderBase;
use SPC\exception\EnvironmentException;
use SPC\exception\SPCException;
use SPC\exception\ValidationException;
Expand Down Expand Up @@ -448,6 +449,15 @@ public function buildUnixShared(): void
->exec('make clean')
->exec('make -j' . $this->builder->concurrency)
->exec('make install');

// process *.so file
$soFile = BUILD_MODULES_PATH . '/' . $this->getName() . '.so';
if (!file_exists($soFile)) {
throw new ValidationException("extension {$this->getName()} build failed: {$soFile} not found", validation_module: "Extension {$this->getName()} build");
}
/** @var UnixBuilderBase $builder */
$builder = $this->builder;
$builder->deployBinary($soFile, $soFile, false);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/SPC/builder/freebsd/BSDBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected function buildCli(): void
if (!$this->getOption('no-strip', false)) {
$shell->exec('strip sapi/cli/php');
}
$this->deployBinary(BUILD_TARGET_CLI);
$this->deploySAPIBinary(BUILD_TARGET_CLI);
}

/**
Expand Down Expand Up @@ -184,7 +184,7 @@ protected function buildMicro(): void
if (!$this->getOption('no-strip', false)) {
shell()->cd(SOURCE_PATH . '/php-src/sapi/micro')->exec('strip --strip-unneeded micro.sfx');
}
$this->deployBinary(BUILD_TARGET_MICRO);
$this->deploySAPIBinary(BUILD_TARGET_MICRO);

if ($this->phar_patched) {
SourcePatcher::unpatchMicroPhar();
Expand All @@ -206,7 +206,7 @@ protected function buildFpm(): void
if (!$this->getOption('no-strip', false)) {
$shell->exec('strip sapi/fpm/php-fpm');
}
$this->deployBinary(BUILD_TARGET_FPM);
$this->deploySAPIBinary(BUILD_TARGET_FPM);
}

/**
Expand Down
Loading