Repository navigation
fix(deps): drop unmaintained crates and patch anyhow and shlex - #4
Merged
Merged
Conversation
ansi_term, atty and instant came in through ext-php-rs 0.7.4 (bindgen 0.59 with clap 2 and env_logger 0.9, and parking_lot 0.11). ext-php-rs 0.16.4 drops all three and is the first release whose zip build dependency is past the zip extraction advisories that 0.8-0.15 pull in. Default features are disabled so the PHP 8.1 enum feature stays off and the extension still builds against PHP 8.0. 0.16 registers functions explicitly with wrap_function! and throws TypeError for arguments it cannot convert, so salt is now converted by hand to keep throwing Exception as before.
🟢 Tier S · Ready to mergeUpgrades the Rust PHP extension bindings and dependency graph, adapts function registration and salt conversion, and raises the documented PHP minimum to 8.1. The test containers and workflow now build and run against PHP 8.5, using dynamically discovered extension directories for GNU and Alpine images. Latest changes: The newest commits enable ext-php-rs default features, update the README minimum to PHP 8.1, and move the Docker and CI builds from PHP 8.0 to PHP 8.5 with refreshed Zig tooling and extension paths.
📂 Walkthrough · 6
Reviewed the commits since |
ext-php-rs 0.16.4 calls zend_destroy_static_vars, which only exists from PHP 8.1, so the PHP 8.0 build fails under zig and leaves an undefined symbol under gcc. PHP 8.0 has been EOL since 2023 and its bullseye images can no longer install packages from security.debian.org, so the Tests workflow was already broken on main. Move the test images to PHP 8.5, install the distro clang, replace the deleted zig nightly with zig 0.14.0 (clang 19, matching trixie's libclang), resolve the extension directory with php-config, and restore ext-php-rs default features now that 8.1 is the floor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Clears every RustSec advisory in
Cargo.lock. The unmaintained crates all came in throughext-php-rs0.7.4, so the fix is to upgradeext-php-rsto 0.16.4 and adapt the extension code.Advisories and crates
ansi_term0.12.1 (RUSTSEC-2021-0139, unmaintained): removed. It came fromclap2.34 viabindgen0.59;bindgen0.73 no longer depends onclap.atty0.2.14 (RUSTSEC-2024-0375 unmaintained, RUSTSEC-2021-0145 unaligned read): removed. It came fromclap2.34 andenv_logger0.9 viabindgen0.59, and both are gone.instant0.1.12 (RUSTSEC-2024-0384, unmaintained): removed. It came fromparking_lot0.11;ext-php-rs0.16 usesparking_lot0.12 (parking_lot_core0.9), which doesn't depend on it.anyhow1.0.58 (RUSTSEC-2026-0190, unsoundError::downcast_mut): bumped to 1.0.104.shlex1.1.0 (RUSTSEC-2024-0006): bumped to 2.0.1, whichbindgen0.73 requires.cpufeatures0.2.2 (yanked): bumped to 0.2.17.Why 0.16.4 and not an earlier ext-php-rs
ext-php-rs0.8 to 0.15 drop the crates above but addzip0.6 to 8.x as a build dependency, which brings RUSTSEC-2026-0367/0368/0369/0429 (fixed only inzip>= 9) and, with 0.6, thezstd-safe5 advisories. 0.16.4 is the first release onzip9.cargo auditis now clean.Code changes
Since 0.14, functions have to be registered explicitly with
wrap_function!in#[php_module].0.16 throws
TypeErrorfor arguments it can't convert, where 0.7 threwException.saltis now taken as aZvaland converted by hand, so anullor non-string salt still throwsException(covered bytestInvalidSalt). Bad values for the other arguments now throwTypeError.Minimum PHP is now 8.1
ext-php-rs 0.16.4 still lists PHP 8.0 as supported, but its
wrapper.ccallszend_destroy_static_vars, which only exists from PHP 8.1. Under zig (the Alpine build) that's a compile error; under gcc it builds a.sowith an undefined symbol. No ext-php-rs release without the zip advisories builds on 8.0. PHP 8.0 has been EOL since November 2023, and nothing in the org loads this extension (docker-base builds the CDomBlack/php-scryptextension), so the README now says PHP 8.1 or newer.CI image fixes
The Tests workflow was already broken on main:
php:8.0.18-cliis Debian bullseye, whose packages have moved to archive.debian.org, soapt-get installreturns 404s, and the pinned zig nightly (0.10.0-dev.2674) has been deleted from ziglang.org. This PR:php:8.5-cliandphp:8.5-cli-alpine(the PHP version Appwrite runs)clanginstead ofclang-11arm_neon.h) andcargo install cargo-zigbuild --lockedphp-config --extension-dirinstead of hardcoding the PHP 8.0 API directoryVerification
cargo build,cargo fmt --check,cargo clippy --all-features -- -D warningsandcargo auditall pass locally. PHPUnit passes 4/4 against the extension built on the host (PHP 8.5, macOS), and 4/4 in both thetests_gnuandtests_alpinecontainers built withdocker compose build(linux/arm64 locally; CI covers x86_64).