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

zstd linking problem #72

Open MightyPork opened 3 years ago

MightyPork commented 3 years ago

Building on Arch Linux I get this error:

 = note: /usr/bin/ld: /home/ondra/rust/flowbox/target/debug/deps/libmongoc_sys-a203a8004de42198.rlib(mongoc-compression.c.o): in function `mongoc_uncompress':
          /home/ondra/rust/flowbox/target/debug/build/mongoc-sys-5ce01294740c27db/out/mongo-c-driver-1.17.5/src/libmongoc/src/mongoc/mongoc-compression.c:197: undefined reference to `ZSTD_decompress'
          /usr/bin/ld: /home/ondra/rust/flowbox/target/debug/build/mongoc-sys-5ce01294740c27db/out/mongo-c-driver-1.17.5/src/libmongoc/src/mongoc/mongoc-compression.c:202: undefined reference to `ZSTD_isError'
          /usr/bin/ld: /home/ondra/rust/flowbox/target/debug/build/mongoc-sys-5ce01294740c27db/out/mongo-c-driver-1.17.5/src/libmongoc/src/mongoc/mongoc-compression.c:206: undefined reference to `ZSTD_isError'
          /usr/bin/ld: /home/ondra/rust/flowbox/target/debug/deps/libmongoc_sys-a203a8004de42198.rlib(mongoc-compression.c.o): in function `mongoc_compress':
          /home/ondra/rust/flowbox/target/debug/build/mongoc-sys-5ce01294740c27db/out/mongo-c-driver-1.17.5/src/libmongoc/src/mongoc/mongoc-compression.c:267: undefined reference to `ZSTD_compress'
          /usr/bin/ld: /home/ondra/rust/flowbox/target/debug/build/mongoc-sys-5ce01294740c27db/out/mongo-c-driver-1.17.5/src/libmongoc/src/mongoc/mongoc-compression.c:273: undefined reference to `ZSTD_isError'
          /usr/bin/ld: /home/ondra/rust/flowbox/target/debug/build/mongoc-sys-5ce01294740c27db/out/mongo-c-driver-1.17.5/src/libmongoc/src/mongoc/mongoc-compression.c:276: undefined reference to `ZSTD_isError'
          /usr/bin/ld: /home/ondra/rust/flowbox/target/debug/deps/libmongoc_sys-a203a8004de42198.rlib(mongoc-compression.c.o): in function `mongoc_compressor_max_compressed_length':
          /home/ondra/rust/flowbox/target/debug/build/mongoc-sys-5ce01294740c27db/out/mongo-c-driver-1.17.5/src/libmongoc/src/mongoc/mongoc-compression.c:57: undefined reference to `ZSTD_compressBound'
          collect2: error: ld returned 1 exit status

for now I'll revert back to 0.12. Guess updating to 0.13 was still too ambitious


Edit: Gonna be related to #71, adding this at the end of build.rs fixes the problem.

println!("cargo:rustc-link-lib=zstd");
MightyPork commented 2 years ago

This still doesn't work, I need to upgrade the driver for newer mongodb and it doesn't link ...