Skip to content

Commit 2e89412

Browse files
committed
chore: test php 8.5 vc version
1 parent ca1e729 commit 2e89412

1 file changed

Lines changed: 153 additions & 112 deletions

File tree

.github/workflows/ci.yml

Lines changed: 153 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
push:
66
paths-ignore:
77
- '**.md'
8-
- '**.yaml'
9-
- '**.yml'
8+
# - '**.yaml'
9+
# - '**.yml'
1010

1111
permissions:
1212
contents: write
@@ -15,133 +15,118 @@ env:
1515
EXTENSION_NAME: fluent
1616

1717
jobs:
18-
tests:
19-
runs-on: ubuntu-22.04
20-
strategy:
21-
matrix:
22-
php-version: [ "8.5" ]
23-
clang: [ "16" ]
24-
target: [ "x86_64-unknown-linux-gnu" ]
18+
# tests:
19+
# runs-on: ubuntu-22.04
20+
# strategy:
21+
# matrix:
22+
# php-version: [ "8.5" ]
23+
# clang: [ "16" ]
24+
# target: [ "x86_64-unknown-linux-gnu" ]
2525

26-
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v4
29-
with:
30-
submodules: recursive
26+
# steps:
27+
# - name: Checkout
28+
# uses: actions/checkout@v4
29+
# with:
30+
# submodules: recursive
3131

32-
- name: Cache cargo and LLVM and Clang
33-
id: cache-llvm
34-
uses: actions/cache@v4
35-
with:
36-
path: |
37-
~/.cargo/bin/
38-
~/.cargo/registry/index/
39-
~/.cargo/registry/cache/
40-
~/.cargo/git/db/
41-
target/
42-
${{ runner.temp }}/llvm-${{ matrix.clang }}
43-
key: ${{ matrix.php-version }}-test
44-
45-
- name: Setup LLVM & Clang
46-
id: clang
47-
if: runner.os == 'Linux'
48-
uses: KyleMayes/install-llvm-action@v2
49-
with:
50-
version: ${{ matrix.clang }}
51-
directory: ${{ runner.temp }}/llvm-${{ matrix.clang }}
52-
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
32+
# - name: Cache cargo and LLVM and Clang
33+
# id: cache-llvm
34+
# uses: actions/cache@v4
35+
# with:
36+
# path: |
37+
# ~/.cargo/bin/
38+
# ~/.cargo/registry/index/
39+
# ~/.cargo/registry/cache/
40+
# ~/.cargo/git/db/
41+
# target/
42+
# ${{ runner.temp }}/llvm-${{ matrix.clang }}
43+
# key: ${{ matrix.php-version }}-test
5344

54-
- name: Configure Clang
55-
run: |
56-
echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/lib" >> $GITHUB_ENV
57-
echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
58-
echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/bin/llvm-config" >> $GITHUB_ENV
45+
# - name: Setup LLVM & Clang
46+
# id: clang
47+
# if: runner.os == 'Linux'
48+
# uses: KyleMayes/install-llvm-action@v2
49+
# with:
50+
# version: ${{ matrix.clang }}
51+
# directory: ${{ runner.temp }}/llvm-${{ matrix.clang }}
52+
# cached: ${{ steps.cache-llvm.outputs.cache-hit }}
5953

60-
- uses: shivammathur/setup-php@v2
61-
with:
62-
php-version: ${{ matrix.php-version }}
63-
tools: php-config
54+
# - name: Configure Clang
55+
# run: |
56+
# echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/lib" >> $GITHUB_ENV
57+
# echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
58+
# echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/bin/llvm-config" >> $GITHUB_ENV
6459

65-
- name: Install latest Rust toolchain
66-
run: |
67-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
68-
source $HOME/.cargo/env
69-
rustup default stable
70-
rustup target add ${{ matrix.target }}
60+
# - uses: shivammathur/setup-php@v2
61+
# with:
62+
# php-version: ${{ matrix.php-version }}
63+
# tools: php-config
7164

72-
- name: Build module
73-
run: |
74-
cargo build --target ${{ matrix.target }} --lib
75-
cargo test --target ${{ matrix.target }}
65+
# - name: Install latest Rust toolchain
66+
# run: |
67+
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
68+
# source $HOME/.cargo/env
69+
# rustup default stable
70+
# rustup target add ${{ matrix.target }}
71+
72+
# - name: Build module
73+
# run: |
74+
# cargo build --target ${{ matrix.target }} --lib
75+
# cargo test --target ${{ matrix.target }}
7676

77-
- name: Run PHP Test
78-
run: NO_INTERACTION=1 php run-tests.php -n -d extension=target/${{ matrix.target }}/debug/libfluent.so
77+
# - name: Run PHP Test
78+
# run: NO_INTERACTION=1 php run-tests.php -n -d extension=target/${{ matrix.target }}/debug/libfluent.so
7979

8080
build:
8181
runs-on: ${{ matrix.os }}
82-
needs: tests
82+
# needs: tests
8383
strategy:
84+
fail-fast: false
8485
matrix:
8586
clang: [ "16" ]
86-
php-version: [ "8.2", "8.3", "8.4", "8.5" ]
87-
target: [ x86_64-pc-windows-msvc, aarch64-apple-darwin, x86_64-apple-darwin, x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu ]
88-
phpts: [ "nts", "ts" ]
87+
php-version: [ "8.5" ]
88+
target: [ x86_64-pc-windows-msvc ]
89+
phpts: [ "ts" ]
8990
include:
9091
- { rust_channel: stable }
9192
- { target: x86_64-pc-windows-msvc, rust_channel: nightly }
9293
- { target: x86_64-pc-windows-msvc, os: windows-latest }
93-
- { target: aarch64-apple-darwin, os: macos-latest }
94-
- { target: x86_64-apple-darwin, os: macos-latest }
95-
- { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04 }
96-
- { target: aarch64-unknown-linux-gnu, os: ubuntu-22.04 }
97-
exclude:
98-
- { target: aarch64-apple-darwin, phpts: ts }
99-
- { target: x86_64-apple-darwin, phpts: ts }
100-
- { target: x86_64-unknown-linux-gnu, phpts: ts }
101-
- { target: aarch64-unknown-linux-gnu, phpts: ts }
10294

10395
steps:
10496
- name: Checkout
10597
uses: actions/checkout@v4
10698
with:
10799
submodules: recursive
108100

109-
- name: Cache cargo and LLVM and Clang
110-
id: cache-llvm
111-
uses: actions/cache@v4
101+
- name: Install Rust toolchain
102+
uses: dtolnay/rust-toolchain@master
112103
with:
113-
path: |
114-
~/.cargo/bin/
115-
~/.cargo/registry/index/
116-
~/.cargo/registry/cache/
117-
~/.cargo/git/db/
118-
target/
119-
${{ runner.temp }}/llvm-${{ matrix.clang }}
120-
key: ${{ matrix.php-version }}-test
121-
122-
- name: Setup LLVM & Clang
123-
id: clang
124-
if: runner.os == 'Linux'
125-
uses: KyleMayes/install-llvm-action@v2
126-
with:
127-
version: ${{ matrix.clang }}
128-
directory: ${{ runner.temp }}/llvm-${{ matrix.clang }}
129-
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
104+
toolchain: ${{ matrix.rust_channel }}
105+
targets: ${{ matrix.target }}
130106

131-
- name: Configure Clang
132-
if: runner.os == 'Linux'
133-
run: |
134-
echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/lib" >> $GITHUB_ENV
135-
echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
136-
echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/bin/llvm-config" >> $GITHUB_ENV
107+
# - name: Setup LLVM & Clang
108+
# id: clang
109+
# if: runner.os == 'Linux'
110+
# uses: KyleMayes/install-llvm-action@v2
111+
# with:
112+
# version: ${{ matrix.clang }}
113+
# directory: ${{ runner.temp }}/llvm-${{ matrix.clang }}
114+
# cached: ${{ steps.cache-llvm.outputs.cache-hit }}
137115

138-
- name: Install latest Rust toolchain
139-
run: |
140-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
141-
#source $HOME/.cargo/env
142-
rustup default ${{ matrix.rust_channel }}
143-
rustup target add ${{ matrix.target }}
144-
shell: bash
116+
# - name: Configure Clang
117+
# if: runner.os == 'Linux'
118+
# run: |
119+
# echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/lib" >> $GITHUB_ENV
120+
# echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
121+
# echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/bin/llvm-config" >> $GITHUB_ENV
122+
123+
- name: Cache cargo and build artifacts
124+
uses: Swatinem/rust-cache@v2
125+
with:
126+
key: ${{ matrix.php-version }}-${{ matrix.phpts }}
127+
# TODO: remove this line once php8ts.dll linking is confirmed.
128+
# While debugging the TS/NTS link issue, don't restore a stale target/.
129+
cache-targets: false
145130

146131
- name: Setup PHP with PECL extension
147132
uses: shivammathur/setup-php@v2
@@ -151,18 +136,50 @@ jobs:
151136
env:
152137
phpts: ${{ matrix.phpts }}
153138

154-
- name: OS Specific Configuration - Linux
155-
if: runner.os == 'Linux'
139+
- name: Assert PHP thread safety matches request
140+
if: runner.os == 'Windows'
141+
run: |
142+
php -r "echo PHP_ZTS ? 'TS' : 'NTS';" > ts.txt
143+
set /p ACTUAL=<ts.txt
144+
echo Requested=${{ matrix.phpts }} Actual=%ACTUAL%
145+
if /i "%ACTUAL%"=="NTS" if /i "${{ matrix.phpts }}"=="ts" exit /b 1
146+
shell: cmd
147+
148+
- name: Inspect PHP dev libs
149+
if: runner.os == 'Windows'
156150
run: |
157-
echo "OUTPUT_FILE=lib${{ env.EXTENSION_NAME }}.so" >> $GITHUB_ENV
158-
echo "LIB_EXT=so" >> $GITHUB_ENV
159-
sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross musl-tools musl-dev
151+
echo "=== PHPROOT = $PHPROOT ==="
152+
ls -la "$PHPROOT/dev" || echo "NO dev DIR"
153+
echo "=== .lib files ==="
154+
ls "$PHPROOT/dev"/*.lib 2>/dev/null || echo "NO .lib"
155+
echo "=== which php DLL core exists ==="
156+
ls "$PHPROOT"/php8*.dll
157+
shell: bash
160158

161-
- name: OS Specific Configuration - macOS
162-
if: runner.os == 'macOS'
159+
- name: Point ext-php-rs at the setup-php TS install
160+
if: runner.os == 'Windows'
163161
run: |
164-
echo "OUTPUT_FILE=lib${{ env.EXTENSION_NAME }}.dylib" >> $GITHUB_ENV
165-
echo "LIB_EXT=so" >> $GITHUB_ENV
162+
echo "PHP=$PHPROOT/php.exe" >> $GITHUB_ENV
163+
echo "PHP_LIB=$PHPROOT/dev" >> $GITHUB_ENV
164+
echo "PHP_INCLUDE=$PHPROOT/dev/include" >> $GITHUB_ENV
165+
echo "--- dev dir contents ---"
166+
ls -la "$PHPROOT/dev" || echo "NO dev DIR — setup-php runtime has no headers/libs"
167+
ls "$PHPROOT/dev"/*.lib 2>/dev/null || echo "NO .lib files"
168+
shell: bash
169+
170+
171+
# - name: OS Specific Configuration - Linux
172+
# if: runner.os == 'Linux'
173+
# run: |
174+
# echo "OUTPUT_FILE=lib${{ env.EXTENSION_NAME }}.so" >> $GITHUB_ENV
175+
# echo "LIB_EXT=so" >> $GITHUB_ENV
176+
# sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross musl-tools musl-dev
177+
178+
# - name: OS Specific Configuration - macOS
179+
# if: runner.os == 'macOS'
180+
# run: |
181+
# echo "OUTPUT_FILE=lib${{ env.EXTENSION_NAME }}.dylib" >> $GITHUB_ENV
182+
# echo "LIB_EXT=so" >> $GITHUB_ENV
166183

167184
- name: OS Specific Configuration - Windows
168185
if: runner.os == 'Windows'
@@ -171,9 +188,33 @@ jobs:
171188
echo "LIB_EXT=dll" >> $GITHUB_ENV
172189
shell: bash
173190

191+
- name: Record toolchain versions
192+
if: runner.os == 'Windows'
193+
run: |
194+
rustc -Vv
195+
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property catalog_productDisplayVersion
196+
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationVersion
197+
shell: pwsh
198+
199+
- name: Show what the build sees
200+
if: runner.os == 'Windows'
201+
run: |
202+
echo "PATH php:"; where php
203+
echo "PHP env: $PHP"
204+
echo "PHP_CONFIG env: $PHP_CONFIG"
205+
echo "PHP_LIB env: $PHP_LIB"
206+
echo "RUST_PHP_* :"; env | grep -i php
207+
php -i | grep -iE "Thread Safety|Build|Compiler|Architecture" || true
208+
shell: bash
209+
210+
- name: Build with build-script output
211+
run: |
212+
cargo build --release --target ${{ matrix.target }} --lib -vv 2>&1 | grep -iE "cargo:rustc-link|php8|tsrm|zts|static.tls|TSRMLS" || true
213+
shell: bash
214+
174215
- name: Build module
175216
run: |
176-
cargo build --release --target ${{ matrix.target }} --lib
217+
cargo build --release --target ${{ matrix.target }} --lib -vv
177218
178219
- name: Rename file
179220
run: mv target/${{ matrix.target }}/release/${{ env.OUTPUT_FILE }} target/php${{ matrix.php-version }}-${{ matrix.phpts }}-${{ matrix.target }}-${{ env.EXTENSION_NAME }}.${{ env.LIB_EXT }}

0 commit comments

Comments
 (0)