#docker-build #cargo-build #docker #build #buildkit #rustc-wrapper #docker-host

build rustcbuildx

$RUSTC_WRAPPER tool to sandbox cargo builds and execute jobs remotely

4 releases (breaking)

0.4.0 Jun 23, 2024
0.3.0 Jun 11, 2024
0.2.0 May 12, 2024
0.1.0 Dec 3, 2023

#42 in Build Utils

Download history 2/week @ 2024-03-27 4/week @ 2024-04-03 141/week @ 2024-05-08 18/week @ 2024-05-15 13/week @ 2024-05-22 1/week @ 2024-05-29 91/week @ 2024-06-05 50/week @ 2024-06-12 153/week @ 2024-06-19 14/week @ 2024-06-26

308 downloads per month

MIT license

120KB
2K SLoC

rustcbuildx

Forwards rustc calls to BuildKit builders.

rustcbuildx is a RUSTC_WRAPPER for cached and remote building of Rust projects (on BuildKit).

Usage

  • Ensure at least either a docker or podman client is installed
  • Known to work on Ubuntu 22.04 with github.com/docker/buildx v0.11.2 9872040 and rust 1.73
# Keep images in sync with your local tools
rustcbuildx pull

export RUSTC_WRAPPER=rustcbuildx
cargo build ...
cargo check ...
cargo clippy ...
cargo install ...
cargo test ...

# or
RUSTC_WRAPPER=rustcbuildx cargo build ...
RUSTC_WRAPPER=rustcbuildx cargo check ...
RUSTC_WRAPPER=rustcbuildx cargo clippy ...
RUSTC_WRAPPER=rustcbuildx cargo install ...
RUSTC_WRAPPER=rustcbuildx cargo test ...

Fine tuning settings

rustcbuildx@version: $RUSTC_WRAPPER tool to sandbox cargo builds and execute jobs remotely
    https://github.com/fenollp/supergreen

Usage:
  rustcbuildx env             Show used values
  rustcbuildx pull            Pulls images (respects $DOCKER_HOST)
  rustcbuildx -h | --help
  rustcbuildx -V | --version

Remote execution

Say you have a bigger machine in your ~/.ssh/config called extra_oomph:

export DOCKER_HOST=ssh://extra_oomph
# Then
export RUSTC_WRAPPER=rustcbuildx
cargo test ...

Installation

# Installs to ~/.cargo/bin
cargo install --locked --force --git https://github.com/fenollp/supergreen.git rustcbuildx

# Make sur $CARGO_HOME/bin is in your $PATH
which rustcbuildx

En vrac

Dependencies

~9–22MB
~260K SLoC