File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -205,17 +205,19 @@ protected function sanityCheck(int $build_target): void
205205 if (PHP_OS_FAMILY === 'Linux ' && getenv ('SPC_LIBC ' ) === 'musl ' ) {
206206 $ lens .= ' -static ' ;
207207 }
208- [$ ret , $ out ] = shell ()->cd ($ sample_file_path )->execWithResult (getenv ('CC ' ) . ' -o embed embed.c ' . $ lens );
209- if ($ ret !== 0 ) {
210- throw new RuntimeException ('embed failed sanity check: build failed. Error message: ' . implode ("\n" , $ out ));
211- }
212208 // if someone changed to EMBED_TYPE=shared, we need to add LD_LIBRARY_PATH
213209 if (getenv ('SPC_CMD_VAR_PHP_EMBED_TYPE ' ) === 'shared ' ) {
214210 $ ext_path = 'LD_LIBRARY_PATH= ' . BUILD_ROOT_PATH . '/lib:$LD_LIBRARY_PATH ' ;
215211 FileSystem::removeFileIfExists (BUILD_ROOT_PATH . '/lib/libphp.a ' );
216212 } else {
217213 $ ext_path = '' ;
218- FileSystem::removeFileIfExists (BUILD_ROOT_PATH . '/lib/libphp.so ' );
214+ foreach (glob (BUILD_LIB_PATH . '/libphp*.so ' ) as $ file ) {
215+ unlink ($ file );
216+ }
217+ }
218+ [$ ret , $ out ] = shell ()->cd ($ sample_file_path )->execWithResult (getenv ('CC ' ) . ' -o embed embed.c ' . $ lens );
219+ if ($ ret !== 0 ) {
220+ throw new RuntimeException ('embed failed sanity check: build failed. Error message: ' . implode ("\n" , $ out ));
219221 }
220222 [$ ret , $ output ] = shell ()->cd ($ sample_file_path )->execWithResult ($ ext_path . './embed ' );
221223 if ($ ret !== 0 || trim (implode ('' , $ output )) !== 'hello ' ) {
You can’t perform that action at this time.
0 commit comments