Skip to main content

BUILDER_STAGES

Constant BUILDER_STAGES 

Source
pub const BUILDER_STAGES: [&str; 6];
Expand description

The stages of the builder, in order, before the runtime stage. Each is a layer cache boundary, and what invalidates each is the point of the split:

  • toolchain: the pinned Rust image, the C library headers and sccache, which every later cargo runs behind (see SCCACHE_DIR); only a toolchain pin moves it.
  • recipe: the package’s manifest and lockfile with the package’s own version masked and its bench, test and example targets dropped. Its output, not the files it reads, is what the next stage copies, so a release that bumps only the version reaches the same recipe and does not recompile a dependency.
  • deps: every dependency downloaded and compiled against stub sources, in the profile, features and target of the real build. It is ordinary layer content — unlike a --mount=type=cache directory, which a registry cache export never carries — so a fresh runner that imports the cache gets the compiled dependencies too.
  • build: the real sources over the compiled dependencies; only the package itself compiles. The commit arguments live here and nowhere earlier, so a new commit never reaches a dependency.
  • release: a release’s own published executable, taken from the release-binary build context (RELEASE_CONTEXT) instead of compiled; see BINARY_ARG.
  • binary: whichever of build and release BINARY_ARG names — the one stage the runtime takes its executable from, so the runtime is the same whatever made the binary.