Module env_compat

Module env_compat 

Source
Expand description

Backwards compatibility shim for the ATLAS_* to AVAROK_* env rename.

The repo-wide rebrand moved every variable the server reads from ATLAS_* to AVAROK_*, but the CLI that launches the server lives in a different repository and still exports the old names (recipes set things like ATLAS_MTP_DCUT_RATIO, ATLAS_FP8_ROWWISE, ATLAS_GDN_FLASHINFER, ATLAS_GDN_LIB and ATLAS_TARGET_MODEL; the agent sets ATLAS_HOME). Without this shim a server built from the renamed tree ignores all of them silently, which looks exactly like a recipe that does nothing.

mirror_legacy_env copies each legacy name onto its new name at process startup, so the ~440 std::env::var("AVAROK_...") reads scattered across the crates need no per-site fallback.

REMOVAL POINT: delete this module, its call sites in main, and the ATLAS_SKIP_BUILD fallback in avarok-kernels/build.rs once the CLI ships AVAROK_* names and no supported release still emits ATLAS_*.

Functionsยง

mirror_legacy_env
Mirror every ATLAS_* variable onto its AVAROK_* name when the new name is unset. Returns the mirrored keys (new names). Must run before any thread is spawned; call it first thing in main.