Skip to content

Commit d0fbc5a

Browse files
committed
Merge branch 'main' into ext/rdkafka
# Conflicts: # src/globals/test-extensions.php
2 parents c840165 + 1bc7bc3 commit d0fbc5a

File tree

110 files changed

+2871
-862
lines changed

Some content is hidden

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

110 files changed

+2871
-862
lines changed

.github/workflows/build-linux-arm.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ on:
1212
version:
1313
required: true
1414
description: php version to compile
15-
default: '8.2'
15+
default: '8.3'
1616
type: choice
1717
options:
18+
- '8.4'
1819
- '8.3'
1920
- '8.2'
2021
- '8.1'

.github/workflows/build-linux-x86_64.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
version:
77
required: true
88
description: php version to compile
9-
default: '8.2'
9+
default: '8.3'
1010
type: choice
1111
options:
12+
- '8.4'
1213
- '8.3'
1314
- '8.2'
1415
- '8.1'

.github/workflows/build-macos-aarch64.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
version:
77
required: true
88
description: php version to compile
9-
default: '8.2'
9+
default: '8.3'
1010
type: choice
1111
options:
12+
- '8.4'
1213
- '8.3'
1314
- '8.2'
1415
- '8.1'

.github/workflows/build-macos-x86_64.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ on:
66
version:
77
required: true
88
description: php version to compile
9-
default: '8.2'
9+
default: '8.3'
1010
type: choice
1111
options:
12+
- '8.4'
1213
- '8.3'
1314
- '8.2'
1415
- '8.1'
15-
- '8.0'
16-
- '7.4'
1716
build-cli:
1817
description: build cli binary
1918
default: true
@@ -35,6 +34,10 @@ on:
3534
debug:
3635
description: enable debug logs
3736
type: boolean
37+
no-strip:
38+
description: keep debug symbols for debugging
39+
type: boolean
40+
default: false
3841

3942
env:
4043
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -80,13 +83,15 @@ jobs:
8083
uses: actions/cache@v4
8184
with:
8285
path: downloads
83-
key: php-${{ env.INPUT_HASH }}
86+
key: php-${{ inputs.version }}-macos-x86_64
8487

8588
# With or without debug
8689
- if: inputs.debug == true
8790
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
8891
- if: inputs.prefer-pre-built == true
8992
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV
93+
- if: inputs.no-strip == true
94+
run: echo "SPC_NO_STRIP=--no-strip" >> $env:GITHUB_ENV
9095

9196
# With target select: cli, micro or both
9297
- if: ${{ inputs.build-cli == true }}
@@ -97,11 +102,10 @@ jobs:
97102
run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
98103

99104
# If there's no dependencies cache, fetch sources, with or without debug
100-
- if: steps.cache-download.outputs.cache-hit != 'true'
101-
run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}
105+
- run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }} --ignore-cache-sources=php-src
102106

103107
# Run build command
104-
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
108+
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_NO_STRIP }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
105109

106110
# Upload cli executable
107111
- if: ${{ inputs.build-cli == true }}

.github/workflows/build-windows-x86_64.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
default: '8.2'
1010
type: choice
1111
options:
12+
- '8.4'
1213
- '8.3'
1314
- '8.2'
1415
- '8.1'
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: "Extension matrix tests"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [ "main" ]
7+
paths:
8+
- '.github/workflows/ext-matrix-tests.yml'
9+
10+
jobs:
11+
test:
12+
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
13+
runs-on: ${{ matrix.operating-system }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
extension:
18+
- amqp
19+
- apcu
20+
- bcmath
21+
- bz2
22+
- calendar
23+
- ctype
24+
- curl
25+
- dba
26+
- dom
27+
- ds
28+
- event
29+
- exif
30+
- filter
31+
- fileinfo
32+
- ftp
33+
- gd
34+
- gettext
35+
- gmp
36+
- iconv
37+
- igbinary
38+
- imagick
39+
- imap
40+
- intl
41+
- ldap
42+
- mbstring,mbregex
43+
- memcache
44+
- mysqli,mysqlnd,pdo_mysql
45+
- opcache
46+
- openssl
47+
- pcntl
48+
- password-argon2
49+
- pcntl
50+
- pdo
51+
- pgsql,pdo_pgsql
52+
- phar
53+
- posix
54+
- rar
55+
- protobuf
56+
- readline
57+
- redis
58+
- session
59+
- shmop
60+
- simdjson
61+
- simplexml,xml
62+
- snappy
63+
- soap
64+
- sockets
65+
- sodium
66+
- sqlite3,pdo_sqlite
67+
- sqlsrv
68+
- ssh2
69+
- swoole
70+
- swoole,swoole-hook-pgsql,swoole-hook-mysql,swoole-hook-sqlite
71+
- swow
72+
- sysvmsg,sysvsem,sysvshm
73+
- tidy
74+
- tokenizer
75+
- uuid
76+
- uv
77+
- xhprof
78+
- xlswriter
79+
- xmlwriter,xmlreader
80+
- xsl
81+
- yac
82+
- yaml
83+
- zip
84+
- zlib
85+
- zstd
86+
php-version:
87+
- "8.4"
88+
operating-system:
89+
- "ubuntu-latest"
90+
#- "macos-13"
91+
#- "debian-arm64-self-hosted"
92+
- "macos-14"
93+
94+
steps:
95+
- name: "Checkout"
96+
uses: "actions/checkout@v4"
97+
98+
- name: OS type
99+
id: os-type
100+
run: |
101+
OS=""
102+
if [ "${{ matrix.operating-system }}" = "ubuntu-latest" ]; then
103+
OS="linux-x86_64"
104+
elif [ "${{ matrix.operating-system }}" = "macos-13" ]; then
105+
OS="macos-x86_64"
106+
elif [ "${{ matrix.operating-system }}" = "debian-arm64-self-hosted" ]; then
107+
OS="linux-aarch64"
108+
elif [ "${{ matrix.operating-system }}" = "macos-14" ]; then
109+
OS="macos-aarch64"
110+
fi
111+
echo "OS=$OS" >> $GITHUB_ENV
112+
113+
- name: "Setup PHP"
114+
uses: shivammathur/setup-php@v2
115+
with:
116+
php-version: 8.2
117+
tools: pecl, composer
118+
extensions: curl, openssl, mbstring
119+
ini-values: memory_limit=-1
120+
env:
121+
phpts: nts
122+
123+
- name: "Install Dependencies"
124+
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
125+
126+
- id: cache-download
127+
uses: actions/cache@v4
128+
with:
129+
path: downloads
130+
key: php-${{ matrix.php-version }}-dependencies-for-tests
131+
132+
# If there's no dependencies cache, fetch sources
133+
- name: "Download sources"
134+
env:
135+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136+
run: ./bin/spc download --with-php=${{ matrix.php-version }} --for-extensions=${{ matrix.extension }} --debug --ignore-cache-sources=php-src
137+
138+
- name: "Build library: ${{ matrix.library }}"
139+
run: |
140+
SPC_USE_SUDO=yes ./bin/spc doctor --auto-fix
141+
if [ "${{ env.OS }}" = "linux-x86_64" ]; then
142+
./bin/spc install-pkg upx
143+
UPX=--with-upx-pack
144+
elif [ "${{ env.OS }}" = "linux-aarch64" ]; then
145+
./bin/spc install-pkg upx
146+
UPX=--with-upx-pack
147+
fi
148+
./bin/spc build --build-cli --build-micro --build-fpm ${{ matrix.extension }} --debug $UPX --with-suggested-libs --with-suggested-exts

.github/workflows/tests.yml

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jobs:
8282
- php: '8.1'
8383
- php: '8.2'
8484
- php: '8.3'
85+
- php: '8.4'
8586

8687
steps:
8788
- name: "Checkout"
@@ -109,24 +110,41 @@ jobs:
109110

110111
- name: "Run PHPUnit Tests"
111112
run: |
112-
vendor/bin/phpunit tests/ --no-coverage
113+
SPC_NO_MUSL_PATH=yes vendor/bin/phpunit tests/ --no-coverage
114+
115+
define-matrix:
116+
name: "Define Matrix"
117+
runs-on: ubuntu-latest
118+
outputs:
119+
php: ${{ steps.gendef.outputs.php }}
120+
os: ${{ steps.gendef.outputs.os }}
121+
steps:
122+
- name: "Checkout"
123+
uses: actions/checkout@v4
124+
125+
- name: "Setup PHP"
126+
uses: shivammathur/setup-php@v2
127+
with:
128+
php-version: 8.2
129+
130+
- name: Define
131+
id: gendef
132+
run: |
133+
PHP_VERSIONS=$(php src/globals/test-extensions.php php)
134+
OS_VERSIONS=$(php src/globals/test-extensions.php os)
135+
echo 'php='"$PHP_VERSIONS" >> "$GITHUB_OUTPUT"
136+
echo 'os='"$OS_VERSIONS" >> "$GITHUB_OUTPUT"
137+
113138
114139
build:
115140
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
116141
runs-on: ${{ matrix.os }}
142+
needs: define-matrix
117143
timeout-minutes: 120
118144
strategy:
119145
matrix:
120-
php:
121-
- "8.0"
122-
- "8.1"
123-
- "8.2"
124-
- "8.3"
125-
os:
126-
- ubuntu-latest
127-
- macos-13
128-
- windows-latest
129-
- macos-14
146+
php: ${{ fromJSON(needs.define-matrix.outputs.php) }}
147+
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
130148
fail-fast: false
131149
steps:
132150
- name: "Checkout"
@@ -139,6 +157,8 @@ jobs:
139157
tools: pecl, composer
140158
extensions: curl, openssl, mbstring
141159
ini-values: memory_limit=-1
160+
env:
161+
phpts: nts
142162

143163
- name: "Cache composer packages"
144164
id: composer-cache
@@ -154,13 +174,13 @@ jobs:
154174
uses: actions/cache@v4
155175
with:
156176
path: downloads
157-
key: php-${{ matrix.php }}-dependencies
177+
key: php-dependencies-${{ matrix.os }}
158178

159179
- name: "Install Dependencies"
160180
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
161181

162182
- name: "Run Build Tests (doctor)"
163-
run: bin/spc doctor --auto-fix
183+
run: bin/spc doctor --auto-fix --debug
164184

165185
- name: "Prepare UPX for Windows"
166186
if: matrix.os == 'windows-latest'
@@ -175,19 +195,11 @@ jobs:
175195
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $GITHUB_ENV
176196
177197
- name: "Run Build Tests (download)"
178-
run: |
179-
bin/spc download --for-extensions="$(php src/globals/test-extensions.php extensions)" --for-libs="$(php src/globals/test-extensions.php libs)" --with-php=${{ matrix.php }} --ignore-cache-sources=php-src --debug --retry=5 --shallow-clone
198+
run: php src/globals/test-extensions.php download_cmd ${{ matrix.os }} ${{ matrix.php }}
180199

181-
- name: "Download pre-built libraries for pkg-config"
182-
if: matrix.os != 'windows-latest'
183-
run: |
184-
bin/spc del-download pkg-config
185-
bin/spc download pkg-config --prefer-pre-built --debug
200+
- name: "Run Build Tests (build)"
201+
run: php src/globals/test-extensions.php build_cmd ${{ matrix.os }} ${{ matrix.php }}
186202

187-
- name: "Run Build Tests (build, *nix)"
203+
- name: "Run Build Tests (build - embed for non-windows)"
188204
if: matrix.os != 'windows-latest'
189-
run: bin/spc build "$(php src/globals/test-extensions.php extensions)" $(php src/globals/test-extensions.php zts) $(php src/globals/test-extensions.php no_strip) $UPX_CMD --with-libs="$(php src/globals/test-extensions.php libs)" --build-cli --build-micro --build-fpm --debug
190-
191-
- name: "Run Build Tests (build, windows)"
192-
if: matrix.os == 'windows-latest'
193-
run: bin/spc build "$(php src/globals/test-extensions.php extensions)" $(php src/globals/test-extensions.php zts) $(php src/globals/test-extensions.php no_strip) $env:UPX_CMD --with-libs="$(php src/globals/test-extensions.php libs)" --build-cli --build-micro --debug
205+
run: php src/globals/test-extensions.php build_embed_cmd ${{ matrix.os }} ${{ matrix.php }}

README-zh.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,18 @@ static-php-cli(简称 `spc`)有许多特性:
8282
>
8383
> :x: 不支持
8484
85-
| PHP Version | Status | Comment |
86-
|-------------|--------------------|------------------------------|
87-
| 7.2 | :x: | |
88-
| 7.3 | :warning: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
89-
| 7.4 | :warning: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
90-
| 8.0 | :heavy_check_mark: | PHP 官方已停止 8.0 的维护 |
91-
| 8.1 | :heavy_check_mark: | PHP 官方仅对 8.1 提供安全更新 |
92-
| 8.2 | :heavy_check_mark: | |
93-
| 8.3 | :heavy_check_mark: | |
94-
| 8.4 | :x: | WIP |
85+
| PHP Version | Status | Comment |
86+
|-------------|--------------------|----------------------------------------------|
87+
| 7.2 | :x: | |
88+
| 7.3 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
89+
| 7.4 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
90+
| 8.0 | :warning: | PHP 官方已停止 8.0 的维护,我们不再处理 8.0 相关的 backport 支持 |
91+
| 8.1 | :heavy_check_mark: | PHP 官方仅对 8.1 提供安全更新 |
92+
| 8.2 | :heavy_check_mark: | |
93+
| 8.3 | :heavy_check_mark: | |
94+
| 8.4 | :heavy_check_mark: | |
95+
96+
> 这个表格的支持状态是 static-php-cli 对构建对应版本的支持情况,不是 PHP 官方对该版本的支持情况。
9597
9698
### 支持的扩展
9799

0 commit comments

Comments
 (0)