From 5415ab8ef4bfd5083d02a949b8f1c3e4166d8018 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 20 Mar 2026 14:31:34 +0800 Subject: [PATCH] Fix zlib produced lib file names from different zlib version --- src/SPC/builder/windows/library/zlib.php | 21 ++++++++++++++++++--- src/globals/test-extensions.php | 18 +++++++++--------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/SPC/builder/windows/library/zlib.php b/src/SPC/builder/windows/library/zlib.php index 03fd033b9..e9f960233 100644 --- a/src/SPC/builder/windows/library/zlib.php +++ b/src/SPC/builder/windows/library/zlib.php @@ -31,8 +31,23 @@ protected function build(): void $this->builder->makeSimpleWrapper('cmake'), "--build build --config Release --target install -j{$this->builder->concurrency}" ); - copy(BUILD_LIB_PATH . '\zlibstatic.lib', BUILD_LIB_PATH . '\zlib_a.lib'); - unlink(BUILD_ROOT_PATH . '\bin\zlib.dll'); - unlink(BUILD_LIB_PATH . '\zlib.lib'); + $detect_list = [ + 'zlibstatic.lib', + 'zs.lib', + 'libzs.lib', + ]; + foreach ($detect_list as $item) { + if (file_exists(BUILD_LIB_PATH . '\\' . $item)) { + FileSystem::copy(BUILD_LIB_PATH . '\\' . $item, BUILD_LIB_PATH . '\zlib_a.lib'); + FileSystem::copy(BUILD_LIB_PATH . '\\' . $item, BUILD_LIB_PATH . '\zlibstatic.lib'); + break; + } + } + FileSystem::removeFileIfExists(BUILD_ROOT_PATH . '\bin\zlib.dll'); + FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\zlib.lib'); + FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\libz.dll'); + FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\libz.lib'); + FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\z.lib'); + FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\z.dll'); } } diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 3af2b55d3..8de87d56b 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -13,7 +13,7 @@ // test php version (8.1 ~ 8.4 available, multiple for matrix) $test_php_version = [ - // '8.1', + '8.1', // '8.2', // '8.3', '8.4', @@ -23,15 +23,15 @@ // test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available) $test_os = [ - 'macos-15-intel', // bin/spc for x86_64 - 'macos-15', // bin/spc for arm64 + // 'macos-15-intel', // bin/spc for x86_64 + // 'macos-15', // bin/spc for arm64 // 'ubuntu-latest', // bin/spc-alpine-docker for x86_64 - 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64 - 'ubuntu-24.04', // bin/spc for x86_64 - 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64 - 'ubuntu-24.04-arm', // bin/spc for arm64 + // 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64 + // 'ubuntu-24.04', // bin/spc for x86_64 + // 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64 + // 'ubuntu-24.04-arm', // bin/spc for arm64 // 'windows-2022', // .\bin\spc.ps1 - // 'windows-2025', + 'windows-2025', // .\bin\spc.ps1 ]; // whether enable thread safe @@ -51,7 +51,7 @@ // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { 'Linux', 'Darwin' => 'pdo_odbc', - 'Windows' => 'com_dotnet', + 'Windows' => 'zlib,phar,mbstring,mbregex,sockets', }; // If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).