mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 15:25:41 +08:00
Fix wrongly constructed class
This commit is contained in:
6
.github/workflows/tests.yml
vendored
6
.github/workflows/tests.yml
vendored
@@ -265,9 +265,9 @@ jobs:
|
||||
./bin/spc doctor --auto-fix
|
||||
${{ matrix.combo.build-args }} --dl-with-php=${{ matrix.combo.php-version }}
|
||||
|
||||
- name: Setup upterm session
|
||||
if: ${{ failure() }}
|
||||
uses: owenthereal/action-upterm@v1
|
||||
# - name: Setup upterm session
|
||||
# if: ${{ failure() }}
|
||||
# uses: owenthereal/action-upterm@v1
|
||||
|
||||
- name: Upload logs
|
||||
if: always() && hashFiles('log/**') != ''
|
||||
|
||||
@@ -169,18 +169,18 @@ trait unix
|
||||
#[BeforeStage('php', [self::class, 'makeForUnix'], 'php')]
|
||||
#[PatchDescription('Patch Makefile to fix //lib path for Linux builds')]
|
||||
#[PatchDescription('Patch BUILD_CC to disable auto-vectorization when zig-cc is used (prevents minilua segfault)')]
|
||||
public function tryPatchMakefileUnix(ToolchainInterface $toolchain): void
|
||||
public function tryPatchMakefileUnix(TargetPackage $package, ToolchainInterface $toolchain): void
|
||||
{
|
||||
if (SystemTarget::getTargetOS() !== 'Linux') {
|
||||
return;
|
||||
}
|
||||
|
||||
// replace //lib with /lib in Makefile
|
||||
shell()->cd(SOURCE_PATH . '/php-src')->exec('sed -i "s|//lib|/lib|g" Makefile');
|
||||
shell()->cd($package->getSourceDir())->exec('sed -i "s|//lib|/lib|g" Makefile');
|
||||
|
||||
// try to fix minilua with zig-cc, disable vectorize for some edge cases
|
||||
if ($toolchain instanceof ZigToolchain) {
|
||||
$makefile = "{$this->getSourceDir()}/Makefile";
|
||||
$makefile = "{$package->getSourceDir()}/Makefile";
|
||||
FileSystem::replaceFileRegex($makefile, '/^(BUILD_CC\s*=\s*zig-cc)\s*$/m', '$1 -fno-vectorize -fno-slp-vectorize');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,6 +499,10 @@ class PackageLoader
|
||||
throw new RegistryException('Package name must not be empty when no package context is available for BeforeStage attribute.');
|
||||
}
|
||||
$package_name = $method_instance->package_name === '' ? $pkg->getName() : $method_instance->package_name;
|
||||
|
||||
if ($instance_class instanceof Package && isset(self::$packages[$package_name])) {
|
||||
$instance_class = self::$packages[$package_name];
|
||||
}
|
||||
$conditionals = array_map(
|
||||
fn (\ReflectionAttribute $a) => $a->newInstance()->class,
|
||||
[...$method->getDeclaringClass()->getAttributes(ConditionalOn::class), ...$method->getAttributes(ConditionalOn::class)],
|
||||
@@ -529,6 +533,11 @@ class PackageLoader
|
||||
throw new RegistryException('Package name must not be empty when no package context is available for AfterStage attribute.');
|
||||
}
|
||||
$package_name = $method_instance->package_name === '' ? $pkg->getName() : $method_instance->package_name;
|
||||
|
||||
if ($instance_class instanceof Package && isset(self::$packages[$package_name])) {
|
||||
$instance_class = self::$packages[$package_name];
|
||||
}
|
||||
|
||||
$conditionals = array_map(
|
||||
fn (\ReflectionAttribute $a) => $a->newInstance()->class,
|
||||
[...$method->getDeclaringClass()->getAttributes(ConditionalOn::class), ...$method->getAttributes(ConditionalOn::class)],
|
||||
|
||||
Reference in New Issue
Block a user