From 3f74d585035d444107dfdaacdda80b43be163d99 Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Sat, 30 Aug 2025 14:12:13 +0700 Subject: [PATCH] fix macos, for real this time --- src/SPC/builder/unix/UnixBuilderBase.php | 8 ++------ src/globals/test-extensions.php | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/SPC/builder/unix/UnixBuilderBase.php b/src/SPC/builder/unix/UnixBuilderBase.php index ac9fb631..eaceabd4 100644 --- a/src/SPC/builder/unix/UnixBuilderBase.php +++ b/src/SPC/builder/unix/UnixBuilderBase.php @@ -49,13 +49,9 @@ abstract class UnixBuilderBase extends BuilderBase throw new WrongUsageException('You must build libphp.a before calling this function.'); } - $cmd = (SPCTarget::getTargetOS() === 'Linux') - ? 'nm -g --defined-only -P ' . escapeshellarg($libphp) . ' 2>/dev/null' - : 'nm -gUj ' . escapeshellarg($libphp) . ' 2>/dev/null'; - $out = shell_exec($cmd) ?: ''; - if ($out !== '') { + if ($out = shell_exec('nm -g --defined-only -P ' . escapeshellarg($libphp) . ' 2>/dev/null')) { foreach (preg_split('/\R/', trim($out)) as $line) { - if ($line === '') { + if ($line === '' || str_ends_with($line, '.o:')) { continue; } $name = strtok($line, " \t"); diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 7d117dad..764cfc7d 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -50,13 +50,13 @@ $prefer_pre_built = false; // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'swoole,swoole-hook-mysql,swoole-hook-pgsql,swoole-hook-sqlite,swoole-hook-odbc,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,swoole,sysvmsg,sysvsem,sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib', + 'Linux', 'Darwin' => 'bcmath', 'Windows' => 'bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pdo,pdo_mysql,pdo_sqlite,phar,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip', }; // If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`). $shared_extensions = match (PHP_OS_FAMILY) { - 'Linux' => '', + 'Linux' => 'zip', 'Darwin' => '', 'Windows' => '', };