Report why the sanity check for the cli target failed (#605)

This commit is contained in:
Klaas Skelte van der Werf 2025-02-11 03:34:43 +01:00 committed by GitHub
parent 1f281cd376
commit 15af034b34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -143,8 +143,9 @@ abstract class UnixBuilderBase extends BuilderBase
if (($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI) {
logger()->info('running cli sanity check');
[$ret, $output] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "echo \"hello\";"');
if ($ret !== 0 || trim(implode('', $output)) !== 'hello') {
throw new RuntimeException('cli failed sanity check');
$raw_output = implode('', $output);
if ($ret !== 0 || trim($raw_output) !== 'hello') {
throw new RuntimeException("cli failed sanity check: ret[{$ret}]. out[{$raw_output}]");
}
foreach ($this->exts as $ext) {