# eb-local.recipe_overlay ::::{zig:module} eb-local.recipe_overlay :file: src/recipe_overlay.zig :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig Declarative site overlays for upstream easyconfigs: parameter replacements, patch additions, dependency variants, keyed by the base file digest. :::: ## Types ::::{zig:type} eb-local.recipe_overlay.Parameter :signature: pub const Parameter = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L11 One parameter assignment to add to or replace in the upstream easyconfig. :::{zig:field} eb-local.recipe_overlay.Parameter.action :signature: action: []const u8 = "replace" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L12 ::: :::{zig:field} eb-local.recipe_overlay.Parameter.name :signature: name: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L13 ::: :::{zig:field} eb-local.recipe_overlay.Parameter.value :signature: value: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L14 ::: :::: ::::{zig:type} eb-local.recipe_overlay.Patch :signature: pub const Patch = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L18 One patch tuple to append to `patches`. :::{zig:field} eb-local.recipe_overlay.Patch.name :signature: name: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L19 ::: :::{zig:field} eb-local.recipe_overlay.Patch.file :signature: file: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L20 ::: :::: ::::{zig:type} eb-local.recipe_overlay.Dependency :signature: pub const Dependency = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L24 One dependency variant to add or replace. :::{zig:field} eb-local.recipe_overlay.Dependency.action :signature: action: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L25 ::: :::{zig:field} eb-local.recipe_overlay.Dependency.name :signature: name: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L26 ::: :::{zig:field} eb-local.recipe_overlay.Dependency.spec :signature: spec: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L27 ::: :::: ::::{zig:type} eb-local.recipe_overlay.Spec :signature: pub const Spec = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L31 A parsed overlay description; only the fields the format allows. :::{zig:field} eb-local.recipe_overlay.Spec.overlay_version :signature: overlay_version: i64 = 1 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L32 ::: :::{zig:field} eb-local.recipe_overlay.Spec.base_easyconfig :signature: base_easyconfig: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L33 ::: :::{zig:field} eb-local.recipe_overlay.Spec.base_digest :signature: base_digest: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L34 ::: :::{zig:field} eb-local.recipe_overlay.Spec.rationale :signature: rationale: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L35 ::: :::{zig:field} eb-local.recipe_overlay.Spec.parameters :signature: parameters: []const Parameter = &.{} :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L36 ::: :::{zig:field} eb-local.recipe_overlay.Spec.patches :signature: patches: []const Patch = &.{} :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L37 ::: :::{zig:field} eb-local.recipe_overlay.Spec.dependencies :signature: dependencies: []const Dependency = &.{} :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L38 ::: :::: ::::{zig:type} eb-local.recipe_overlay.Diagnostic :signature: pub const Diagnostic = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L42 Where an overlay file or materialization was refused. :::{zig:field} eb-local.recipe_overlay.Diagnostic.line :signature: line: usize = 0 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L43 ::: :::{zig:field} eb-local.recipe_overlay.Diagnostic.message :signature: message: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L44 ::: :::: ::::{zig:type} eb-local.recipe_overlay.MaterializeOptions :signature: pub const MaterializeOptions = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L733 Paths for `overlay materialize`. :::{zig:field} eb-local.recipe_overlay.MaterializeOptions.overlay_path :signature: overlay_path: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L734 ::: :::{zig:field} eb-local.recipe_overlay.MaterializeOptions.base_path :signature: base_path: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L735 ::: :::{zig:field} eb-local.recipe_overlay.MaterializeOptions.out_dir :signature: out_dir: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L736 ::: :::{zig:field} eb-local.recipe_overlay.MaterializeOptions.dry_run :signature: dry_run: bool = false :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L737 ::: :::{zig:field} eb-local.recipe_overlay.MaterializeOptions.check :signature: check: bool = false :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L738 ::: :::: ## Error sets ::::{zig:errorset} eb-local.recipe_overlay.Error :signature: pub const Error = error{...} :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L48 Refusal reasons while parsing or materializing an overlay. :::{zig:error} eb-local.recipe_overlay.Error.Invalid :signature: error.Invalid ::: :::{zig:error} eb-local.recipe_overlay.Error.DigestMismatch :signature: error.DigestMismatch ::: :::{zig:error} eb-local.recipe_overlay.Error.OutOfMemory :signature: error.OutOfMemory ::: :::: ## Functions :::{zig:function} eb-local.recipe_overlay.parseSpec :signature: pub fn parseSpec(a: Allocator, text: []const u8, d: *Diagnostic) Error!Spec :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L174 Read overlay TOML from `text`. Tables `[add]`, `[replace]`, `[patches]`, `[dependencies.add]` and `[dependencies.replace]` hold the edits. ::: :::{zig:function} eb-local.recipe_overlay.sha256Hex :signature: pub fn sha256Hex(a: Allocator, data: []const u8) ![]const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L285 SHA-256 of `data` as lowercase hex, for digests in overlay files. ::: :::{zig:function} eb-local.recipe_overlay.materialize :signature: pub fn materialize(a: Allocator, base_text: []const u8, spec: Spec, d: *Diagnostic) Error![]u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L699 Apply `spec` to `base_text`. Refuses when the digest of `base_text` differs from `spec.base_digest`. ::: :::{zig:function} eb-local.recipe_overlay.runMaterialize :signature: pub fn runMaterialize(io: std.Io, a: Allocator, opts: MaterializeOptions) u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/recipe_overlay.zig#L866 Read overlay and base files, verify the digest, and write, preview, or check the outputs. :::