Skip to content

Commit 4625c6a

Browse files
authored
update default php version to 8.5 (#1058)
2 parents 281b958 + 85b0cd8 commit 4625c6a

File tree

6 files changed

+19
-12
lines changed

6 files changed

+19
-12
lines changed

src/SPC/builder/extension/swoole.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,16 @@ public function getUnixConfigureArg(bool $shared = false): string
5050

5151
// commonly used feature: coroutine-time
5252
$arg .= ' --enable-swoole-coro-time --with-pic';
53+
$arg .= ' --enable-swoole-ssh --enable-swoole-curl';
5354

5455
$arg .= $this->builder->getOption('enable-zts') ? ' --enable-swoole-thread --disable-thread-context' : ' --disable-swoole-thread --enable-thread-context';
5556

56-
// required features: curl, openssl (but curl hook is buggy for php 8.0)
57-
$arg .= $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
58-
$arg .= ' --enable-openssl';
59-
6057
// additional features that only require libraries
6158
$arg .= $this->builder->getLib('libcares') ? ' --enable-cares' : '';
6259
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : '';
6360
$arg .= $this->builder->getLib('nghttp2') ? (' --with-nghttp2-dir=' . BUILD_ROOT_PATH) : '';
6461
$arg .= $this->builder->getLib('zstd') ? ' --enable-zstd' : '';
65-
$arg .= $this->builder->getLib('liburing') ? ' --enable-iouring' : '';
62+
$arg .= $this->builder->getLib('liburing') ? ' --enable-iouring --enable-uring-socket' : '';
6663
$arg .= $this->builder->getExt('sockets') ? ' --enable-sockets' : '';
6764

6865
// enable additional features that require the pdo extension, but conflict with pdo_* extensions
@@ -74,6 +71,7 @@ public function getUnixConfigureArg(bool $shared = false): string
7471
$config = (new SPCConfigUtil($this->builder))->getLibraryConfig($this->builder->getLib('unixodbc'));
7572
$arg .= ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH . ' SWOOLE_ODBC_LIBS="' . $config['libs'] . '"';
7673
}
74+
$arg .= $this->builder->getExt('ftp')?->isBuildStatic() ? ' --disable-swoole-ftp' : ' --enable-swoole-ftp';
7775

7876
if ($this->getExtVersion() >= '6.1.0') {
7977
$arg .= ' --enable-swoole-stdext';

src/SPC/builder/unix/library/unixodbc.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace SPC\builder\unix\library;
66

77
use SPC\exception\WrongUsageException;
8+
use SPC\store\FileSystem;
89
use SPC\util\executor\UnixAutoconfExecutor;
910

1011
trait unixodbc
@@ -30,7 +31,15 @@ protected function build(): void
3031
'--enable-gui=no',
3132
)
3233
->make();
33-
$this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']);
34+
$pkgConfigs = ['odbc.pc', 'odbccr.pc', 'odbcinst.pc'];
35+
$this->patchPkgconfPrefix($pkgConfigs);
36+
foreach ($pkgConfigs as $file) {
37+
FileSystem::replaceFileStr(
38+
BUILD_LIB_PATH . "/pkgconfig/{$file}",
39+
'$(top_build_prefix)libltdl/libltdlc.la',
40+
''
41+
);
42+
}
3443
$this->patchLaDependencyPrefix();
3544
}
3645
}

src/SPC/command/DownloadCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function configure(): void
3030
$this->addArgument('sources', InputArgument::REQUIRED, 'The sources will be compiled, comma separated');
3131
$this->addOption('shallow-clone', null, null, 'Clone shallow');
3232
$this->addOption('with-openssl11', null, null, 'Use openssl 1.1');
33-
$this->addOption('with-php', null, InputOption::VALUE_REQUIRED, 'version in major.minor format (default 8.4)', '8.4');
33+
$this->addOption('with-php', null, InputOption::VALUE_REQUIRED, 'version in major.minor format (default 8.5)', '8.5');
3434
$this->addOption('clean', null, null, 'Clean old download cache and source before fetch');
3535
$this->addOption('all', 'A', null, 'Fetch all sources that static-php-cli needed');
3636
$this->addOption('custom-url', 'U', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Specify custom source download url, e.g "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"');

src/SPC/store/source/PhpSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class PhpSource extends CustomSourceBase
2020

2121
public function fetch(bool $force = false, ?array $config = null, int $lock_as = SPC_DOWNLOAD_SOURCE): void
2222
{
23-
$major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.4';
23+
$major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.5';
2424
if ($major === 'git') {
2525
Downloader::downloadSource('php-src', ['type' => 'git', 'url' => 'https://github.com/php/php-src.git', 'rev' => 'master'], $force);
2626
} else {

src/SPC/util/ConfigValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ public static function validateAndParseCraftFile(mixed $craft_file, Command $com
393393
}
394394
// check php-version
395395
if (isset($craft['php-version'])) {
396-
// validdate version, accept 8.x, 7.x, 8.x.x, 7.x.x, 8, 7
396+
// validate version, accept 8.x, 7.x, 8.x.x, 7.x.x, 8, 7
397397
$version = strval($craft['php-version']);
398398
if (!preg_match('/^(\d+)(\.\d+)?(\.\d+)?$/', $version, $matches)) {
399399
throw new ValidationException('Craft file php-version is invalid');

src/globals/test-extensions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
5252
$extensions = match (PHP_OS_FAMILY) {
53-
'Linux', 'Darwin' => 'grpc',
53+
'Linux', 'Darwin' => 'pdo_odbc',
5454
'Windows' => 'com_dotnet',
5555
};
5656

@@ -74,7 +74,7 @@
7474
// You can use `common`, `bulk`, `minimal` or `none`.
7575
// note: combination is only available for *nix platform. Windows must use `none` combination
7676
$base_combination = match (PHP_OS_FAMILY) {
77-
'Linux', 'Darwin' => 'minimal',
77+
'Linux', 'Darwin' => 'bulk',
7878
'Windows' => 'none',
7979
};
8080

@@ -89,7 +89,7 @@ function _getCombination(string $type = 'common'): string
8989
'common' => 'bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,' .
9090
'mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,' .
9191
'sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip',
92-
'bulk' => 'apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,imap,' .
92+
'bulk' => 'apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,' .
9393
'intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,' .
9494
'posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,swoole,sysvmsg,sysvsem,' .
9595
'sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib',

0 commit comments

Comments
 (0)