Hi! cargo install cargo-php (0.1.21) fails on macOS — the build script only carries the Linux link flag.
$ cargo install cargo-php
error: linking with `cc` failed: exit status: 1
= note: Undefined symbols for architecture arm64:
"_zend_empty_string", referenced from: _ext_php_rs_zend_string_init in …-wrapper.o
"_zend_hash_del", …
clang: error: linker command failed with exit code 1
macOS links executables with -undefined error by default. The Zend symbols from wrapper.o can stay unresolved: cargo-php never calls those functions (stubs generation only dlopens the extension and reads its metadata).
Workaround:
$ RUSTFLAGS="-C link-arg=-Wl,-undefined,dynamic_lookup" cargo install cargo-php
Fix is one line in crates/cli/build.rs — PR to follow.
And thanks a lot for the project, it helps a lot! 🙇
Hi!
cargo install cargo-php(0.1.21) fails on macOS — the build script only carries the Linux link flag.macOS links executables with
-undefined errorby default. The Zend symbols fromwrapper.ocan stay unresolved: cargo-php never calls those functions (stubs generation only dlopens the extension and reads its metadata).Workaround:
$ RUSTFLAGS="-C link-arg=-Wl,-undefined,dynamic_lookup" cargo install cargo-phpFix is one line in
crates/cli/build.rs— PR to follow.And thanks a lot for the project, it helps a lot! 🙇