Skip to content

Install Russet

This page shows you how to build Russet from source, package the build into an archive, and install the russet command from that archive. The installer keeps your previous installation, including Python AutoPkg, so that you can roll back to it.

Build Russet on the computer where you plan to install it. The packaging step checks that the programs match the platform that you name, and an archive that you copy from another computer can need extra steps before macOS runs it.

To build and package Russet, follow these steps. On Windows, run the commands in PowerShell.

  1. Clone the Russet repository, and then go to its rust folder:

    Terminal window
    git clone https://github.com/weswhet/russet.git
    cd russet/rust
  2. Build the russet command, which also runs the macOS helper services:

    Terminal window
    cargo build --release --locked -p russet

    The first build downloads the Rust dependencies, so it can take several minutes.

  3. Package the build into an archive:

    Terminal window
    cargo xtask package --target TARGET --bin-dir target/release

    Replace TARGET with the target for your computer:

    • aarch64-apple-darwin for a Mac with Apple silicon.
    • x86_64-apple-darwin for a Mac with an Intel processor.
    • x86_64-unknown-linux-gnu for Linux on x86-64.
    • x86_64-pc-windows-msvc for Windows on x86-64.

    The command creates the archive in the dist folder and prints its path. The archive’s name is russet-development-TARGET.tar.gz, or russet-development-TARGET.zip on Windows. If the programs don’t match TARGET, the command stops with the following error:

    Packaging failed: Executable does not match target TARGET

The remaining steps run from the rust folder of the repository.

The installer puts Russet in /opt/russet and sets up its privileged helper services with their own launchd jobs and sockets. It doesn’t change Python AutoPkg, so you can keep both on the same Mac.

To install Russet on macOS, follow these steps:

  1. Extract the archive into a new folder, and then go to the extracted folder. For a Mac with Apple silicon, run the following commands:

    Terminal window
    mkdir -p ~/russet-install
    tar -xzf dist/russet-development-aarch64-apple-darwin.tar.gz -C ~/russet-install
    cd ~/russet-install/russet-development-aarch64-apple-darwin

    For a Mac with an Intel processor, replace aarch64-apple-darwin with x86_64-apple-darwin.

  2. Run the installer:

    Terminal window
    sudo /bin/sh ./install.sh install

    The installer stops the Russet helper services, moves any existing Russet installation aside, installs the new files, and starts the services again. When it finishes, it prints the rollback command:

    Installed Russet; rollback: /opt/russet/install.sh rollback
  3. Keep the extracted folder until you’ve checked your recipes. You can roll back from it or from /opt/russet/install.sh.

The installer creates the following items:

  • /opt/russet/russet, with a symbolic link at /usr/local/bin/russet.
  • /Library/LaunchDaemons/com.github.weswhet.russet.server.plist and /Library/LaunchDaemons/com.github.weswhet.russet.installd.plist, the launchd jobs that run russet --server and russet --installd as the privileged helper services.
  • /opt/russet-rollbacks, which holds the files that each installation replaced.

To install Russet on Linux, follow these steps:

  1. Extract the archive into a new folder, and then go to the extracted folder:

    Terminal window
    mkdir -p ~/russet-install
    tar -xzf dist/russet-development-x86_64-unknown-linux-gnu.tar.gz -C ~/russet-install
    cd ~/russet-install/russet-development-x86_64-unknown-linux-gnu
  2. Run the installer:

    Terminal window
    sudo /bin/sh ./install.sh install

The installer creates /opt/russet/russet, with a symbolic link at /usr/local/bin/russet. It keeps replaced files in /opt/russet-rollbacks. Linux doesn’t use the helper services.

The Windows installer copies russet.exe into a folder that you choose. It doesn’t change your PATH or any Chocolatey shims.

To install Russet on Windows, follow these steps:

  1. In PowerShell, extract the archive into a new folder:

    Terminal window
    Expand-Archive .\dist\russet-development-x86_64-pc-windows-msvc.zip -DestinationPath "$HOME\russet-install"
  2. Run the installer. If the destination needs administrator access, use an elevated PowerShell session.

    Terminal window
    & "$HOME\russet-install\russet-development-x86_64-pc-windows-msvc\install.ps1" install -Destination 'C:\Tools\Russet'

    The parent of the destination folder must already exist. The installer moves any existing destination folder into C:\Tools\Russet-rollbacks, so don’t choose a folder that holds other files.

  3. To run russet from any folder, add the destination folder to your PATH. For example, to add it for the current PowerShell session, run the following command:

    Terminal window
    $env:Path += ';C:\Tools\Russet'

If something interrupts an installation or rollback, run the recover action from the extracted archive before you try again:

Terminal window
& "$HOME\russet-install\russet-development-x86_64-pc-windows-msvc\install.ps1" recover -Destination 'C:\Tools\Russet'

To confirm that your shell runs the installed command, run the following command:

Terminal window
russet version

The output is the AutoPkg compatibility version:

3.0.0

Russet reports the AutoPkg version that it’s compatible with, so that recipes that set MinimumVersion keep working. An archive that you build from source doesn’t record a Russet version. To record what you installed, run git rev-parse HEAD in the russet folder, and keep the commit that it prints.

To update Russet, run git pull in the russet folder, and then repeat the steps to build, package, and install it. Each installation keeps the one that it replaces as a new rollback generation.