Installation/Configuration of Rust behind a firewall [help]


#1

I work at a company where our ITS manages “very strictly” installs on our Linux systems through managers like pip, gem installs, apt-get, etc… For example, if I want to install the package on my linux box I must submit a ticket to ITS for this to happen. We have a dedicated server internal to our company network that contains various “approved” packages mirror’d over from their outside counterpart. When ITS gets the ticket then they perform the install. Therefore, my privileges are tightly controlled and having sudo is simply not an option unless it’s a special case.

What implications will this have w/ Rust’s manager cargo. Getting Rust installed I believe is straight forward. It’s my concern that every time I need a new crate, update a crate, run a cargo build with dependencies listed in my cargo.toml, switch/update releases that I will experience server road blocks and issues. However, I’m quite new to this so I would appreciate some advice on what issues I would run into along with any helpful advice I could pitch to our ITS team in working around this.


#2

The good news is that if you use rustup then you don’t need root at all. Rust can happily be installed into your home directory as a normal unprivileged user.

The bad news is that both rustup and cargo will need to download stuff from the internet. If internet access is blocked at your site, this will be a problem.

Nightly rust has some support for alternative registries (this means that instead of downloading dependencies from the internet, cargo can download them from a locally maintained registry). So you could ask your ITS team to maintain a local mirror of the rust crates you want to depend on. Unfortunately at the moment I can’t find where this is documented, but I think this is the approach you’ll need to take.


#3

@eminence
My understanding is that the nightly release can be unstable for some features (crates). Therefore, are you saying that in order to maintain a local mirror of the rust crates I want I have to be using the nightly release? Kind of confused here cause I was understanding the term “nightly release” to be specific to releases of rust not actual crates. Would you be so kind to provide some clarity there please.


#4

Using local registries itself is a “nightly feature”.

Nightly features are things which are likely to change in the future, or at least aren’t guaranteed to remain the same. They’re not accessible from stable compilers, because if something works on a stable compiler, it’s guaranteed to work forever. Nightly features can be things crates use, but they can also be features of cargo. This is the case with using local registries.

If you want to use a local registry, you’ll need to use a “nightly” version of rust (any recent one will do). The syntax for using these local registries might not remain the same forever, but you can just keep on a specific nightly version until you’re ready to upgrade. Many projects which depend on nightly features, like servo, keep a “pinned” version of nightly which is used. Every so often, someone updates to a newer one and tests everything.