Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I install an executable from a local project systemwide?

Suppose I have a successful build:

$ cargo build --release
...
Finished release [optimized] target(s) in 2m 52s

Is there a way to make it available to the system user right away, without uploading to registry?

With Python, for instance, it looks like this:

myutility $ pip install dist/myutility-0.8.2-py3-none-any.whl --user

myutility goes to cache

/home/user/.local/bin/myutility

and is awailable anywhere:

~ $ myutility --help

How am I supposed to go about something like this with Rust (and cargo)?

like image 883
Alexey Orlov Avatar asked Feb 04 '26 20:02

Alexey Orlov


1 Answers

You can do

$ cargo install --path .

to have cargo compile in release mode and install the crate in the current directory. This makes Cargo install it to ~/.cargo/bin.

like image 154
Smitop Avatar answered Feb 06 '26 12:02

Smitop