lib/choir/src/product/compiler.zig

daab053ee43316e1809a84551d573ddd1e5bf3d2

 1 const std = @import("std");
 2 const generated = @import("__tiny_compiled_inputs_v1");
 3 
 4 pub const refusal: ?[]const u8 = if (generated.qualified) null else generated.refusal;
 5 
 6 /// Only the final build graph can provide this foreign-input record.
 7 /// An unrecorded build remains usable for transient compiler work.
 8 pub fn manifest() error{UnrecordedCompilerBuild}![]const u8 {
 9     if (!generated.qualified) return error.UnrecordedCompilerBuild;
10     return generated.bytes;
11 }
12 
13 test "sealed compiler inputs are supplied by the final build graph" {
14     const bytes = try manifest();
15     try std.testing.expect(std.mem.startsWith(u8, bytes, "tiny.compiled-inputs/v1"));
16     try std.testing.expect(bytes.len > 32);
17 }