Skip to content

Commit cb6ec3c

Browse files
committed
chore: wip
1 parent decd44a commit cb6ec3c

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

.github/workflows/precompile-php.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,12 @@ jobs:
240240
fi
241241
;;
242242
"laravel-sqlite")
243-
EXTENSIONS="--enable-cli --enable-fpm --enable-mbstring --enable-opcache --enable-intl --enable-exif --enable-bcmath --with-pdo-sqlite --with-sqlite3 --with-curl --with-openssl --enable-gd --with-zip --with-readline --with-libxml --with-zlib"
243+
# For PHP 8.1, disable intl extension to avoid ICU4C C++17 issues
244+
if [[ "${{ matrix.php_version }}" == 8.1* ]]; then
245+
EXTENSIONS="--enable-cli --enable-fpm --enable-mbstring --enable-opcache --enable-exif --enable-bcmath --with-pdo-sqlite --with-sqlite3 --with-curl --with-openssl --enable-gd --with-zip --with-readline --with-libxml --with-zlib"
246+
else
247+
EXTENSIONS="--enable-cli --enable-fpm --enable-mbstring --enable-opcache --enable-intl --enable-exif --enable-bcmath --with-pdo-sqlite --with-sqlite3 --with-curl --with-openssl --enable-gd --with-zip --with-readline --with-libxml --with-zlib"
248+
fi
244249
;;
245250
"api-only")
246251
EXTENSIONS="--enable-cli --enable-fpm --enable-mbstring --enable-opcache --enable-bcmath --with-pdo-mysql --with-mysqli --with-curl --with-openssl --with-zip --with-libxml --with-zlib"
@@ -425,9 +430,9 @@ jobs:
425430
export CXXFLAGS="-std=c++17 -stdlib=libc++"
426431
echo "Using C++17 for PHP ${{ matrix.php_version }}"
427432
elif [[ "$PHP_MAJOR_VERSION" -eq 8 && "$PHP_MINOR_VERSION" -eq 1 ]]; then
428-
# PHP 8.1 uses C++14 for configure (PHP requirement), C++17 for build (ICU4C requirement)
433+
# PHP 8.1 configure step requires C++14, but build step will need C++17 for ICU4C
429434
export CXXFLAGS="-std=c++14 -stdlib=libc++"
430-
echo "Using C++14 for PHP ${{ matrix.php_version }} (configure step)"
435+
echo "Using C++14 for PHP ${{ matrix.php_version }} (configure step only)"
431436
else
432437
# Earlier PHP versions can use C++14
433438
export CXXFLAGS="-std=c++14 -stdlib=libc++"
@@ -463,10 +468,21 @@ jobs:
463468
echo "C++17 support test failed before configure"
464469
rm -f test_cpp.cpp test_cpp
465470
fi
471+
elif [[ "$PHP_MAJOR_VERSION" -eq 8 && "$PHP_MINOR_VERSION" -eq 1 ]]; then
472+
echo "Testing C++14 support before configure (PHP 8.1 configure step):"
473+
echo '#include <type_traits>' > test_cpp.cpp
474+
echo 'int main() { typename std::enable_if<true, int>::type x = 0; return x; }' >> test_cpp.cpp
475+
if clang++ -std=c++14 -stdlib=libc++ test_cpp.cpp -o test_cpp 2>/dev/null; then
476+
echo "C++14 support confirmed before configure"
477+
rm -f test_cpp.cpp test_cpp
478+
else
479+
echo "C++14 support test failed before configure"
480+
rm -f test_cpp.cpp test_cpp
481+
fi
466482
else
467483
echo "Testing C++14 support before configure:"
468484
echo '#include <type_traits>' > test_cpp.cpp
469-
echo 'int main() { std::enable_if_t<true, int> x = 0; return x; }' >> test_cpp.cpp
485+
echo 'int main() { typename std::enable_if<true, int>::type x = 0; return x; }' >> test_cpp.cpp
470486
if clang++ -std=c++14 -stdlib=libc++ test_cpp.cpp -o test_cpp 2>/dev/null; then
471487
echo "C++14 support confirmed before configure"
472488
rm -f test_cpp.cpp test_cpp
@@ -706,7 +722,7 @@ jobs:
706722
else
707723
echo "Testing C++14 support:"
708724
echo '#include <type_traits>' > test_cpp.cpp
709-
echo 'int main() { std::enable_if_t<true, int> x = 0; return x; }' >> test_cpp.cpp
725+
echo 'int main() { typename std::enable_if<true, int>::type x = 0; return x; }' >> test_cpp.cpp
710726
if clang++ -std=c++14 -stdlib=libc++ test_cpp.cpp -o test_cpp 2>/dev/null; then
711727
echo "C++14 support confirmed"
712728
rm -f test_cpp.cpp test_cpp

0 commit comments

Comments
 (0)