diff --git a/.github/actions/embed/Dockerfile b/.github/actions/embed/Dockerfile index d1b0e30f1..75d61876a 100644 --- a/.github/actions/embed/Dockerfile +++ b/.github/actions/embed/Dockerfile @@ -1,9 +1,9 @@ -FROM php:8.2-bullseye +FROM debian:trixie WORKDIR /tmp RUN apt update -y && apt upgrade -y -RUN apt install lsb-release wget gnupg software-properties-common -y +RUN apt install lsb-release wget gnupg php8.4-dev libphp8.4-embed build-essential curl -y RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ENV RUSTUP_HOME=/rust @@ -12,4 +12,4 @@ ENV PATH=/cargo/bin:/rust/bin:$PATH RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path && cargo install cargo-expand -ENTRYPOINT [ "/cargo/bin/cargo", "test", "--all", "--release", "--all-features", "--no-fail-fast" ] +ENTRYPOINT [ "/cargo/bin/cargo", "test", "--workspace", "--release", "--all-features", "--no-fail-fast" ] diff --git a/build.rs b/build.rs index 9df8dae7d..e0c6dc1e0 100644 --- a/build.rs +++ b/build.rs @@ -74,7 +74,7 @@ fn find_php() -> Result { if let Some(path) = path_from_env("PHP") { if !path.try_exists()? { // If path was explicitly given and it can't be found, this is a hard error - bail!("php executable not found at {:?}", path); + bail!("php executable not found at {}", path.display()); } return Ok(path); } diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index ca71d62e6..9fbceca43 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -269,15 +269,15 @@ fn get_ext_dir() -> AResult { .output() .context("Failed to call PHP")?; if !cmd.status.success() { - bail!("Failed to call PHP: {:?}", cmd); + bail!("Failed to call PHP: {cmd:?}"); } let stdout = String::from_utf8_lossy(&cmd.stdout); let ext_dir = PathBuf::from(stdout.rsplit('\n').next().unwrap()); if !ext_dir.is_dir() { if ext_dir.exists() { bail!( - "Extension directory returned from PHP is not a valid directory: {:?}", - ext_dir + "Extension directory returned from PHP is not a valid directory: {}", + ext_dir.display() ); } @@ -299,14 +299,14 @@ fn get_php_ini() -> AResult { .output() .context("Failed to call PHP")?; if !cmd.status.success() { - bail!("Failed to call PHP: {:?}", cmd); + bail!("Failed to call PHP: {cmd:?}"); } let stdout = String::from_utf8_lossy(&cmd.stdout); let ini = PathBuf::from(stdout.rsplit('\n').next().unwrap()); if !ini.is_file() { bail!( - "php.ini does not exist or is not a file at the given path: {:?}", - ini + "php.ini does not exist or is not a file at the given path: {}", + ini.display() ); } Ok(ini) @@ -416,7 +416,7 @@ impl Stubs { })?; if !cli_version.matches(&ext_version) { - bail!("Extension was compiled with an incompatible version of `ext-php-rs` - Extension: {}, CLI: {}", ext_version, cli_version); + bail!("Extension was compiled with an incompatible version of `ext-php-rs` - Extension: {ext_version}, CLI: {cli_version}"); } let stubs = result diff --git a/docsrs_bindings.rs b/docsrs_bindings.rs index e23a8302d..88ef1b41d 100644 --- a/docsrs_bindings.rs +++ b/docsrs_bindings.rs @@ -260,7 +260,9 @@ pub struct _IO_FILE { pub _markers: *mut _IO_marker, pub _chain: *mut _IO_FILE, pub _fileno: ::std::os::raw::c_int, - pub _flags2: ::std::os::raw::c_int, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, + pub _short_backupbuf: [::std::os::raw::c_char; 1usize], pub _old_offset: __off_t, pub _cur_column: ::std::os::raw::c_ushort, pub _vtable_offset: ::std::os::raw::c_schar, @@ -271,10 +273,32 @@ pub struct _IO_FILE { pub _wide_data: *mut _IO_wide_data, pub _freeres_list: *mut _IO_FILE, pub _freeres_buf: *mut ::std::os::raw::c_void, - pub __pad5: usize, + pub _prevchain: *mut *mut _IO_FILE, pub _mode: ::std::os::raw::c_int, pub _unused2: [::std::os::raw::c_char; 20usize], } +impl _IO_FILE { + #[inline] + pub fn _flags2(&self) -> ::std::os::raw::c_int { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) } + } + #[inline] + pub fn set__flags2(&mut self, val: ::std::os::raw::c_int) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 24u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(_flags2: ::std::os::raw::c_int) -> __BindgenBitfieldUnit<[u8; 3usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 24u8, { + let _flags2: u32 = unsafe { ::std::mem::transmute(_flags2) }; + _flags2 as u64 + }); + __bindgen_bitfield_unit + } +} pub type zend_long = i64; pub type zend_ulong = u64; pub type zend_off_t = i64; diff --git a/flake.lock b/flake.lock index 2ed5021b8..fd49aa685 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1754498491, - "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", + "lastModified": 1759036355, + "narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", + "rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127", "type": "github" }, "original": { @@ -29,11 +29,11 @@ ] }, "locked": { - "lastModified": 1754575663, - "narHash": "sha256-afOx8AG0KYtw7mlt6s6ahBBy7eEHZwws3iCRoiuRQS4=", + "lastModified": 1759199574, + "narHash": "sha256-w24RYly3VSVKp98rVfCI1nFYfQ0VoWmShtKPCbXgK6A=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "6db0fb0e9cec2e9729dc52bf4898e6c135bb8a0f", + "rev": "381776b12d0d125edd7c1930c2041a1471e586c0", "type": "github" }, "original": { diff --git a/unix_build.rs b/unix_build.rs index 123eed9ba..b45c18396 100644 --- a/unix_build.rs +++ b/unix_build.rs @@ -18,7 +18,7 @@ impl Provider<'_> { let stdout = String::from_utf8_lossy(&cmd.stdout); if !cmd.status.success() { let stderr = String::from_utf8_lossy(&cmd.stderr); - bail!("Failed to run `php-config`: {} {}", stdout, stderr); + bail!("Failed to run `php-config`: {stdout} {stderr}"); } Ok(stdout.to_string()) } @@ -28,7 +28,7 @@ impl Provider<'_> { if let Some(path) = path_from_env("PHP_CONFIG") { if !path.try_exists()? { // If path was explicitly given and it can't be found, this is a hard error - bail!("php-config executable not found at {:?}", path); + bail!("php-config executable not found at {}", path.display()); } return Ok(path); }