Expand description
Locate the bynkc compiler the driver shells, and report
driver↔compiler version skew.
Resolution order (ADR: introduce the bynk driver):
- an explicit override — the
BYNK_BYNKCenvironment variable (thebynk.executablePath-style escape hatch); bynkconPATH;- a
bynkcsibling of the runningbynkbinary (mirrors howvscode-bynkresolvesbynkc-lspnext to itself).
An explicit override wins when set — an override that only applied after
auto-discovery failed would be useless. The skew check exists because this
resolution can pick a bynkc whose version differs from the driver’s: once
they are separate binaries, a global bynk 0.46 can shell a stale bynkc 0.44, and doctor’s whole job is to surface exactly that.
Structs§
- Compiler
- A resolved (or unresolved)
bynkc. - Skew
Asker - Who is asking, for the message: the command’s name, and whether it takes
--allow-skew.
Enums§
- Origin
- How
bynkcwas located. - Skew
- Driver↔compiler version relationship. Patch differences are ignored (they are wire-compatible under the project’s unified versioning); a minor drift warns; a major drift is a contract mismatch and an error.
- Skew
Verdict - #1675: what a command that is about to run a second compiler does about
its skew from the driver — the same classification
doctorrenders, acted on. A secondbynkcruns on these paths:bynk testalways shells one, andbynk check,bynk fmt,bynk devandbynk deploydo under aBYNK_BYNKCoverride. Without this, a skewedbynkccould check, format or test the code with a different compiler, many increments apart, silently.
Constants§
- ALLOW_
SKEW_ ENV - #1675: the override for the skew gate below. Every gated command honours
it;
bynk testalso takes it as--allow-skew. Any non-empty value allows a skewedbynkc(the same “non-empty means set” contract as the CIBYNK_REQUIRE_*switches).
Functions§
- apply_
skew_ verdict - Print
verdict’s message (if any) and say whether to go ahead. A warning prints once per process:bynk devcompiles on every change, and the same skew would otherwise repeat for the whole watch session. - resolve
- Resolve
bynkcagainst aToolbox, given the override (typicallystd::env::var("BYNK_BYNKC")), the directory of the runningbynkbinary (for the sibling fallback), and the driver’s own version (to classify skew). - skew_
allowed_ by_ env - Whether the skew override is set in the environment.
- skew_
gate - #1675: the whole gate for a command about to run
compiler: the verdict, with the override fromflagorALLOW_SKEW_ENV, printed, and whether to go ahead. - skew_
verdict - Decide what
askerdoes aboutcompiler’s skew. Minor skew warns; major skew refuses unlessallow, in which case it warns instead.