diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-18 21:43:03 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-18 22:03:06 -0300 |
| commit | 92d553123673376adf6126ab90d49a22c5b833d2 (patch) | |
| tree | 2a4e83a7e5a0d8766358ce87ccebba72b95f9a2a /build/core.zig | |
| parent | f9a3179542012ec1a700e2020ac9f616b819f972 (diff) | |
| download | pardes-92d553123673376adf6126ab90d49a22c5b833d2.tar.gz pardes-92d553123673376adf6126ab90d49a22c5b833d2.zip | |
abi: plain.zig and term.zig, the addon header and its Zig module, pardes.h and the replica stream's wire into abi/ (the reorganisation's tree, step 2c; abi.zig, the seam, is step 12's): plain, the addon's and pardes.h's modules as before from their new place, the wire a module of its own (`wire`, named by the core, the runtime and main.zig); shell-test runs the wire's tests on the core's set, since a window's set links the window's C, whose allocator gui.zig holds; nothing else changes: the ledger, frames byte-identical, replicas and process-test the base's
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'build/core.zig')
| -rw-r--r-- | build/core.zig | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/build/core.zig b/build/core.zig index 56a047c0..26de1669 100644 --- a/build/core.zig +++ b/build/core.zig @@ -250,7 +250,7 @@ pub fn editorModule(b: *std.Build, name: ?[]const u8, target: std.Build.Resolved var lib_cfg = cfg; lib_cfg.lib = true; m.addOptions("pardes_config", shellOptions(b, lib_cfg, .tui)); - m.addImport("plain", b.createModule(.{ .target = target, .optimize = optimize, .root_source_file = b.path("src/plain/plain.zig") })); + m.addImport("plain", b.createModule(.{ .target = target, .optimize = optimize, .root_source_file = b.path("abi/plain.zig") })); m.addImport("generated_themes", d.themes); d.ts.wire(m); m.addImport("mvzr", d.mvzr); @@ -274,7 +274,7 @@ pub const Parts = struct { pdf: ?*std.Build.Module, term: *std.Build.Module, plain: *std.Build.Module, - /// The kinds' C ABI (src/kinds/pardes_addon.h), translated. + /// The kinds' C ABI (abi/pardes_addon.h), translated. kind: *std.Build.Module, themes: *std.Build.Module, ts: TreeSitter, @@ -318,8 +318,9 @@ pub const Core = struct { util: bool = false, }; -/// What `module` makes: the core, the devices and the runtime, each naming -/// the others (`core`, `dev`, `runtime`), and the module a compile roots at. +/// What `module` makes: the core, the devices, the runtime and the replica +/// stream's wire (abi/wire.zig), each naming the others (`core`, `dev`, +/// `runtime`, `wire`), and the module a compile roots at. pub const Modules = struct { /// A product's own file (runtime/main.zig, runtime/macos.zig) naming /// both, the runtime, or the core. @@ -327,6 +328,7 @@ pub const Modules = struct { core: *std.Build.Module, dev: *std.Build.Module, runtime: *std.Build.Module, + wire: *std.Build.Module, }; /// A core and the devices and runtime beside it, everything they import @@ -361,6 +363,7 @@ pub fn module(b: *std.Build, p: Parts, c: Core) Modules { m.addAnonymousImport(f, .{ .root_source_file = b.path(f) }); const runtime = b.createModule(.{ .target = p.target, .optimize = p.optimize, .root_source_file = b.path("runtime/root.zig"), .link_libc = true }); const dev = b.createModule(.{ .target = p.target, .optimize = p.optimize, .root_source_file = b.path("dev/root.zig"), .link_libc = true }); + const wire = b.createModule(.{ .target = p.target, .optimize = p.optimize, .root_source_file = b.path("abi/wire.zig"), .link_libc = true }); const root = if (!in_runtime) m else if (std.mem.eql(u8, c.root, "runtime/root.zig")) runtime else b.createModule(.{ .target = p.target, .optimize = p.optimize, .root_source_file = b.path(c.root), .link_libc = true }); // Each options module once, so that the modules share it: a file is in // one module of a compilation. @@ -370,7 +373,7 @@ pub fn module(b: *std.Build, p: Parts, c: Core) Modules { const pardes_config = c.config.createModule(); const pardes_isolation = (if (c.isolated) p.iso_on else p.iso_off).createModule(); const builtin_addons = (if (c.builtin_addons) p.builtin_on else p.builtin_off).createModule(); - for ([_]*std.Build.Module{ m, dev, runtime, root }) |x| { + for ([_]*std.Build.Module{ m, dev, runtime, wire, root }) |x| { x.addImport("cloud9", p.cloud9); if (c.builtin_addons) if (p.pdf) |pdf| x.addImport("pdf_addon", pdf); if (c.builtin_addons) x.addImport("image_addon", p.image); @@ -394,8 +397,9 @@ pub fn module(b: *std.Build, p: Parts, c: Core) Modules { x.addImport("core", m); x.addImport("dev", dev); x.addImport("runtime", runtime); + x.addImport("wire", wire); } - return .{ .root = root, .core = m, .dev = dev, .runtime = runtime }; + return .{ .root = root, .core = m, .dev = dev, .runtime = runtime, .wire = wire }; } /// What `assemble` makes besides the parts: the shells' options, the @@ -497,9 +501,9 @@ pub fn assemble(b: *std.Build, c: struct { // The kinds' C ABI (src/kinds/pardes_addon.h), translated once: the core's // records are the header's, never a mirror of it. - const kind_mod = b.addTranslateC(.{ .root_source_file = b.path("src/kinds/pardes_addon.h"), .target = target, .optimize = optimize }).createModule(); + const kind_mod = b.addTranslateC(.{ .root_source_file = b.path("abi/pardes_addon.h"), .target = target, .optimize = optimize }).createModule(); // ...and what an addon in Zig imports over it (src/kinds/addon.zig). - const addon_mod = b.createModule(.{ .root_source_file = b.path("src/kinds/addon.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "pardes_addon", .module = kind_mod }} }); + const addon_mod = b.createModule(.{ .root_source_file = b.path("abi/addon.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "pardes_addon", .module = kind_mod }} }); const pdf_built = addons.pdf(b, .{ .addon_mod = addon_mod, .c_optimize = c_optimize, @@ -590,7 +594,7 @@ pub fn assemble(b: *std.Build, c: struct { const image_addon = addons.image(b, target, c_optimize, addon_mod, zstbi_dep); // The records the core and the terminal both name (src/plain/plain.zig). - const plain_mod = b.createModule(.{ .root_source_file = b.path("src/plain/plain.zig"), .target = target, .optimize = optimize }); + const plain_mod = b.createModule(.{ .root_source_file = b.path("abi/plain.zig"), .target = target, .optimize = optimize }); // The terminal, a module of its own (src/term/term.zig): the emulator and // what it brings are its, and every core but core-test's is given it. const term_mod = b.createModule(.{ .root_source_file = b.path("src/term/term.zig"), .target = target, .optimize = optimize, .link_libc = true }); |
