-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation fails on build dependency, Cannot bind to C library. #119952
Comments
Thank you for the report! It would be useful to bisect the regression using cargo-bisect-rustc to make it easier to figure out what the problem could be. |
I tried to reproduce this with the following script in a fresh rustup toolchain install nightly-2024-01-13
rustup default nightly-2024-01-13
apt update
apt install -y meson ninja-build nasm
git clone https://github.com/rust-av/dav1d-rs.git
cd dav1d-rs
git checkout a73672d040b6a8702115fcb00c697104576ee8f5
export DAV1D_DIR=dav1d_dir
export LIB_PATH=lib/x86_64-linux-gnu
git clone --branch 1.3.0 --depth 1 https://code.videolan.org/videolan/dav1d.git
cd dav1d
git checkout 48035599cdd4e4415732e408c407e0c1cd1c7444 # If this fails, do more depth
meson build -Dprefix=$HOME/$DAV1D_DIR -Denable_tools=false -Denable_examples=false --buildtype release
ninja -C build
ninja -C build install
export PKG_CONFIG_PATH="$HOME/$DAV1D_DIR/$LIB_PATH/pkgconfig"
export LD_LIBRARY_PATH="$HOME/$DAV1D_DIR/$LIB_PATH"
cd ..
cargo check |
What's your |
The bindgen version mentioned in the lockfile is 0.59.2. I also have a separate bindgen installed in .cargo/bin/ with version 0.66.1. I ran cargo-bisect-rustc up to nightly-2023-03-04 before stopping it, it failed every time. That having been said, I found that the dav1d-rs crate is being called as a dependency of the image crate, which I didn't realize when writing up the issue. Looking into image's features shows that the dav1d dependency only works on stable rust. I don't particularly know why it only works on stable rust, but regardless this seems to be more of an issue of me being stupid and not fully investigating the error. I apologize for the disruption, hope you have a good day. |
That does not sound good and is definitely a bug somewhere..., I'll reopen the issue until we know that it's a bug in a crate and not in rustc. |
It you could figure out why nightly breaks, that would be very useful :) |
Which LLVM version do you have installed on your system? rust-bindgen uses it's libclang library for parsing C header files. |
Apologies for responding to this so late, I didn't check GitHub for a couple of days. The LLVM version is 16.0.6 from the Arch Linux repo (which I'm guessing is based on 16.0.4 since that's the highest version in the 16 series on llvm.org). In other unfortunate news, I can't get the bug to happen anymore. I did do a package upgrade for dependencies, but looking at the changelogs that shouldn't have changed anything code-wise, image updated their docs but didn't touch any other part of their code. I tried recreating the problem with a fresh project, making sure to keep the same version numbers on the packages from before I upgraded them, but that built just fine. I have zero explanation, and no idea as to how I could recreate the problem now. |
Not with bindgen. I'm only aware of some rare breakage in proc macros that use |
I'm having the same issue while trying to build gst-plugin-rs https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs as a module of proton. |
I'm not sure if this should be here, in Regressions, or Library Tracking Issue, but regardless... I can't get a package dependency (dav1d-rs) to compile when running
cargo check
in Rust nightly. If I try to build it in Rust stable, it works perfectly fine and builds with no errors. As far as I can tell, there's no issue with the package's build script, it seems to be Bindgen that is throwing a fit(?).I'm including the relevant code from the package in question, but there doesn't seem to be any problems with it.
Code
Link to dav1d-sys build.rs
build.rs
From lib.rs
From dav1d/include/dav1d/headers.h
Meta
rustc --version --verbose
:I checked this in both nightly 2024-01-11 and 2024-01-13, the result was the same for both.
Error output
Included
CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true
asdav1d-sys
is a build dependency for dav1d-rs.Backtrace
The text was updated successfully, but these errors were encountered: