Fix phpunit, add skip extraction arg for SPCConfigUtil new builder

This commit is contained in:
crazywhalecc 2025-04-18 14:50:58 +08:00
parent 720e700701
commit 2da750d5f9
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 15 additions and 12 deletions

View File

@ -173,7 +173,7 @@ abstract class BuilderBase
* @throws \Throwable|WrongUsageException * @throws \Throwable|WrongUsageException
* @internal * @internal
*/ */
public function proveExts(array $static_extensions, array $shared_extensions = [], bool $skip_check_deps = false): void public function proveExts(array $static_extensions, array $shared_extensions = [], bool $skip_check_deps = false, bool $skip_extract = false): void
{ {
CustomExt::loadCustomExt(); CustomExt::loadCustomExt();
// judge ext // judge ext
@ -189,17 +189,20 @@ abstract class BuilderBase
throw new WrongUsageException('Extension [' . $ext . '] does not support shared build!'); throw new WrongUsageException('Extension [' . $ext . '] does not support shared build!');
} }
} }
$this->emitPatchPoint('before-php-extract'); if (!$skip_extract) {
SourceManager::initSource(sources: ['php-src'], source_only: true); $this->emitPatchPoint('before-php-extract');
$this->emitPatchPoint('after-php-extract'); SourceManager::initSource(sources: ['php-src'], source_only: true);
if ($this->getPHPVersionID() >= 80000) { $this->emitPatchPoint('after-php-extract');
$this->emitPatchPoint('before-micro-extract'); if ($this->getPHPVersionID() >= 80000) {
SourceManager::initSource(sources: ['micro'], source_only: true); $this->emitPatchPoint('before-micro-extract');
$this->emitPatchPoint('after-micro-extract'); SourceManager::initSource(sources: ['micro'], source_only: true);
$this->emitPatchPoint('after-micro-extract');
}
$this->emitPatchPoint('before-exts-extract');
SourceManager::initSource(exts: [...$static_extensions, ...$shared_extensions]);
$this->emitPatchPoint('after-exts-extract');
} }
$this->emitPatchPoint('before-exts-extract');
SourceManager::initSource(exts: [...$static_extensions, ...$shared_extensions]);
$this->emitPatchPoint('after-exts-extract');
foreach ([...$static_extensions, ...$shared_extensions] as $extension) { foreach ([...$static_extensions, ...$shared_extensions] as $extension) {
$class = CustomExt::getExtClass($extension); $class = CustomExt::getExtClass($extension);
/** @var Extension $ext */ /** @var Extension $ext */

View File

@ -50,7 +50,7 @@ class SPCConfigUtil
if ($this->builder === null) { if ($this->builder === null) {
$this->builder = BuilderProvider::makeBuilderByInput(new ArgvInput()); $this->builder = BuilderProvider::makeBuilderByInput(new ArgvInput());
$this->builder->proveLibs($libraries); $this->builder->proveLibs($libraries);
$this->builder->proveExts($extensions); $this->builder->proveExts($extensions, skip_extract: true);
} }
ob_get_clean(); ob_get_clean();
$ldflags = $this->getLdflagsString(); $ldflags = $this->getLdflagsString();