In python, when you install stuff with pip, it is recommended to use a venv, to avoid breaking dependencies for a program when uninstalling another one, or when two programs need two different versions of the same dependence.

I was wondering if with Rust is the same, or if Cargo manages it all on its own (kind of like apt does), and I shouldn’t care about it.

Also since I know Linux kernel is using some Rust, isn’t there a risk of breaking my system if I uninstall a program that need some deps that the system itsel needs?

  • Rogue@feddit.uk
    link
    fedilink
    arrow-up
    27
    ·
    1 month ago

    Rust is very different to Python and Cargo is very different to apt.

    When you build your rust/Cargo project it compiles all the dependencies specified in Cargo.toml into a single executable.

    That executable (with some exceptions) can then be run without any dependencies. You don’t even need Rust or cargo installed. Therefore the Rust running in the kernel is entirely isolated from whatever your Rust app is doing.

    There’s no need for virtual environments etc