ExpHP / rsp2

phonons in rust
Apache License 2.0
2 stars 1 forks source link

bindgen version mismatch #86

Open colin-daniels opened 5 years ago

colin-daniels commented 5 years ago

For the latest code (43102a3c357d5005fcb3c923a53c8289e7d3bc62) I get the following error when doing a clean build

cc@engine ~/build/rsp2-orig (git)-[master] % cargo build --release
    Updating crates.io index
    Updating git repository `https://github.com/ExpHP/rsp2-kets`
    Updating git repository `https://github.com/ExpHP/dftbplus-sys`
    Updating git repository `https://github.com/ExpHP/lammps-sys`
...
  Downloads some crates...
...
error: multiple packages link to native library `clang`, but a native library can be linked only once

package `clang-sys v0.28.0`
    ... which is depended on by `bindgen v0.49.0`
    ... which is depended on by `libffi-sys v0.6.4`
    ... which is depended on by `libffi v0.6.4`
    ... which is depended on by `mpi v0.5.4`
    ... which is depended on by `rsp2 v0.1.0 (/home/ccbuild/rsp2-orig)`
links to native library `clang`

package `clang-sys v0.21.2`
    ... which is depended on by `bindgen v0.31.3`
    ... which is depended on by `dftbplus-sys v0.0.1 (https://github.com/ExpHP/dftbplus-sys?tag=v0.0.1#d55ed9e9)`
    ... which is depended on by `rsp2-dftbplus v0.1.0 (/home/cc/build/rsp2-orig/src/io/dftbplus)`
    ... which is depended on by `rsp2 v0.1.0 (/home/cc/build/rsp2-orig)`
also links to native library `clang`
cargo build --release  16.24s user 2.90s system 37% cpu 50.724 total

Seems like the dftbplus-sys bindgen version doesn't match the one from mpi now (probably same with lammps-sys but it didn't get that far). Fix would probably (?) be to update them to use bindgen = "^0.49" which is what libffi-sys uses as of 0.6.4. Luckily, in the future mpi will actually pin the version of libffi which will hopefully kinda help.

ExpHP commented 5 years ago

Ah, thank goodness libffi-sys and mpi updated. I wanted to use a newer bindgen a while back but was stuck with that old version due to precisely this issue. I do feel libffi-sys is in the wrong for publishing a semver-compatible update that updates bindgen to one that uses a new libclang, though. (I thought the author was aware of this problem)

This is also my fault for not checking Cargo.lock into version control, which you're supposed to do for binaries.

On Thu, May 9, 2019, 8:07 AM Colin Daniels notifications@github.com wrote:

For the latest code (43102a3 https://github.com/ExpHP/rsp2/commit/43102a3c357d5005fcb3c923a53c8289e7d3bc62) I get the following error when doing a clean build

cc@engine ~/build/rsp2-orig (git)-[master] % cargo build --release Updating crates.io index Updating git repository https://github.com/ExpHP/rsp2-kets https://github.com/ExpHP/rsp2-kets Updating git repository https://github.com/ExpHP/dftbplus-sys https://github.com/ExpHP/dftbplus-sys Updating git repository https://github.com/ExpHP/lammps-sys https://github.com/ExpHP/lammps-sys ... Downloads some crates... ... error: multiple packages link to native library clang, but a native library can be linked only once

package clang-sys v0.28.0 ... which is depended on by bindgen v0.49.0 ... which is depended on by libffi-sys v0.6.4 ... which is depended on by libffi v0.6.4 ... which is depended on by mpi v0.5.4 ... which is depended on by rsp2 v0.1.0 (/home/ccbuild/rsp2-orig) links to native library clang

package clang-sys v0.21.2 ... which is depended on by bindgen v0.31.3 ... which is depended on by dftbplus-sys v0.0.1 (https://github.com/ExpHP/dftbplus-sys?tag=v0.0.1#d55ed9e9) https://github.com/ExpHP/dftbplus-sys?tag=v0.0.1#d55ed9e9) ... which is depended on by rsp2-dftbplus v0.1.0 (/home/cc/build/rsp2-orig/src/io/dftbplus) ... which is depended on by rsp2 v0.1.0 (/home/cc/build/rsp2-orig) also links to native library clang cargo build --release 16.24s user 2.90s system 37% cpu 50.724 total

Seems like the dftbplus-sys bindgen version doesn't match the one from mpi now (probably same with lammps-sys but it didn't get that far). Fix would probably (?) be to update them to use bindgen = "^0.49" which is what libffi-sys uses as of 0.6.4 https://github.com/tov/libffi-sys-rs/blob/0.6.4/Cargo.toml. Luckily, in the future mpi will actually pin the version of libffi https://github.com/bsteinb/rsmpi/commit/7c8d6c54de0eab8e2d54d54e633ba8471ede7e04#diff-80398c5faae3c069e4e6aa2ed11b28c0 which will hopefully kinda help.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ExpHP/rsp2/issues/86, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKYRUEFD3KPZTMOB7RAWFTPUQHYBANCNFSM4HLZ34SQ .

ExpHP commented 5 years ago

I checked my working Cargo.lock into version control. This should resolve the current issue.

Looking into updating lammps-sys and friends.

ExpHP commented 5 years ago

Also, mpi-sys's solution of an = version is even worse than what libffi-sys did.

The proper way to fix this mess is:

Gonna go bug them.

ExpHP commented 5 years ago

Created:

ExpHP commented 5 years ago

Status: Because no version of mpi with the new bindgen has been released yet, I cannot yet update the bindgen dependency in my own crates.