exfat.zig is a near-clone of fat.zig — the reuse the architecture promised, now real: same IpcBlock DMA-bounce wrapper, same acquire-volume-by-hello to the volume manager, same content-conditional boot rewrites (resolve /system/configuration to decide the system volume), all differences confined to the engine it wraps. That the harness's Server(engine.FileSystem) compiles is the proof the exFAT engine meets the same pub-fn contract as FAT — a comptime check, not a hope. The exfat package (build.zig + build.zig.zon) mirrors fat's: it ships in production_ship, its on-disk + engine host tests run through the root test aggregate (replacing the temporary standalone entry), and the root zon declares it. build + zig build test + bounds all green.
35 lines
1.3 KiB
Zig
35 lines
1.3 KiB
Zig
//! The exfat service as a binary package (docs/build-packages-plan.md):
|
|
//! this file names the binary and EXACTLY the modules its source imports —
|
|
//! build-support resolves each name from the domains this zon declares.
|
|
|
|
const std = @import("std");
|
|
const build_support = @import("build-support");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const exe = build_support.userBinary(b, .{
|
|
.name = "exfat",
|
|
.root_source_file = b.path("exfat.zig"),
|
|
.imports = &.{
|
|
"block", "channel", "envelope", "file-system-harness",
|
|
"ipc", "logging", "memory", "process",
|
|
"time", "volume-manager-protocol",
|
|
},
|
|
});
|
|
b.installArtifact(exe);
|
|
|
|
// Standalone `zig build test`; the root aggregate depends on this step.
|
|
const test_step = b.step("test", "Run the exfat unit tests");
|
|
for ([_][]const u8{
|
|
"on-disk.zig", // exFAT on-disk struct sizes + geometry + checksums
|
|
"engine.zig", // exFAT read/write over a RAM-backed image
|
|
}) |test_root| {
|
|
const unit_tests = b.addTest(.{
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path(test_root),
|
|
.target = b.resolveTargetQuery(.{}),
|
|
}),
|
|
});
|
|
test_step.dependOn(&b.addRunArtifact(unit_tests).step);
|
|
}
|
|
}
|