Skip to content

Commit 6860538

Browse files
authored
Merge branch 'crazywhalecc:main' into aft-main
2 parents b246e58 + e85cd55 commit 6860538

61 files changed

Lines changed: 962 additions & 147 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-unix.yml

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ on:
2929
description: Extensions to build (comma separated)
3030
required: true
3131
type: string
32+
shared-extensions:
33+
description: Shared extensions to build (optional, comma separated)
34+
type: string
3235
extra-libs:
3336
description: Extra libraries to build (optional, comma separated)
3437
type: string
@@ -42,10 +45,22 @@ on:
4245
build-fpm:
4346
description: Build fpm binary
4447
type: boolean
48+
build-frankenphp:
49+
description: Build frankenphp binary (requires ZTS)
50+
type: boolean
51+
default: false
52+
enable-zts:
53+
description: Enable ZTS
54+
type: boolean
55+
default: false
4556
prefer-pre-built:
4657
description: Prefer pre-built binaries (reduce build time)
4758
type: boolean
4859
default: true
60+
with-suggested-libs:
61+
description: Build with suggested libs
62+
type: boolean
63+
default: false
4964
debug:
5065
description: Show full build logs
5166
type: boolean
@@ -69,6 +84,9 @@ on:
6984
description: Extensions to build (comma separated)
7085
required: true
7186
type: string
87+
shared-extensions:
88+
description: Shared extensions to build (optional, comma separated)
89+
type: string
7290
extra-libs:
7391
description: Extra libraries to build (optional, comma separated)
7492
type: string
@@ -82,10 +100,22 @@ on:
82100
build-fpm:
83101
description: Build fpm binary
84102
type: boolean
103+
build-frankenphp:
104+
description: Build frankenphp binary (requires ZTS)
105+
type: boolean
106+
default: false
107+
enable-zts:
108+
description: Enable ZTS
109+
type: boolean
110+
default: false
85111
prefer-pre-built:
86112
description: Prefer pre-built binaries (reduce build time)
87113
type: boolean
88114
default: true
115+
with-suggested-libs:
116+
description: Include suggested libs
117+
type: boolean
118+
default: false
89119
debug:
90120
description: Show full build logs
91121
type: boolean
@@ -144,8 +174,19 @@ jobs:
144174
RUNS_ON="macos-15"
145175
;;
146176
esac
147-
DOWN_CMD="$DOWN_CMD --with-php=${{ inputs.php-version }} --for-extensions=${{ inputs.extensions }} --ignore-cache-sources=php-src"
148-
BUILD_CMD="$BUILD_CMD ${{ inputs.extensions }}"
177+
STATIC_EXTS="${{ inputs.extensions }}"
178+
SHARED_EXTS="${{ inputs['shared-extensions'] }}"
179+
BUILD_FRANKENPHP="${{ inputs['build-frankenphp'] }}"
180+
ENABLE_ZTS="${{ inputs['enable-zts'] }}"
181+
ALL_EXTS="$STATIC_EXTS"
182+
if [ -n "$SHARED_EXTS" ]; then
183+
ALL_EXTS="$ALL_EXTS,$SHARED_EXTS"
184+
fi
185+
DOWN_CMD="$DOWN_CMD --with-php=${{ inputs.php-version }} --for-extensions=$ALL_EXTS --ignore-cache-sources=php-src"
186+
BUILD_CMD="$BUILD_CMD $STATIC_EXTS"
187+
if [ -n "$SHARED_EXTS" ]; then
188+
BUILD_CMD="$BUILD_CMD --build-shared=$SHARED_EXTS"
189+
fi
149190
if [ -n "${{ inputs.extra-libs }}" ]; then
150191
DOWN_CMD="$DOWN_CMD --for-libs=${{ inputs.extra-libs }}"
151192
BUILD_CMD="$BUILD_CMD --with-libs=${{ inputs.extra-libs }}"
@@ -157,6 +198,9 @@ jobs:
157198
if [ ${{ inputs.prefer-pre-built }} == true ]; then
158199
DOWN_CMD="$DOWN_CMD --prefer-pre-built"
159200
fi
201+
if [ ${{ inputs.with-suggested-libs }} == true ]; then
202+
BUILD_CMD="$BUILD_CMD --with-suggested-libs"
203+
fi
160204
if [ ${{ inputs.build-cli }} == true ]; then
161205
BUILD_CMD="$BUILD_CMD --build-cli"
162206
fi
@@ -166,6 +210,12 @@ jobs:
166210
if [ ${{ inputs.build-fpm }} == true ]; then
167211
BUILD_CMD="$BUILD_CMD --build-fpm"
168212
fi
213+
if [ "$BUILD_FRANKENPHP" = "true" ]; then
214+
BUILD_CMD="$BUILD_CMD --build-frankenphp"
215+
fi
216+
if [ "$ENABLE_ZTS" = "true" ]; then
217+
BUILD_CMD="$BUILD_CMD --enable-zts"
218+
fi
169219
echo 'download='"$DOWN_CMD" >> "$GITHUB_OUTPUT"
170220
echo 'build='"$BUILD_CMD" >> "$GITHUB_OUTPUT"
171221
echo 'run='"$RUNS_ON" >> "$GITHUB_OUTPUT"
@@ -188,6 +238,27 @@ jobs:
188238
env:
189239
phpts: nts
190240

241+
- if: ${{ inputs['build-frankenphp'] == true }}
242+
name: "Install go-xcaddy for FrankenPHP"
243+
run: |
244+
case "${{ inputs.os }}" in
245+
linux-x86_64|linux-aarch64)
246+
./bin/spc-alpine-docker install-pkg go-xcaddy
247+
;;
248+
linux-x86_64-glibc|linux-aarch64-glibc)
249+
./bin/spc-gnu-docker install-pkg go-xcaddy
250+
;;
251+
macos-x86_64|macos-aarch64)
252+
composer update --no-dev --classmap-authoritative
253+
./bin/spc doctor --auto-fix
254+
./bin/spc install-pkg go-xcaddy
255+
;;
256+
*)
257+
echo "Unsupported OS for go-xcaddy install: ${{ inputs.os }}"
258+
exit 1
259+
;;
260+
esac
261+
191262
# Cache downloaded source
192263
- id: cache-download
193264
uses: actions/cache@v4
@@ -202,6 +273,14 @@ jobs:
202273
# if: ${{ failure() }}
203274
# uses: mxschmitt/action-tmate@v3
204275

276+
# Upload debug logs
277+
- if: ${{ inputs.debug && failure() }}
278+
name: "Upload build logs on failure"
279+
uses: actions/upload-artifact@v4
280+
with:
281+
name: spc-logs-${{ inputs.php-version }}-${{ inputs.os }}
282+
path: log/*.log
283+
205284
# Upload cli executable
206285
- if: ${{ inputs.build-cli == true }}
207286
name: "Upload PHP cli SAPI"
@@ -226,7 +305,22 @@ jobs:
226305
name: php-fpm-${{ inputs.php-version }}-${{ inputs.os }}
227306
path: buildroot/bin/php-fpm
228307

308+
# Upload frankenphp executable
309+
- if: ${{ inputs['build-frankenphp'] == true }}
310+
name: "Upload FrankenPHP SAPI"
311+
uses: actions/upload-artifact@v4
312+
with:
313+
name: php-frankenphp-${{ inputs.php-version }}-${{ inputs.os }}
314+
path: buildroot/bin/frankenphp
315+
229316
# Upload extensions metadata
317+
- if: ${{ inputs['shared-extensions'] != '' }}
318+
name: "Upload shared extensions"
319+
uses: actions/upload-artifact@v4
320+
with:
321+
name: php-shared-ext-${{ inputs.php-version }}-${{ inputs.os }}
322+
path: |
323+
buildroot/modules/*.so
230324
- uses: actions/upload-artifact@v4
231325
name: "Upload License Files"
232326
with:

config/env.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-
148148
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
149149
; EXTRA_CFLAGS for `configure` and `make` php
150150
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Werror=unknown-warning-option ${SPC_DEFAULT_C_FLAGS}"
151+
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
152+
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
151153
; minimum compatible macOS version (LLVM vars, availability not guaranteed)
152154
MACOSX_DEPLOYMENT_TARGET=12.0
153155

config/ext.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
],
6464
"ext-depends-windows": [
6565
"zlib",
66-
"openssl"
66+
"openssl",
67+
"brotli"
6768
]
6869
},
6970
"dba": {
@@ -73,6 +74,19 @@
7374
"qdbm"
7475
]
7576
},
77+
"decimal": {
78+
"type": "external",
79+
"source": "ext-decimal",
80+
"arg-type": "custom",
81+
"lib-depends": [
82+
"libmpdec"
83+
]
84+
},
85+
"deepclone": {
86+
"type": "external",
87+
"source": "deepclone",
88+
"arg-type": "enable"
89+
},
7690
"dio": {
7791
"support": {
7892
"BSD": "wip"
@@ -252,6 +266,7 @@
252266
"arg-type-unix": "enable-path",
253267
"cpp-extension": true,
254268
"lib-depends": [
269+
"grpc",
255270
"zlib",
256271
"openssl",
257272
"libcares"

config/lib.json

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@
109109
"krb5"
110110
],
111111
"lib-suggests-windows": [
112-
"brotli",
113-
"zstd"
112+
"brotli"
114113
],
115114
"frameworks": [
116115
"CoreFoundation",
@@ -143,9 +142,7 @@
143142
"zlib"
144143
],
145144
"lib-suggests": [
146-
"libpng",
147-
"bzip2",
148-
"brotli"
145+
"libpng"
149146
]
150147
},
151148
"gettext": {
@@ -355,6 +352,9 @@
355352
"static-libs-unix": [
356353
"libaom.a"
357354
],
355+
"static-libs-windows": [
356+
"aom.lib"
357+
],
358358
"cpp-library": true
359359
},
360360
"libargon2": {
@@ -373,6 +373,15 @@
373373
],
374374
"static-libs-windows": [
375375
"avif.lib"
376+
],
377+
"lib-depends": [
378+
"libaom"
379+
],
380+
"lib-suggests": [
381+
"libwebp",
382+
"libjpeg",
383+
"libxml2",
384+
"libpng"
376385
]
377386
},
378387
"libcares": {
@@ -484,7 +493,7 @@
484493
"static-libs-windows": [
485494
"libjpeg_a.lib"
486495
],
487-
"lib-suggests-windows": [
496+
"lib-depends": [
488497
"zlib"
489498
]
490499
},
@@ -519,6 +528,18 @@
519528
"maxminddb_config.h"
520529
]
521530
},
531+
"libmpdec": {
532+
"source": "libmpdec",
533+
"static-libs-unix": [
534+
"libmpdec.a"
535+
],
536+
"static-libs-windows": [
537+
"libmpdec_a.lib"
538+
],
539+
"headers": [
540+
"mpdecimal.h"
541+
]
542+
},
522543
"libmemcached": {
523544
"source": "libmemcached",
524545
"cpp-library": true,
@@ -753,7 +774,6 @@
753774
"xz"
754775
],
755776
"lib-suggests-windows": [
756-
"zstd",
757777
"openssl"
758778
]
759779
},
@@ -853,6 +873,9 @@
853873
},
854874
"openssl": {
855875
"source": "openssl",
876+
"pkg-configs": [
877+
"openssl"
878+
],
856879
"static-libs-unix": [
857880
"libssl.a",
858881
"libcrypto.a"
@@ -965,6 +988,11 @@
965988
},
966989
"unixodbc": {
967990
"source": "unixodbc",
991+
"pkg-configs": [
992+
"odbc",
993+
"odbccr",
994+
"odbcinst"
995+
],
968996
"static-libs-unix": [
969997
"libodbc.a",
970998
"libodbccr.a",
@@ -982,6 +1010,9 @@
9821010
],
9831011
"headers": [
9841012
"wtr/watcher-c.h"
1013+
],
1014+
"frameworks": [
1015+
"CoreServices"
9851016
]
9861017
},
9871018
"xz": {
@@ -1006,6 +1037,9 @@
10061037
},
10071038
"zlib": {
10081039
"source": "zlib",
1040+
"pkg-configs": [
1041+
"zlib"
1042+
],
10091043
"static-libs-unix": [
10101044
"libz.a"
10111045
],
@@ -1019,6 +1053,9 @@
10191053
},
10201054
"zstd": {
10211055
"source": "zstd",
1056+
"pkg-configs": [
1057+
"libzstd"
1058+
],
10221059
"static-libs-unix": [
10231060
"libzstd.a"
10241061
],

0 commit comments

Comments
 (0)