Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find out which crate dependency is requiring the standard library to be linked?

Tags:

rust

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.

like image 628
qweruiop Avatar asked Jan 19 '18 18:01

qweruiop


1 Answers

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.

like image 62
u296 Avatar answered Nov 17 '22 14:11

u296