-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Labels
cargo-phpRelated to `cargo-php`Related to `cargo-php`enhancementNew feature or requestNew feature or request
Description
The state of things:
Currently cargo php install
adds a newly built extension unconditionally given that the building process itself hasn't failed.
As a Mac user I sometimes end up having a broken extension file, which causes the PHP interpreter get instantly killed off right after startup. When it happens I have to manually remove extension=...
from php.ini, then run cargo php remove --yes
and then cargo php install --yes
.
Proposal:
cargo php install
should make sure that the newly built extension can be loaded without errors. It can be done by runningphp -d 'extension=foo.so' -r ''
and asserting that the exit status code is 0.cargo php install
should update a symlink instead of overwriting the extension itself https://github.com/davidcole1340/ext-php-rs/blob/master/crates/cli/src/lib.rs#L224-L226
copy() being a non-atomic op, truncates the destination file and writes it block by block, so there's a chance to load a broken extension file.
I believe this is also the reason for the random MacOS issues.- I think
--yes
has to go. Let's addcargo php build
for building without installing.cargo php install
should build and install without prompting a yes. Prompting duringcargo php remove
doesn't seem logical either.
Metadata
Metadata
Assignees
Labels
cargo-phpRelated to `cargo-php`Related to `cargo-php`enhancementNew feature or requestNew feature or request