appsignal / mongo-rust-driver

Mongo Rust driver built on top of the Mongo C driver
Apache License 2.0
89 stars 22 forks source link

Version 0.12 pulls in mongoc-sys 1.17.4 after 0.13 release #62

Closed MightyPork closed 3 years ago

MightyPork commented 3 years ago

This sounds like some Cargo bug, but our project stopped working after you released version 0.13.

Maybe it has something to do with the 1.8.x versions being marked as pre-releases?

Screenshot_20210311_160917

Instead of mongoc-sys 1.8.2, cargo upgraded the dependency to 1.17.4. That shouldn't be a valid solution for "1.8.2-1"??

anyway, the binary now depends on two new so-files that were not needed before:

OLD, good

    linux-vdso.so.1 (0x00007ffe86b6b000)
    libudev.so.1 => /usr/lib/libudev.so.1 (0x00007f5f84e8f000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f5f84e6e000)
    libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x00007f5f84ddd000)
    libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x00007f5f84aff000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f5f84af8000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f5f84ade000)
    librt.so.1 => /usr/lib/librt.so.1 (0x00007f5f84ad1000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007f5f8498c000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f5f847bf000)
    /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f5f8673b000)

NEW, bad

    linux-vdso.so.1 (0x00007ffc309ff000)
    libudev.so.1 => /usr/lib/libudev.so.1 (0x00007f51925a0000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f519257f000)
    libbson-1.0.so.0 => not found
    libmongoc-1.0.so.0 => not found
    libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x00007f51924ee000)
    libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x00007f5192210000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f51921f4000)
    librt.so.1 => /usr/lib/librt.so.1 (0x00007f51921e9000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007f51920a4000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f519209d000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f5191ed0000)
    /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f5193b8c000)

It worked fine before, so clearly the dependencies were not needed that badly. We will keep the old version to avoid these new dependencies, that's OK. But something is clearly wrong here, 0.12 shouldn't be pulling in mongoc-sys 1.17.4...

A workaround for now is adding these to my Cargo.toml:

mongo_driver = "=0.12.1"
mongoc-sys = "=1.8.2-1"
thijsc commented 3 years ago

That's indeed odd, the version is hard-linked.

The newer mongoc version changed things quite a bit. Hopefully that'll be sorted out soon.

MightyPork commented 3 years ago

Try building an empty project with mongo_driver = "0.12.1", you will see that it downloads the dynamically-linked version. I think it's caused by your old rustc-sys being marked as pre-releases on crates.io. Maybe if you release one without the -X suffix, it will get fixed, I'm not sure.

I opened a cargo bug about it https://github.com/rust-lang/cargo/issues/9253

thijsc commented 3 years ago

I realized it should have been mongo_driver = "=0.12.1" to make this work reliably. We're using that from now on. The 0.13 version has been fixed and should be usable now.