Library only cargo install does not install library only

I have a RUST cargo that builds a LD_PRELOAD library.
Most of its fuctionality is in the that it produces.

cargo install --root /x/y/z --path ./

doesn't install the library ?

cargo build is complete, but the install fails

    Finished dev [unoptimized + debuginfo] target(s) in 22.21s
bash-4.4$ cargo install --path ./ --root /ws/sarvi-sjc/localroot
error: no packages found with binaries or examples
1 Like

cargo install is designed only for binaries/examples, so you can't use it for this

This thread from yesterday has some suggestions for projects that require more than cargo install offers:

1 Like

Is any of this in production. The only way I am seeing now is installing the files maually or using my own install scripts. Am I missing something.

This seems pretty basic that is missing.
Was rust never designed to build shared libraries ?

Yeah, cargo install is a bare-bones utility, designed mainly for installing simple development tools or self-contained utilities. It can't replace the full-featured packaging and installation systems already built in to most operating systems. Application developers should typically use Cargo to build their Rust code, not to distribute or install it.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.