use type=addon and arg-type=none

This commit is contained in:
DubbleClick 2025-08-25 12:57:49 +07:00
parent 1c7fa0132d
commit 324ba0d3dc
5 changed files with 12 additions and 55 deletions

View File

@ -843,7 +843,8 @@
"zlib"
],
"lib-suggests": [
"zstd"
"zstd",
"unixodbc"
],
"ext-depends": [
"openssl",
@ -863,7 +864,7 @@
},
"notes": true,
"type": "addon",
"arg-type": "custom",
"arg-type": "none",
"ext-depends": [
"mysqlnd",
"pdo",
@ -882,7 +883,7 @@
},
"notes": true,
"type": "addon",
"arg-type": "custom",
"arg-type": "none",
"ext-depends": [
"pgsql",
"pdo",
@ -896,7 +897,7 @@
},
"notes": true,
"type": "addon",
"arg-type": "custom",
"arg-type": "none",
"ext-depends": [
"sqlite3",
"pdo",

View File

@ -269,6 +269,9 @@ class Extension
$ret = '';
foreach ($order as $ext) {
if ($ext instanceof self && $ext->isBuildShared()) {
if (Config::getExt($ext->getName(), 'type', false) === 'addon') {
continue;
}
if (Config::getExt($ext->getName(), 'zend-extension', false) === true) {
$ret .= " -d \"zend_extension={$ext->getName()}\"";
} else {
@ -352,6 +355,9 @@ class Extension
*/
public function buildShared(): void
{
if (Config::getExt($this->getName(), 'type') === 'addon') {
return;
}
try {
if (Config::getExt($this->getName(), 'type') === 'builtin' || Config::getExt($this->getName(), 'build-with-php') === true) {
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {

View File

@ -16,20 +16,13 @@ class swoole_hook_mysql extends Extension
return 'swoole';
}
public function getUnixConfigureArg(bool $shared = false): string
{
// pdo_mysql doesn't need to be disabled
// enable swoole-hook-mysql will enable mysqli, pdo, pdo_mysql, we don't need to add any additional options
return '';
}
public function runCliCheckUnix(): void
{
// skip if not enable swoole
if ($this->builder->getExt('swoole') === null) {
return;
}
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $this->getSharedExtensionLoadString() . ' --ri "swoole"', false);
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $this->getSharedExtensionLoadString() . ' --ri "swoole"');
$out = implode('', $out);
if ($ret !== 0) {
throw new ValidationException("extension {$this->getName()} failed compile check: php-cli returned {$ret}", validation_module: 'extension swoole_hook_mysql sanity check');
@ -38,15 +31,4 @@ class swoole_hook_mysql extends Extension
throw new ValidationException('swoole mysql hook is not enabled correctly.', validation_module: 'Extension swoole mysql hook availability check');
}
}
public function getSharedExtensionLoadString(): string
{
$ret = parent::getSharedExtensionLoadString();
return str_replace(' -d "extension=' . $this->name . '"', '', $ret);
}
public function buildShared(): void
{
// nothing to do, it's built into swoole
}
}

View File

@ -25,11 +25,6 @@ class swoole_hook_pgsql extends Extension
}
}
public function getUnixConfigureArg(bool $shared = false): string
{
return ''; // enabled in swoole.php
}
public function runCliCheckUnix(): void
{
// skip if not enable swoole
@ -52,15 +47,4 @@ class swoole_hook_pgsql extends Extension
);
}
}
public function getSharedExtensionLoadString(): string
{
$ret = parent::getSharedExtensionLoadString();
return str_replace(' -d "extension=' . $this->name . '"', '', $ret);
}
public function buildShared(): void
{
// nothing to do, it's built into swoole
}
}

View File

@ -25,11 +25,6 @@ class swoole_hook_sqlite extends Extension
}
}
public function getUnixConfigureArg(bool $shared = false): string
{
return ''; // enabled in swoole.php
}
public function runCliCheckUnix(): void
{
// skip if not enable swoole
@ -46,15 +41,4 @@ class swoole_hook_sqlite extends Extension
throw new ValidationException('swoole sqlite hook is not enabled correctly.', validation_module: 'Extension swoole sqlite hook availability check');
}
}
public function getSharedExtensionLoadString(): string
{
$ret = parent::getSharedExtensionLoadString();
return str_replace(' -d "extension=' . $this->name . '"', '', $ret);
}
public function buildShared(): void
{
// nothing to do, it's built into swoole
}
}