Skip to content

Commit 16fccf8

Browse files
committed
Merge remote-tracking branch 'origin/sapi/frankenphp' into sapi/frankenphp
2 parents 804468f + 7dc3b7c commit 16fccf8

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

.github/pull_request_template.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
88
> If a modification is not involved, please skip it directly.
99
10-
- [ ] If you modified `*.php`, run `composer cs-fix` at local machine.
11-
- [ ] If it's an extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`.
12-
- [ ] If you changed the behavior of static-php-cli, update docs in `./docs/`.
13-
- [ ] If you updated `config/xxx.json` content, run `bin/spc dev:sort-config xxx`.
10+
- If you modified `*.php` or `*.json`, run them locally to ensure your changes are valid:
11+
- [ ] `PHP_CS_FIXER_IGNORE_ENV=1 composer cs-fix`
12+
- [ ] `composer analyse`
13+
- [ ] `composer test`
14+
- [ ] `bin/spc dev:sort-config`
15+
- If it's an extension or dependency update, please ensure the following:
16+
- [ ] Add your test combination to `src/globals/test-extensions.php`.
17+
- [ ] If adding new or fixing bugs, add commit message containing `extension test` or `test extensions` to trigger full test suite.

.github/workflows/ext-matrix-tests.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
name: "Extension matrix tests"
1+
name: "Extension Matrix Tests"
22

33
on:
44
workflow_dispatch:
5-
pull_request:
6-
branches: [ "main" ]
7-
paths:
8-
- '.github/workflows/ext-matrix-tests.yml'
5+
push:
96

107
jobs:
118
test:
129
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
1310
runs-on: ${{ matrix.operating-system }}
11+
if: contains(github.event.head_commit.message, 'extension test') || contains(github.event.head_commit.message, 'test extensions')
1412
strategy:
1513
fail-fast: false
1614
matrix:

config/env.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ CXX=${SPC_LINUX_DEFAULT_CXX}
7171
AR=${SPC_LINUX_DEFAULT_AR}
7272
LD=ld.gold
7373
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
74-
SPC_DEFAULT_C_FLAGS="-fpic -Os"
75-
SPC_DEFAULT_CXX_FLAGS="-fpic -Os"
74+
SPC_DEFAULT_C_FLAGS="-fPIC -Os"
75+
SPC_DEFAULT_CXX_FLAGS="-fPIC -Os"
7676
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
7777
SPC_EXTRA_LIBS=
7878
; upx executable path
@@ -92,15 +92,15 @@ SPC_CMD_VAR_PHP_EMBED_TYPE="static"
9292

9393
; *** default build vars for building php ***
9494
; CFLAGS for configuring php
95-
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fpie"
95+
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fPIE"
9696
; CPPFLAGS for configuring php
9797
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
9898
; LDFLAGS for configuring php
9999
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
100100
; LIBS for configuring php
101101
SPC_CMD_VAR_PHP_CONFIGURE_LIBS="-ldl -lpthread -lm"
102102
; EXTRA_CFLAGS for `make` php
103-
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fpie ${SPC_DEFAULT_C_FLAGS}"
103+
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE ${SPC_DEFAULT_C_FLAGS}"
104104
; EXTRA_LIBS for `make` php
105105
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm"
106106
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so

docs/deps-craft-yml.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ build-options:
4242
# Set micro SAPI as win32 mode, without this, micro SAPI will be compiled as a console application (only for Windows, default: false)
4343
enable-micro-win32: false
4444

45+
# Build options for shared extensions (list or comma-separated are both accepted)
46+
shared-extensions: [ ]
47+
4548
# Download options
4649
download-options:
4750
# Use custom url for specified sources, format: "{source-name}:{url}" (e.g. "php-src:https://example.com/php-8.4.0.tar.gz")

src/SPC/command/CraftCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function handle(): int
4949
}
5050

5151
$static_extensions = implode(',', $craft['extensions']);
52-
$shared_extensions = implode(',', $craft['shared-extensions']);
52+
$shared_extensions = implode(',', $craft['shared-extensions'] ?? []);
5353
$libs = implode(',', $craft['libs']);
5454

5555
// init log

src/SPC/util/ConfigValidator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ public static function validateAndParseCraftFile(mixed $craft_file, Command $com
164164
if (is_string($craft['extensions'])) {
165165
$craft['extensions'] = array_filter(array_map(fn ($x) => trim($x), explode(',', $craft['extensions'])));
166166
}
167+
if (!isset($craft['shared-extensions'])) {
168+
$craft['shared-extensions'] = [];
169+
}
170+
if (is_string($craft['shared-extensions'] ?? [])) {
171+
$craft['shared-extensions'] = array_filter(array_map(fn ($x) => trim($x), explode(',', $craft['shared-extensions'])));
172+
}
167173
// check libs
168174
if (isset($craft['libs']) && is_string($craft['libs'])) {
169175
$craft['libs'] = array_filter(array_map(fn ($x) => trim($x), explode(',', $craft['libs'])));

0 commit comments

Comments
 (0)