Offline Rust #11560
duaneellissd
started this conversation in
General
Offline Rust
#11560
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Using cargo in an offline way is hard, really hard, it is really confusing.
I am looking for 1 of 2 options ways of solving my problem
Option 1 -
Step 1 - Some means to get cargo to list all the URLS required by a something
I'm ok if this was a 10 TB download.
I'm ok if this is an iterative process, ie: get the first batch, and rinse and repeat for more.
Step 2 - I can then go fetch these
Step 3 - I can then "move these into a closed environment"
YES for me that means Burn to DVD and sneaker-net the DVD images
Step 4 - I can then setup a network location( NFS share )that has a readonly copy of all of these packages.
OR:
Step 4 - I can push/create a GIT repo for each package in my internal "closed environment"
Step 5 - when I run Cargo in my internal environment (where I have no internet)
I would like to tell Cargo: "given the name FOO instead of the normal place
fetch it from git://gitserver.local/rust-package/FOO
OR fetch it from /some/directory/named/FOO
How can I do this. What is considered "best practice" for mirroring 'crates.io' internally/locally.
Google finds a number of examples but they seem stale/dead - ie: last commit was years ago.
Im trying to avoid going down useless rabbit holes only to end up at a pile of garbage.
So what is the current -2025- way to mirror "crates.io"
I see this in 3 parts or 3 steps.
part A1) _ what to download, the download and BURNING dvds
Again - I am ok with downloading TERABYTES of files.
part A2) Given the Cargo.io-Index - I can find a package.
But it is not clear how to get the URL where to download the package.
If i had that - I could write my own downloader.
Part B) What infrastructure do I need in my "closed environment"
Best answer:
Easy options are: - Setup an Apache web server that can serve static files - ie: The content of those DVDS?
Part C) - in the restricted environment. Is there a Global setting I can use to tell cargo (and rustup, etc)
To use my NEW URL for all things you want to download.
AND - have RUSTUP/CARGO - when it cannot find something - print a USABLE error message?
The Error message for the cargo --offline option is beyond useless.
Beta Was this translation helpful? Give feedback.
All reactions