SkillAgentSearch skills...

Romt

Romt (Rust Offline Mirror Tool) aids in using the Rust programming language in an offline context.

Install / Use

/learn @drmikehenry/Romt
About this skill

Quality Score

0/100

Supported Platforms

Universal

README


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 romt and all dependencies on a host with direct Internet access:

    • Prepare romt download area:

      .. code-block:: sh

      mkdir romt cd romt

    • Download romt with 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 PATH contains the directory that holds installed Python packages::

    # For Linux:
    ~/.local/bin
    
    # For Windows with Python version X.Y:
    %APPDATA%\Python\PythonXY\Scripts
    
  • Install romt from the current directory of sources (ensuring the current working directory is the romt/ 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 uv globally, 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 run to run nox within 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 linux to windows or darwin as appropriate:

    romt toolchain -v -s stable -t linux download

  • Download latest stable rustup version:

    .. code-block:: sh

    Change linux to windows or darwin as 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-going option 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 linux to windows or darwin as appropriate:

      romt toolchain -v -s stable -t linux download pack

    • Download latest stable rustup version and create rustup.tar.gz:

      .. code-block:: sh

      Change linux to windows or darwin as 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, and crates.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, and crates.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:8000 below 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-init installer 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

View on GitHub
GitHub Stars59
CategoryDevelopment
Updated4d ago
Forks12

Languages

Python

Security Score

80/100

Audited on Mar 30, 2026

No findings