Romt
Romt (Rust Offline Mirror Tool) aids in using the Rust programming language in an offline context.
Install / Use
/learn @drmikehenry/RomtREADME
ROMT - Rust Offline Mirror Tool
Romt (Rust Offline Mirror Tool) aids in using the Rust programming language in an offline context. Instructions and tooling are provided for:
-
Mirroring of Rust ecosystem artifacts:
- Toolchains (Rustc, Cargo, libraries, etc.)
- Rustup (toolchain multiplexer)
- Crates.io (community-supplied Crates) with "sparse" index support.
-
Incremental artifact downloading (with a configurable number of simultaneous download jobs).
-
Incremental artifact transfer to offline network.
-
Artifact serving in offline context (offline computer, disconnected network).
Scenarios
Romt support two main mirroring scenarios:
-
Development laptop scenario: Download Rust artifacts to the laptop when connected to the Internet, then serve the artifacts from the laptop when offline.
-
Disconnected network scenario: Download Rust artifacts on an Internet-connected "Export" machine, transfer them to an offline network, then serve the artifacts from an offline "Import" machine.
Instructions are provided for serving the artifacts using Romt itself via unencrypted HTTP or via the nginx web server.
Alternative Tooling
- Panamax is an alternative to Romt, written in Rust: https://github.com/panamax-rs/panamax
Requirements
- Python 3.10+ for running
romt(requires some packages from pypi.org). - Git is required for manipulating the crates.io-index repository.
- Internet-connected computer for initial downloading (Linux, Windows, Mac [#]_).
- Offline computer for serving artifacts (Linux, Windows, Mac).
- [Optional] Gnu Privacy Guard (GPG), if installed, is used used for signature checking.
.. [#] Note: the author does not have access to a Mac, so support for Romt on Mac is untested but hopefully close to working. Pull requests for Mac-specific fixes are welcome.
Romt installation
.. note::
Take note of the instructions for upgrading from Romt versions before 0.4.0 if you have existing crate mirrors created from older Romt versions.
Install prerequisites
First install prerequisites for Romt:
-
Ensure Git is installed; it is required for proper manipulation of the crates.io-index repository.
-
For signature checking, GNU Privacy Guard (gpg) should be installed as well. If gpg is not available, signature files (
*.asc) will still be transferred but signature checking will be skipped.
Next, choose an option for installation of Romt itself.
Option 1: Install a pre-built executable
The simplest method of installation is to use a pre-built self-contained executable from the Github release area: https://github.com/drmikehenry/romt/releases
Option 2: Install from Python Package Index
Romt is also available in the Python Package Index (PyPI).
-
Download
romtand all dependencies on a host with direct Internet access:-
Prepare
romtdownload area:.. code-block:: sh
mkdir romt cd romt
-
Download
romtwith dependencies:.. code-block:: sh
pip download romt
-
-
If installing to an offline host, transfer the entire
romt/download area to that host. -
Ensure that the
PATHcontains the directory that holds installed Python packages::# For Linux: ~/.local/bin # For Windows with Python version X.Y: %APPDATA%\Python\PythonXY\Scripts -
Install
romtfrom the current directory of sources (ensuring the current working directory is theromt/download area):.. code-block:: sh
pip install --user --no-index --find-links . romt
Option 3: Work with source
If desired, the source may be cloned from Github and installed into a virtual environment.
-
Install
uvglobally, perhaps as documented at: https://docs.astral.sh/uv/getting-started/installation/ -
Clone source:
.. code-block:: sh
git clone https://github.com/drmikehenry/romt cd romt
-
Use uv to create a virtual environment installed with Romt and all dependencies::
uv sync
-
Optionally build an executable for your platform; this requires
uv runto runnoxwithin the virtual environment::uv run nox -s build
Find executables in
dist/tree based on your platform, e.g.::dist/x86_64-linux/romt dist/x86_64-windows/romt.exe dist/aarch64-darwin/romt
Romt usage overview
Romt is a Python-based command-line tool with several commands:
romt toolchain: mirror and manage Rust toolchains.romt rustup: mirror and manage Rustup.romt crate: mirror and manage crate files from crates.io.romt serve: simple HTTP server for toolchains, rustup, and crates.
See romt --help for overall usage help.
In particular, note that romt --readme will display the contents of this
README file for reference.
Quick-start development-laptop server
For the development-laptop scenario, follow these steps to get a working server configuration with mirrored Rust content.
-
Ensure the laptop has Internet access.
-
Install Romt (as above).
-
Create area for mirrored artifacts:
.. code-block:: sh
mkdir mirror cd mirror
-
Download latest stable toolchain:
.. code-block:: sh
Change
linuxtowindowsordarwinas appropriate:romt toolchain -v -s stable -t linux download
-
Download latest stable rustup version:
.. code-block:: sh
Change
linuxtowindowsordarwinas appropriate:romt rustup -v -s stable -t linux download
-
Setup crate mirror (one-time only):
.. code-block:: sh
romt crate init
-
Download full crates.io mirror:
.. code-block:: sh
romt crate -v --keep-going update
.. note::
A few crates have been removed from crates.io and are therefore not available, so a few download failures (
403 Client Error: Forbidden) should be expected. The--keep-goingoption allows romt to continue in the face of these missing crates.Currently (April 2022), versions of the following crates are missing:
- bork
- css-modules
- css-modules-macros
- deploy
- doccy
- etch
- glib-2-0-sys
- glue
- gobject-2-0-sys
- peek
- pose
-
Configure crate mirror to be served from localhost (one-time only):
.. code-block:: sh
romt crate config
-
Start Romt as a server on http://localhost:8000:
.. code-block:: sh
romt serve
.. note::
Leave the server running in this dedicated terminal.
Quick-start disconnected-network server
Setting up a server for the disconnected-network scenario is similar to that for the development-laptop scenario above; explanations that overlap that scenario are omitted below.
-
On Internet-connected Export machine:
-
Install Romt (as above).
-
Create area for mirrored artifacts:
.. code-block:: sh
mkdir mirror cd mirror
-
Download latest stable toolchain and create
toolchain.tar.gz:.. code-block:: sh
Change
linuxtowindowsordarwinas appropriate:romt toolchain -v -s stable -t linux download pack
-
Download latest stable rustup version and create
rustup.tar.gz:.. code-block:: sh
Change
linuxtowindowsordarwinas appropriate:romt rustup -v -s stable -t linux download pack
-
Setup crate mirror (one-time only):
.. code-block:: sh
romt crate init
-
Download and create
crates.tar.gz:.. code-block:: sh
romt crate -v --keep-going export
-
Transfer
toolchain.tar.gz,rustup.tar.gz, andcrates.tar.gz`` to Import machine.
-
-
On Disconnected network Import machine:
-
Install Romt (as above).
-
Create area for mirrored artifacts (one-time only):
.. code-block:: sh
mkdir mirror
-
Place exported
toolchain.tar.gz,rustup.tar.gz, andcrates.tar.gzfiles into thismirror/`` directory, and enter the directory at a prompt:.. code-block:: sh
cd mirror
-
Import toolchain and rustup:
.. code-block:: sh
romt toolchain -v unpack romt rustup -v unpack
-
Setup crate mirror (one-time only):
.. code-block:: sh
romt crate init-import
-
Import
crates.tar.gz:.. code-block:: sh
romt crate -v --keep-going import
-
Configure crate mirror to be served from localhost (one-time only):
.. code-block:: sh
romt crate config
-
Start Romt as a server on http://localhost:8000:
.. code-block:: sh
romt serve
.. note::
Leave the server running in this dedicated terminal.
-
Quick-start client setup
Follow these steps to configure Rust tooling for use with a mirror server on localhost using either Quick-start server configuration above.
-
Setup environment variables to point to the server. By default, this will be at http://localhost:8000; adjust all uses of
localhost:8000below for different server address:port combinations:.. code-block:: sh
For Linux/Mac:
export RUSTUP_DIST_SERVER=http://localhost:8000 export RUSTUP_UPDATE_ROOT=http://localhost:8000/rustup
For Windows:
set RUSTUP_DIST_SERVER=http://localhost:8000 set RUSTUP_UPDATE_ROOT=http://localhost:8000/rustup
.. note::
These variables must be set in each terminal window before using the mirror server.
-
Download the
rustup-initinstaller for your platform from the Romt server using the appropriate URL below, saving it into the current directory:-
Linux: http://localhost:8000/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
-
Windows: http://localhost:8000/rustup/dist/x86_64-pc-windows-msvc/rustup-init.
-
Related Skills
node-connect
347.6kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.6kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.6kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
