`dynamic_library_name` incompatible with `libloading` version 0.9.0

Open
#3,359 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
tooling

Research direction

Locate the code-generation path used when dynamic_library_name is present and inspect the generated Library::new signature. Update the generated bounds to match libloading 0.9.0, then verify that bindings using dynamic_library_name compile with that dependency version.

Written by the indexing model from the issue text.

Description

Good day,

libloading changed their API slightly, specifically the trait bounds to Library::new: https://github.com/nagisa/rust_libloading/commit/4b98285041defabf87df73f57051f5d55125758f

As a result, bindings generated with dynamic_library_name present fail to compile.
Generated code should be changed something like this:

 pub unsafe fn new<P>(path: P) -> Result<Self, ::libloading::Error>
     where
-        P: AsRef<::std::ffi::OsStr>,
+        P: ::libloading::AsFilename,
     {
         let library = ::libloading::Library::new(path)?;
         Self::from_library(library)
     }
Dominant language
Rust
Stars
5.3k
Forks
846
Avg merge
2d 6h
Merged PRs (30d)
11

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/rust-bindgen

All issues in rust-lang/rust-bindgen

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.