extra readline check to make sure -a works

This commit is contained in:
henderkes
2025-10-08 10:45:23 +02:00
parent b9dfb5afe3
commit 330c3486af
2 changed files with 12 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\exception\ValidationException;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
use SPC\util\SPCTarget;
@@ -36,6 +37,15 @@ class readline extends Extension
parent::buildUnixShared();
}
public function runCliCheckUnix(): void
{
parent::runCliCheckUnix();
[$ret, $out] = shell()->execWithResult('printf "exit\n" | ' . BUILD_BIN_PATH . '/php -a');
if ($ret !== 0 || !str_contains(implode("\n", $out), 'Interactive shell')) {
throw new ValidationException("readline extension failed sanity check. Code: {$ret}, output: " . implode("\n", $out));
}
}
public static function patchCliLinux(bool $patch): void
{
if (SPCTarget::getTargetOS() === 'Linux' && SPCTarget::isStatic() && $patch) {