mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
more concise message
This commit is contained in:
parent
54001ab868
commit
1be353fd13
@ -235,8 +235,10 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
$lens .= ' -static';
|
$lens .= ' -static';
|
||||||
}
|
}
|
||||||
$dynamic_exports = '';
|
$dynamic_exports = '';
|
||||||
|
$embedType = 'static';
|
||||||
// if someone changed to EMBED_TYPE=shared, we need to add LD_LIBRARY_PATH
|
// if someone changed to EMBED_TYPE=shared, we need to add LD_LIBRARY_PATH
|
||||||
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {
|
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {
|
||||||
|
$embedType = 'shared';
|
||||||
if (PHP_OS_FAMILY === 'Darwin') {
|
if (PHP_OS_FAMILY === 'Darwin') {
|
||||||
$ext_path = 'DYLD_LIBRARY_PATH=' . BUILD_LIB_PATH . ':$DYLD_LIBRARY_PATH ';
|
$ext_path = 'DYLD_LIBRARY_PATH=' . BUILD_LIB_PATH . ':$DYLD_LIBRARY_PATH ';
|
||||||
} else {
|
} else {
|
||||||
@ -255,18 +257,19 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$cc = getenv('CC');
|
$cc = getenv('CC');
|
||||||
|
|
||||||
[$ret, $out] = shell()->cd($sample_file_path)->execWithResult("{$cc} -o embed embed.c {$lens} {$dynamic_exports}");
|
[$ret, $out] = shell()->cd($sample_file_path)->execWithResult("{$cc} -o embed embed.c {$lens} {$dynamic_exports}");
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
throw new ValidationException(
|
throw new ValidationException(
|
||||||
'embed failed sanity check: build failed. Error message: ' . implode("\n", $out),
|
'embed failed to build. Error message: ' . implode("\n", $out),
|
||||||
validation_module: 'static libphp.a sanity check'
|
validation_module: $embedType . 'libphp embed build sanity check'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
[$ret, $output] = shell()->cd($sample_file_path)->execWithResult($ext_path . './embed');
|
[$ret, $output] = shell()->cd($sample_file_path)->execWithResult($ext_path . './embed');
|
||||||
if ($ret !== 0 || trim(implode('', $output)) !== 'hello') {
|
if ($ret !== 0 || trim(implode('', $output)) !== 'hello') {
|
||||||
throw new ValidationException(
|
throw new ValidationException(
|
||||||
'embed failed sanity check: run failed. Error message: ' . implode("\n", $output),
|
'embed failed to run. Error message: ' . implode("\n", $output),
|
||||||
validation_module: 'static libphp.a sanity check'
|
validation_module: $embedType . ' libphp embed run sanity check'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user