jmjoy commented on issue #13747: URL: https://github.com/apache/skywalking/issues/13747#issuecomment-4073631266
The build fails with a compilation error (**E0080**) during the `phper-sys` binding generation. This is caused by a discrepancy in memory layout calculations between the system-default **LLVM 22** and the **LLVM 21** bundled with **Rust 1.94.0**. When `bindgen` uses the system's LLVM 22 to parse PHP headers, it generates structural layout assertions (size/alignment checks) that the Rust compiler (using its internal LLVM 21) finds inconsistent. This triggers constant evaluation overflows in the generated `php_bindings.rs`. **Version Context:** Running `rustc -V --verbose` reveals the internal LLVM version: ```text rustc 1.94.0 (4a4ef493e 2026-03-02) binary: rustc commit-hash: 4a4ef493e3a1488c6e321570238084b38948f6db commit-date: 2026-03-02 host: x86_64-unknown-linux-gnu release: 1.94.0 LLVM version: 21.1.8 ``` Since the system **Clang/LLVM 22** is ahead of Rust's **LLVM 21**, they calculate PHP structure sizes differently. We must wait for a newer Rust release that supports LLVM 22 or downgrade the build-time `libclang`. ### Steps to Reproduce / Solution: To resolve this, force the environment to use LLVM 21 to ensure consistency between `bindgen` and `rustc`: ```bash # 1. Install LLVM 21 compatibility libraries sudo dnf install clang21-devel # 2. Set environment variables to override defaults export RUSTUP_TOOLCHAIN=1.94.0 export LIBCLANG_PATH=/usr/lib64/llvm21/lib64 # 3. Re-run the installation pecl install skywalking_agent ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
