build: exact per-binary imports — the pre-wired default set is gone

Every binary's build.zig now names precisely the modules its source
imports (derived by scanning each artifact's sources, transitively
through same-directory files), and its zon carries only the domains
those come from — kernel stays implicit (the root shim + link script
live there). build-support's userBinary resolves each name through one
module-to-domain table (module_homes); Domains/domains()/defaultImports
and the raw recipe entry point are deleted. An undeclared @import is a
compile error (verified: injecting @import("xkeyboard-config") into
logger fails with 'no module named ... available within module
program'), and e.g. xkeyboard-config now appears in exactly two
manifests — the two keyboard drivers. Availability never bloated the
emitted binaries (Zig compiles only what a program imports); this makes
the declared interfaces honest. Production and -Dtest-case manifests
byte-identical; all build variants and standalone package builds
green.
This commit is contained in:
Daniel Samson
2026-07-30 06:42:31 +01:00
parent c621b649f6
commit 4476208361
60 changed files with 401 additions and 450 deletions
+7 -9
View File
@@ -1,7 +1,6 @@
//! The pci-bus driver as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to pci-bus — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact for the boot image.
//! The pci-bus driver as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
@@ -10,11 +9,10 @@ pub fn build(b: *std.Build) void {
const exe = build_support.userBinary(b, .{
.name = "pci-bus",
.root_source_file = b.path("pci-bus.zig"),
.domains = build_support.domains(b),
.imports = &.{
"device-manager-protocol", "driver", "ipc", "logging", "memory", "pci-class",
"process", "service",
},
});
// The bus driver reports discovered functions to the device manager, and
// decodes each function's class triple to human names in its boot log.
build_support.programModule(exe).addImport("device-manager-protocol", b.dependency("protocol", .{}).module("device-manager-protocol"));
build_support.programModule(exe).addImport("pci-class", b.dependency("device", .{}).module("pci-class"));
b.installArtifact(exe);
}
+3 -2
View File
@@ -4,11 +4,12 @@
.fingerprint = 0x283fca121f0bb145, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.protocol = .{ .path = "../../../library/protocol" },
},
.paths = .{""},
+12 -11
View File
@@ -1,35 +1,36 @@
//! The ps2-bus driver as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The ps2-bus driver as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
pub fn build(b: *std.Build) void {
const protocol = b.dependency("protocol", .{});
const ps2_bus_exe = build_support.userBinary(b, .{
.name = "ps2-bus",
.root_source_file = b.path("ps2-bus.zig"),
.domains = build_support.domains(b),
.imports = &.{ "acpi-ids", "driver", "ipc", "logging", "memory", "process", "service", "time" },
});
b.installArtifact(ps2_bus_exe);
const ps2_keyboard_exe = build_support.userBinary(b, .{
.name = "ps2-keyboard",
.root_source_file = b.path("keyboard.zig"),
.domains = build_support.domains(b),
.imports = &.{
"acpi-ids", "driver", "input", "input-protocol", "ipc", "logging", "memory",
"process", "time", "xkeyboard-config",
},
});
build_support.programModule(ps2_keyboard_exe).addImport("input-protocol", protocol.module("input-protocol"));
b.installArtifact(ps2_keyboard_exe);
const ps2_mouse_exe = build_support.userBinary(b, .{
.name = "ps2-mouse",
.root_source_file = b.path("mouse.zig"),
.domains = build_support.domains(b),
.imports = &.{
"acpi-ids", "driver", "input", "input-protocol", "ipc", "logging", "memory",
"process", "time",
},
});
build_support.programModule(ps2_mouse_exe).addImport("input-protocol", protocol.module("input-protocol"));
b.installArtifact(ps2_mouse_exe);
// Standalone `zig build test`; the root aggregate depends on this step.
+5 -2
View File
@@ -4,12 +4,15 @@
.fingerprint = 0x642a365353bf7de9, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.device = .{ .path = "../../../library/device" },
.protocol = .{ .path = "../../../library/protocol" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
},
.paths = .{""},
}
+11 -15
View File
@@ -1,33 +1,29 @@
//! The usb-hid driver as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The usb-hid driver as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
pub fn build(b: *std.Build) void {
const protocol = b.dependency("protocol", .{});
const device = b.dependency("device", .{});
const usb_hid_keyboard_exe = build_support.userBinary(b, .{
.name = "usb-hid-keyboard",
.root_source_file = b.path("keyboard.zig"),
.domains = build_support.domains(b),
.imports = &.{
"driver", "input", "input-protocol", "ipc", "logging", "process", "service", "usb",
"usb-abi", "xkeyboard-config",
},
});
build_support.programModule(usb_hid_keyboard_exe).addImport("usb", device.module("usb"));
build_support.programModule(usb_hid_keyboard_exe).addImport("usb-abi", device.module("usb-abi"));
build_support.programModule(usb_hid_keyboard_exe).addImport("input-protocol", protocol.module("input-protocol"));
b.installArtifact(usb_hid_keyboard_exe);
const usb_hid_mouse_exe = build_support.userBinary(b, .{
.name = "usb-hid-mouse",
.root_source_file = b.path("mouse.zig"),
.domains = build_support.domains(b),
.imports = &.{
"driver", "input", "input-protocol", "ipc", "logging", "process", "service", "usb",
"usb-abi",
},
});
build_support.programModule(usb_hid_mouse_exe).addImport("usb", device.module("usb"));
build_support.programModule(usb_hid_mouse_exe).addImport("usb-abi", device.module("usb-abi"));
build_support.programModule(usb_hid_mouse_exe).addImport("input-protocol", protocol.module("input-protocol"));
b.installArtifact(usb_hid_mouse_exe);
// Standalone `zig build test`; the root aggregate depends on this step.
+5 -2
View File
@@ -4,12 +4,15 @@
.fingerprint = 0x66328b738fffff01, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.device = .{ .path = "../../../library/device" },
.protocol = .{ .path = "../../../library/protocol" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
},
.paths = .{""},
}
+7 -10
View File
@@ -1,22 +1,19 @@
//! The usb-storage driver as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The usb-storage driver as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
pub fn build(b: *std.Build) void {
const protocol = b.dependency("protocol", .{});
const device = b.dependency("device", .{});
const exe = build_support.userBinary(b, .{
.name = "usb-storage",
.root_source_file = b.path("usb-storage.zig"),
.domains = build_support.domains(b),
.imports = &.{
"block-protocol", "driver", "ipc", "logging", "memory", "process", "service",
"time", "usb",
},
});
build_support.programModule(exe).addImport("usb", device.module("usb"));
build_support.programModule(exe).addImport("block-protocol", protocol.module("block-protocol"));
b.installArtifact(exe);
// Standalone `zig build test`; the root aggregate depends on this step.
+3 -2
View File
@@ -4,11 +4,12 @@
.fingerprint = 0xce09fdc4c50bb4fe, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.protocol = .{ .path = "../../../library/protocol" },
},
.paths = .{""},
+7 -13
View File
@@ -1,24 +1,18 @@
//! The usb-xhci-bus driver as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The usb-xhci-bus driver as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
pub fn build(b: *std.Build) void {
const protocol = b.dependency("protocol", .{});
const device = b.dependency("device", .{});
const exe = build_support.userBinary(b, .{
.name = "usb-xhci-bus",
.root_source_file = b.path("usb-xhci-bus.zig"),
.domains = build_support.domains(b),
.imports = &.{
"device-manager-protocol", "driver", "input", "ipc", "logging", "memory", "mmio",
"pci", "process", "service", "time", "usb-abi", "usb-ids", "usb-transfer-protocol",
},
});
build_support.programModule(exe).addImport("device-manager-protocol", protocol.module("device-manager-protocol"));
build_support.programModule(exe).addImport("pci", device.module("pci"));
build_support.programModule(exe).addImport("usb-abi", device.module("usb-abi"));
build_support.programModule(exe).addImport("usb-ids", device.module("usb-ids"));
build_support.programModule(exe).addImport("usb-transfer-protocol", protocol.module("usb-transfer-protocol"));
b.installArtifact(exe);
}
+4 -2
View File
@@ -4,11 +4,13 @@
.fingerprint = 0x46d21373f05f6b20, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.device = .{ .path = "../../../library/device" },
.protocol = .{ .path = "../../../library/protocol" },
},
.paths = .{""},
+7 -11
View File
@@ -1,23 +1,19 @@
//! The virtio-gpu driver as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The virtio-gpu driver as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
pub fn build(b: *std.Build) void {
const protocol = b.dependency("protocol", .{});
const device = b.dependency("device", .{});
const exe = build_support.userBinary(b, .{
.name = "virtio-gpu",
.root_source_file = b.path("virtio-gpu.zig"),
.domains = build_support.domains(b),
.imports = &.{
"display-protocol", "driver", "ipc", "logging", "memory", "mmio", "pci", "process",
"scanout-protocol", "service", "time",
},
});
build_support.programModule(exe).addImport("pci", device.module("pci"));
build_support.programModule(exe).addImport("display-protocol", protocol.module("display-protocol"));
build_support.programModule(exe).addImport("scanout-protocol", protocol.module("scanout-protocol"));
b.installArtifact(exe);
// Standalone `zig build test`; the root aggregate depends on this step.
+3 -2
View File
@@ -4,11 +4,12 @@
.fingerprint = 0xfb704899c18b9a23, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.protocol = .{ .path = "../../../library/protocol" },
},
.paths = .{""},
+11 -13
View File
@@ -1,8 +1,10 @@
//! The acpi discovery service as a binary package (docs/build-packages-plan.md,
//! phase 2). The artifact is named "discovery": one swappable process per
//! firmware fills the ramdisk's neutral `discovery` slot (docs/discovery.md),
//! so the device manager never learns which firmware it is on. The root
//! build's -Ddiscovery picks this package or `fdt`.
//! The acpi service as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
//!
//! The artifact is named "discovery": one swappable process per firmware
//! fills the ramdisk's neutral `discovery` slot (docs/discovery.md); the
//! root's -Ddiscovery picks this package or `fdt`.
const std = @import("std");
const build_support = @import("build-support");
@@ -11,14 +13,10 @@ pub fn build(b: *std.Build) void {
const exe = build_support.userBinary(b, .{
.name = "discovery",
.root_source_file = b.path("acpi.zig"),
.domains = build_support.domains(b),
.imports = &.{
"acpi-ids", "aml", "device-manager-protocol", "driver", "ipc", "logging", "memory",
"power-protocol", "process", "service", "time",
},
});
const protocol = b.dependency("protocol", .{});
// The shared AML interpreter (the same parser the kernel runs), the
// device-manager report channel, and the power protocol (the SCI/power
// button path, docs/power.md).
build_support.programModule(exe).addImport("aml", b.dependency("device", .{}).module("aml"));
build_support.programModule(exe).addImport("device-manager-protocol", protocol.module("device-manager-protocol"));
build_support.programModule(exe).addImport("power-protocol", protocol.module("power-protocol"));
b.installArtifact(exe);
}
+3 -2
View File
@@ -4,11 +4,12 @@
.fingerprint = 0xf31e9a0903256b64, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.protocol = .{ .path = "../../../library/protocol" },
},
.paths = .{""},
+7 -10
View File
@@ -1,21 +1,18 @@
//! The device-manager service as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The device-manager service as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
pub fn build(b: *std.Build) void {
const protocol = b.dependency("protocol", .{});
const device = b.dependency("device", .{});
const exe = build_support.userBinary(b, .{
.name = "device-manager",
.root_source_file = b.path("device-manager.zig"),
.domains = build_support.domains(b),
.imports = &.{
"device-manager-protocol", "device-registry", "driver", "file-system", "ipc",
"logging", "memory", "process", "service", "time",
},
});
build_support.programModule(exe).addImport("device-manager-protocol", protocol.module("device-manager-protocol"));
build_support.programModule(exe).addImport("device-registry", device.module("device-registry"));
b.installArtifact(exe);
}
+3 -2
View File
@@ -4,11 +4,12 @@
.fingerprint = 0x7092fc24905cd147, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.protocol = .{ .path = "../../../library/protocol" },
},
.paths = .{""},
+4 -5
View File
@@ -1,7 +1,6 @@
//! The display-demo service as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The display-demo service as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
@@ -10,7 +9,7 @@ pub fn build(b: *std.Build) void {
const exe = build_support.userBinary(b, .{
.name = "display-demo",
.root_source_file = b.path("display-demo.zig"),
.domains = build_support.domains(b),
.imports = &.{ "display", "logging", "time" },
});
b.installArtifact(exe);
}
+3 -2
View File
@@ -4,11 +4,12 @@
.fingerprint = 0x5d2832e1e2880143, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
},
.paths = .{""},
}
+7 -9
View File
@@ -1,22 +1,20 @@
//! The display service as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The display service as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
pub fn build(b: *std.Build) void {
const protocol = b.dependency("protocol", .{});
const exe = build_support.userBinary(b, .{
.name = "display",
.root_source_file = b.path("display.zig"),
.domains = build_support.domains(b),
.imports = &.{
"display", "display-protocol", "driver", "input", "ipc", "logging", "memory",
"scanout-protocol", "service", "thread", "time",
},
.threaded = true, // real atomics/TLS (docs/threading.md)
});
build_support.programModule(exe).addImport("display-protocol", protocol.module("display-protocol"));
build_support.programModule(exe).addImport("scanout-protocol", protocol.module("scanout-protocol"));
b.installArtifact(exe);
// Standalone `zig build test`; the root aggregate depends on this step.
+4 -2
View File
@@ -4,11 +4,13 @@
.fingerprint = 0xcd172a34b127a19, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.device = .{ .path = "../../../library/device" },
.protocol = .{ .path = "../../../library/protocol" },
},
.paths = .{""},
+7 -8
View File
@@ -1,20 +1,19 @@
//! The fat service as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The fat service as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
pub fn build(b: *std.Build) void {
const protocol = b.dependency("protocol", .{});
const exe = build_support.userBinary(b, .{
.name = "fat",
.root_source_file = b.path("fat.zig"),
.domains = build_support.domains(b),
.imports = &.{
"block", "file-system", "ipc", "logging", "memory", "process", "service", "time",
"vfs-protocol",
},
});
build_support.programModule(exe).addImport("vfs-protocol", protocol.module("vfs-protocol"));
b.installArtifact(exe);
// Standalone `zig build test`; the root aggregate depends on this step.
+3 -2
View File
@@ -4,11 +4,12 @@
.fingerprint = 0x98958143ecfe1636, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.protocol = .{ .path = "../../../library/protocol" },
},
.paths = .{""},
+9 -6
View File
@@ -1,8 +1,11 @@
//! The fdt discovery service as a binary package (docs/build-packages-plan.md,
//! phase 2). The artifact is named "discovery" like acpi's: the Raspberry Pis
//! hand over a flattened device tree instead of ACPI, and the aarch64 target
//! flips the root build's -Ddiscovery default when it lands (docs/arm.md).
//! A placeholder until the ARM bring-up.
//! The fdt service as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
//!
//! The artifact is named "discovery" like acpi's: the Raspberry Pis hand over
//! a flattened device tree, and the aarch64 target flips the root's
//! -Ddiscovery default when it lands (docs/arm.md). A placeholder until the
//! ARM bring-up.
const std = @import("std");
const build_support = @import("build-support");
@@ -11,7 +14,7 @@ pub fn build(b: *std.Build) void {
const exe = build_support.userBinary(b, .{
.name = "discovery",
.root_source_file = b.path("fdt.zig"),
.domains = build_support.domains(b),
.imports = &.{ "process" },
});
b.installArtifact(exe);
}
+3 -3
View File
@@ -4,11 +4,11 @@
.fingerprint = 0xe5e27506c7fc2eea, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
},
.paths = .{""},
}
+8 -11
View File
@@ -1,7 +1,7 @@
//! init (PID 1) as a binary package (docs/build-packages-plan.md, phase 2):
//! this file names only what is specific to init — the shared recipe and the
//! default-import wiring live in build-support. The root build consumes the
//! artifact for the boot image and forwards its -Dserial here.
//! init (PID 1) as a binary package (docs/build-packages-plan.md): this file
//! names the binary and EXACTLY the modules its source imports — the shared
//! recipe and the module-to-domain map live in build-support. The root build
//! consumes the artifact for the boot image and forwards its -Dserial here.
const std = @import("std");
const build_support = @import("build-support");
@@ -10,14 +10,11 @@ pub fn build(b: *std.Build) void {
const exe = build_support.userBinary(b, .{
.name = "init",
.root_source_file = b.path("init.zig"),
.domains = build_support.domains(b),
.imports = &.{
"csv", "file-system", "ipc", "logging", "memory", "power-protocol",
"process", "time",
},
});
// init speaks the power protocol (orderly shutdown, docs/power.md) and
// parses its boot service list from /etc/init.csv with the shared csv
// helpers. Which services it starts is data, not a compile-time option:
// the root build selects which init.csv variant is bundled (-Ddiagnose).
build_support.programModule(exe).addImport("power-protocol", b.dependency("protocol", .{}).module("power-protocol"));
build_support.programModule(exe).addImport("csv", b.dependency("csv", .{}).module("csv"));
// init reads the same `serial` flag the kernel does: its liveness heartbeat
// is a serial/test-build diagnostic (the QEMU harness's init tests assert
// on it, and -Dserial images emit it), so a flashable image runs a purely
+4 -4
View File
@@ -4,13 +4,13 @@
.fingerprint = 0xc674e474eeeced43, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.protocol = .{ .path = "../../../library/protocol" },
.csv = .{ .path = "../../../library/csv" },
.protocol = .{ .path = "../../../library/protocol" },
},
.paths = .{""},
}
+4 -8
View File
@@ -1,19 +1,15 @@
//! The input service as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The input service as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
pub fn build(b: *std.Build) void {
const protocol = b.dependency("protocol", .{});
const exe = build_support.userBinary(b, .{
.name = "input",
.root_source_file = b.path("input.zig"),
.domains = build_support.domains(b),
.imports = &.{ "input", "input-protocol", "ipc", "logging", "process", "service" },
});
build_support.programModule(exe).addImport("input-protocol", protocol.module("input-protocol"));
b.installArtifact(exe);
}
+3 -2
View File
@@ -4,11 +4,12 @@
.fingerprint = 0xd82832d7113ed94e, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
.protocol = .{ .path = "../../../library/protocol" },
},
.paths = .{""},
+4 -5
View File
@@ -1,7 +1,6 @@
//! The logger service as a binary package (docs/build-packages-plan.md,
//! phase 2): this file names only what is specific to this binary — the shared
//! recipe and the default-import wiring live in build-support. The root build
//! consumes the artifact(s) for the boot image.
//! The logger service as a binary package (docs/build-packages-plan.md):
//! this file names the binary and EXACTLY the modules its source imports —
//! the shared recipe and the module-to-domain map live in build-support.
const std = @import("std");
const build_support = @import("build-support");
@@ -10,7 +9,7 @@ pub fn build(b: *std.Build) void {
const exe = build_support.userBinary(b, .{
.name = "logger",
.root_source_file = b.path("logger.zig"),
.domains = build_support.domains(b),
.imports = &.{ "file-system", "ipc", "logging", "service", "time" },
});
b.installArtifact(exe);
}
+3 -3
View File
@@ -4,11 +4,11 @@
.fingerprint = 0x987e13f37b0eaea2, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
// build-support supplies the shared recipe; kernel is implicit in
// every binary (the root shim + link script live there). The rest
// are exactly the homes of this binary's declared imports.
.@"build-support" = .{ .path = "../../../build-support" },
.kernel = .{ .path = "../../../library/kernel" },
.device = .{ .path = "../../../library/device" },
.client = .{ .path = "../../../library/client" },
.@"xkeyboard-config" = .{ .path = "../../../library/xkeyboard-config" },
},
.paths = .{""},
}