getditto / safer_ffi

Write safer FFI code in Rust without polluting it with unsafe code
http://getditto.github.io/safer_ffi
MIT License
925 stars 40 forks source link

Strange linker error #119

Closed TheButlah closed 2 years ago

TheButlah commented 2 years ago

I get some strange linker errors when compiling with cargo test --all:

_cargo_test__output.txt

Then I run cargo test --all again and I get this:

error[E0460]: found possibly newer version of crate `tp_client` which `circle_game` depends on
 --> circle_game/src/main.rs:5:19
  |
5 |     let mut app = circle_game::configure_app();
  |                   ^^^^^^^^^^^
  |
  = note: perhaps that crate needs to be recompiled?
  = note: the following crate versions were found:
          crate `tp_client`: /unencrypted/tp/platform/target/debug/deps/libtp_client.rlib
          crate `circle_game`: /unencrypted/tp/platform/target/debug/deps/libcircle_game.rlib

error: could not compile `circle_game` due to previous error

circle_game is a crate that depends on the tp_client crate which uses safer-ffi. circle_game does not use safer-ffi at all.

TheButlah commented 2 years ago

Cargo version: cargo 1.63.0-nightly (38472bc19 2022-05-31) OS: Ubuntu 20.04.4 on Windows 11 via WSL2

TheButlah commented 2 years ago

The error is non-deterministic btw, If I cargo clean and then cargo test --all, sometimes it happens and sometimes it doesnt'

danielhenrymantilla commented 2 years ago

Interesting; I think I've managed to run, in the past, into similar things myself, so definitely something I have had on my radar:


Other than that, safer-ffi can't really help more; this is a Cargo / Rust bug; feel free to report it there: https://github.com/rust-lang/cargo/issues (see also stuff such as https://github.com/rust-lang/rust/issues/82151)