rules/workflows/lockfiles.js
Developer reference: this page includes exported implementation details. BUILD authors should prefer the User API reference.
GEN_LOCKFILES
const GEN_LOCKFILES
Token for the per-toolchain lockfile-generation product; toolchain rule modules register it via product(SomeToolchain, GEN_LOCKFILES, ...).
registerBuiltinLockfile()
registerBuiltinLockfile(spec)
Register the shipped (checked-in, embedded) lockfile for a toolchain. Called once at module load by each toolchain rule module; consumed by the gen-builtin-lockfiles goal. versions is authoritative — regeneration writes exactly these versions, so bumping, downgrading support, and pruning are all edits to this list. handle, plus versions: string[]; lockfile is required.
| Parameter | Type | Description |
|---|---|---|
| spec | object | Same shape as generateToolLockfile's opts minus |
builtinLockfiles()
builtinLockfiles()
Registered builtin lockfile specs, in registration order.
registerToolchainLockfile()
registerToolchainLockfile(spec, versions)
Register a toolchain's builtin (checked-in) lockfile and return the spec for the caller's own product(SomeToolchain, GEN_LOCKFILES, tool, ..., { display: "gen lockfiles {0}", level: "info" }) registration — every toolchain rule module otherwise repeats the registerBuiltinLockfile({ ...spec, versions }) line verbatim. Deliberately does not also register the gen-lockfiles product itself: module attribution for capability docs is derived by walking the JS call stack back to the first //rules/ frame (see product()'s docs), so product() must still be called directly from each toolchain's own module — routing it through this shared helper would misattribute every toolchain's registration to //rules/workflows instead of its own language group. handle.
| Parameter | Type | Description |
|---|---|---|
| spec | object | Same shape as generateToolLockfile's opts minus |
| versions | string[] | Versions the shipped lockfile should pin. |
Returns: object spec, for the caller's own generateToolLockfile call.