rustcbuildx

Crates.iorustcbuildx
lib.rsrustcbuildx
version0.5.0
sourcesrc
created_at2023-12-03 02:26:20.947729
updated_at2024-08-16 16:37:40.042612
description$RUSTC_WRAPPER tool to sandbox cargo builds and execute jobs remotely
homepage
repositoryhttps://github.com/fenollp/supergreen
max_upload_size
id1056605
size122,707
Pierre Fenoll (fenollp)

documentation

README

rustcbuildx

Forwards rustc calls to BuildKit builders.

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

Configuration

Reads envs

  • $RUSTCBUILDX

  • $RUSTCBUILDX_BASE_IMAGE

  • $RUSTCBUILDX_BUILDER_IMAGE

  • $RUSTCBUILDX_CACHE_IMAGE

  • $RUSTCBUILDX_INCREMENTAL

  • $RUSTCBUILDX_LOG

  • $RUSTCBUILDX_LOG_PATH

  • $RUSTCBUILDX_LOG_STYLE

  • $RUSTCBUILDX_RUNNER

  • $RUSTCBUILDX_RUNS_ON_NETWORK

  • $RUSTCBUILDX_SYNTAX

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

Commit count: 51

cargo fmt