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.
Before you begin
Section titled “Before you begin”- Check that your computer meets the system requirements, and install the build tools.
- Make sure that you can run commands as an administrator.
Build and package Russet
Section titled “Build and package Russet”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.
-
Clone the Russet repository, and then go to its
rustfolder:Terminal window git clone https://github.com/weswhet/russet.gitcd russet/rust -
Build the
russetcommand, which also runs the macOS helper services:Terminal window cargo build --release --locked -p russetThe first build downloads the Rust dependencies, so it can take several minutes.
-
Package the build into an archive:
Terminal window cargo xtask package --target TARGET --bin-dir target/releaseReplace
TARGETwith the target for your computer:aarch64-apple-darwinfor a Mac with Apple silicon.x86_64-apple-darwinfor a Mac with an Intel processor.x86_64-unknown-linux-gnufor Linux on x86-64.x86_64-pc-windows-msvcfor Windows on x86-64.
The command creates the archive in the
distfolder and prints its path. The archive’s name isrusset-development-TARGET.tar.gz, orrusset-development-TARGET.zipon Windows. If the programs don’t matchTARGET, 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.
Install on macOS
Section titled “Install on macOS”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:
-
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-installtar -xzf dist/russet-development-aarch64-apple-darwin.tar.gz -C ~/russet-installcd ~/russet-install/russet-development-aarch64-apple-darwinFor a Mac with an Intel processor, replace
aarch64-apple-darwinwithx86_64-apple-darwin. -
Run the installer:
Terminal window sudo /bin/sh ./install.sh installThe 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 -
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.plistand/Library/LaunchDaemons/com.github.weswhet.russet.installd.plist, the launchd jobs that runrusset --serverandrusset --installdas the privileged helper services./opt/russet-rollbacks, which holds the files that each installation replaced.
Install on Linux
Section titled “Install on Linux”To install Russet on Linux, follow these steps:
-
Extract the archive into a new folder, and then go to the extracted folder:
Terminal window mkdir -p ~/russet-installtar -xzf dist/russet-development-x86_64-unknown-linux-gnu.tar.gz -C ~/russet-installcd ~/russet-install/russet-development-x86_64-unknown-linux-gnu -
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.
Install on Windows
Section titled “Install on Windows”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:
-
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" -
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. -
To run
russetfrom any folder, add the destination folder to yourPATH. 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:
& "$HOME\russet-install\russet-development-x86_64-pc-windows-msvc\install.ps1" recover -Destination 'C:\Tools\Russet'Check the installation
Section titled “Check the installation”To confirm that your shell runs the installed command, run the following command:
russet versionThe output is the AutoPkg compatibility version:
3.0.0Russet 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.
Update Russet
Section titled “Update Russet”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.