cabinpkg-env 0.15.0

Environment variable conventions for Cabin
Documentation
  • Coverage
  • 95.92%
    47 out of 49 items documented0 out of 8 items with examples
  • Size
  • Source code size: 31.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 725.78 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • cabinpkg/cabin
    1454 92 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ken-matsui

CABIN_* environment variable name constants and the typed builder for the cabin run / cabin test package-execution overlay.

Cabin is Cargo-inspired (not Cargo-compatible): the env vars it reads on the input side and the env vars it sets on the output side both follow Cargo's naming conventions where the semantics line up, and diverge with CABIN_* names where Cabin's C/C++ semantics differ. This crate is the single source of truth for both halves so the rest of the codebase agrees on names.

Crate boundaries:

  • this crate must not run processes, read configuration files, or touch the filesystem;
  • it must not depend on cabin, cabin-build, or other higher-level crates that would create cyclic dependencies;
  • it consumes typed inputs and produces typed outputs (the orchestration layer is responsible for mapping resolved values into [PackageEnvInputs]).

Read-side env vars

Constants for every CABIN_* variable Cabin's CLI reads live as pub const ... : &str = "..." in this crate. The orchestration layer reads each one through std::env::var (or an injected env_fn for tests) and threads the value through to the right resolver.

Run / test overlay

cabin run and cabin test inject exactly the same small, stable set of package-execution variables built by [package_env]. The overlay is layered on top of the inherited environment; it never clears the user's PATH, LANG, etc.