Skip to content

Commit

Permalink
Report why the sanity check for the cli target failed (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframe98 authored Feb 11, 2025
1 parent 1f281cd commit 15af034
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SPC/builder/unix/UnixBuilderBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ protected function sanityCheck(int $build_target): void
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) {
Expand Down

0 comments on commit 15af034

Please sign in to comment.