Skip to content

`RUSTC_WRAPPER` that uses `docker buildx build`

License

Notifications You must be signed in to change notification settings

fenollp/supergreen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Faster Rust builds!

  • cargo-green: Cargo plugin and $RUSTC_WRAPPER to sandbox, cache & remote exec cargo builds

A rusty crab character named Ferris, featuring a unique hairstyle resembling 'Ruby Road', a vibrant and textured hairdo often seen in flamboyant red

Goals

  • seamlessly build on another machine (with more cores, more cache)
    • support remote builds by setting env DOCKER_HOST= with e.g. ssh://me@beaffy-machine.internal.net
      • Build cache is saved remotely, artifacts are saved locally
      • Tests building happens on remote machine, execution happens on local machine
  • seamlessly integrate with normal cargo usage
    • only pull sources from local filesystem
    • produce the same intermediary artefacts as local cargo does
    • fallback to normal, local rustc anytime
      • switching from this wrapper back to local rustc does necessitate a fresh build
  • wrap rustc calls in buildkit-like calls (docker, podman)
    • docker
    • podman
    • deps compatibility
      • handle Rust-only deps
      • handle all the other deps (expand this list) (use crater)
        • C deps
        • ...
    • runner compatibility
      • set .dockerignores (to be authoritative on srcs)
    • trace these outputs (STDOUT/STDERR) for debugging
  • available as a rustc wrapper through $RUSTC_WRAPPER
  • available as a cargo subcommand
    • configuration profiles (user, team, per-workspace, per-crate, CI, ...)
    • seamlessly use current/local rustc version
      • support overriding rustc base image
    • seamlessly use current/local tools (mold, ...)
      • config expressions on top of base image config?
      • just suggest an inline Dockerfile stage?
    • support CRUD-ish operations on local/remotes cache
    • [SEC] support building a crate without it having network access
  • integrate with shipping OCI images
  • share cache with the World cf. user-wide-cache
    • never rebuild a dep (for a given version of rustc, ...)
    • share cache with other projects on local machine
      • fix WORKDIRs + rewrite paths with remap-path-prefix
    • share cache with CI and team
      • share cache with CI (at least for a single user)
    • [SEC] ensure private deps don't leak through/to cache
    • CLI gives the Dockerfile that cargo install's any crate
  • suggest a global cache -faciliting configuration profile
  • integrate with cross
    • build for a non-local target

Upstream issues & patches

Origins

Hacking

See ./hack/