-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
Today I tried to migrate jlrs, a crate that provides bindings to the Julia C API for Rust, to Julia 1.7.0-beta2. I've run into two problems.
The first is related to how the low-level bindings are created: this uses bindgen which automatically generates Rust FFI bindings to C and C++ libraries. Previously this worked without any problems in combination with Julia, but now causes an error because the support directory and its contents are not available in the include directory. This can be solved relatively easily by creating a symlink to the support directory.
The second, larger issue, is that some functions that should be exported aren't actually exported by libjulia.so. Both jl_get_pgcstack and jl_field_index are marked as JL_DLLEXPORT. I can find the latter if I inspect libjulia.so.1.6 with nm, but I can't find either in libjulia.so.1.7. Compilation of tests eventually fails due to a linker error because it can't find these functions. If I redefine these two functions to just call exit(1) in a custom C library everything compiles and the tests run until jl_get_pgcstack is called "outside" Julia.
My code can be found here if that's useful: https://github.com/Taaitaaiger/jlrs/tree/dev-1.7