12

I want to completely eliminate the dependency on std in my project so I disable the std feature in extern crates.

Somehow the final product is still linked to std, so I want to figure out which external crate is causing the linkage to std.

For standard shared libraries, this can be accomplished with ldd, but according to file, the rlib files in the deps directory are ar archives.

2
  • You will probably need to be more explicit. Individual crates aren't linked to anything. As file is telling you, a crate is closer to a bundle of object files. Only when the final product is built (executable, cdylib, etc) do all the crates get combined together and a final link step is performed.
    – Shepmaster
    Jan 19, 2018 at 18:21
  • 2
    You may want to try cargo-nono — it's rough yet but this is what it's for. Dec 7, 2018 at 9:51

1 Answer 1

2

You can use cargo tree to get a tree graph of all the dependencies and sub-dependencies of your project. Then you can find out which crate requires std, and potentially look for solutions/alternatives.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.