Skip to content

Commit 3493436

Browse files
authored
Ignore any ini files when sanity check (#609)
1 parent 15af034 commit 3493436

7 files changed

+8
-8
lines changed

src/SPC/builder/Extension.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function runCliCheckUnix(): void
172172
// Run compile check if build target is cli
173173
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
174174
// If check failed, throw RuntimeException
175-
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "' . $this->getDistName() . '"', false);
175+
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "' . $this->getDistName() . '"', false);
176176
if ($ret !== 0) {
177177
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
178178
}
@@ -185,7 +185,7 @@ public function runCliCheckUnix(): void
185185
file_get_contents(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')
186186
);
187187

188-
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "' . trim($test) . '"');
188+
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n -r "' . trim($test) . '"');
189189
if ($ret !== 0) {
190190
if ($this->builder->getOption('debug')) {
191191
var_dump($out);

src/SPC/builder/extension/mbregex.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function getConfigureArg(): string
2626
*/
2727
public function runCliCheckUnix(): void
2828
{
29-
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "mbstring" | grep regex', false);
29+
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "mbstring" | grep regex', false);
3030
if ($ret !== 0) {
3131
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: compiled php-cli mbstring extension does not contain regex !');
3232
}

src/SPC/builder/extension/password_argon2.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function getDistName(): string
1818

1919
public function runCliCheckUnix(): void
2020
{
21-
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "assert(defined(\'PASSWORD_ARGON2I\'));"');
21+
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n -r "assert(defined(\'PASSWORD_ARGON2I\'));"');
2222
if ($ret !== 0) {
2323
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
2424
}

src/SPC/builder/extension/swoole_hook_mysql.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function runCliCheckUnix(): void
2929
if ($this->builder->getExt('swoole') === null) {
3030
return;
3131
}
32-
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "swoole"', false);
32+
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "swoole"', false);
3333
$out = implode('', $out);
3434
if ($ret !== 0) {
3535
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);

src/SPC/builder/extension/swoole_hook_pgsql.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function runCliCheckUnix(): void
3737
if ($this->builder->getExt('swoole') === null) {
3838
return;
3939
}
40-
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "swoole"', false);
40+
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "swoole"', false);
4141
$out = implode('', $out);
4242
if ($ret !== 0) {
4343
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);

src/SPC/builder/extension/swoole_hook_sqlite.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function runCliCheckUnix(): void
3737
if ($this->builder->getExt('swoole') === null) {
3838
return;
3939
}
40-
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "swoole"', false);
40+
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "swoole"', false);
4141
$out = implode('', $out);
4242
if ($ret !== 0) {
4343
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);

src/SPC/builder/unix/UnixBuilderBase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected function sanityCheck(int $build_target): void
142142
// sanity check for php-cli
143143
if (($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI) {
144144
logger()->info('running cli sanity check');
145-
[$ret, $output] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "echo \"hello\";"');
145+
[$ret, $output] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n -r "echo \"hello\";"');
146146
$raw_output = implode('', $output);
147147
if ($ret !== 0 || trim($raw_output) !== 'hello') {
148148
throw new RuntimeException("cli failed sanity check: ret[{$ret}]. out[{$raw_output}]");

0 commit comments

Comments
 (0)