Open
Description
It's common for projects to build C dependencies in the build-scripts of -sys
dependencies. To be able to use these along with miri's new FFI support requires some weird contortions:
> cargo miri test
...
error: unsupported operation: can't call foreign function ...
> MIRIFLAGS=-Zmiri-native-lib=target/shared/miri/x86_64-unknown-linux-gnu/debug/build/foobar-sys-fb396848c056a26f/out/libfoobar.so cargo miri test
(along with making the build script detect CARGO_CFG_MIRI
and switch to outputting a shared object instead of the normal staticlib).
It'd be nice if there were some way to inform miri about the native lib from the build script, similar to how we can tell the linker about the native libraries (maybe there's some way miri could reuse these cargo commands?).
cargo:rustc-link-lib=static=foobar
cargo:rustc-link-search=native=$OUT_DIR