Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/actions/embed/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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" ]
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn find_php() -> Result<PathBuf> {
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);
}
Expand Down
14 changes: 7 additions & 7 deletions crates/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,15 @@ fn get_ext_dir() -> AResult<PathBuf> {
.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()
);
}

Expand All @@ -299,14 +299,14 @@ fn get_php_ini() -> AResult<PathBuf> {
.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)
Expand Down Expand Up @@ -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
Expand Down
28 changes: 26 additions & 2 deletions docsrs_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions unix_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand All @@ -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);
}
Expand Down