name: Using RUSTFLAGS to do linking instead of .cargo/config
about: Using RUSTFLAGS environmental variable that cargo reads from, to link to the libspdk.so so that it is able to compile and run.
Solution
Using .cargo/config is redundant, I have removed this file and enforced usage of RUSTFLAGS environmental variable. Since the .cargo/config does not allow environmental variables, except for some predefined list.
To run it with this modification, need to set the RUSTFLAGS environmental variable to add a link arg pointing to the libspdk.so. Please ensure that libspdk.so exists in the $SPDK_INSTALL_DIR/lib directory. If it does not exist, copy it into this location, from spdk repo (e.g. $HOME/spdk/build/lib/libspdk.so).
name: Using RUSTFLAGS to do linking instead of .cargo/config about: Using RUSTFLAGS environmental variable that cargo reads from, to link to the libspdk.so so that it is able to compile and run.
Problem Description https://github.com/utsaslab/rustfs/issues/13
Solution Using .cargo/config is redundant, I have removed this file and enforced usage of RUSTFLAGS environmental variable. Since the .cargo/config does not allow environmental variables, except for some predefined list. To run it with this modification, need to set the RUSTFLAGS environmental variable to add a link arg pointing to the libspdk.so. Please ensure that
libspdk.so
exists in the$SPDK_INSTALL_DIR/lib
directory. If it does not exist, copy it into this location, from spdk repo (e.g.$HOME/spdk/build/lib/libspdk.so
).Verification To verify, I ran cargo run, in hello_nvme_bdev_rust and received the identical output as the configuration with the .cargo/config.
References https://rurust.github.io/cargo-docs-ru/environment-variables.html https://doc.rust-lang.org/cargo/reference/environment-variables.html