summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 23:07:14 -0300
committerGabriel Schneider <[email protected]>2026-11-20 00:24:42 -0300
commita481de9feea08de7b5b82c2471de70abd70d7462 (patch)
tree49dce2c2d511be4a47b0e92450046669ad7df0e4 /build.zig
parent55a5f91305df47cd56d7776f4193b6198208e891 (diff)
downloadpardes-a481de9feea08de7b5b82c2471de70abd70d7462.tar.gz
pardes-a481de9feea08de7b5b82c2471de70abd70d7462.zip
build: one options module a module set, `pardes_options`, and `build_info` beside it (the start design's step 2, pardes-build-options change 2): `core.module` makes the set's options from the build's `ShellConfig` and the set's `Core` (the platform, now a `Core` field in place of a module handed in; the grammar set; the terminal; pardes-isolate's `isolated`; the addons compiled in and the pdf one with them, `builtin_addons` and `builtin_pdf`; tracy; the workspace tag; embedded sources; the library's `lib`), one module shared by the set's five as `pardes_config` was, and `build_info` (version, commit, change, built, deps) made once in `assemble` and given to every set; the three one-value modules made in both values (`term_options`, `pardes_isolation`, `builtin_addons`), `shellOptions`, the six `Parts` fields that held them, `Parts.tracy` and `Parts.embed_sources` (the `ShellConfig` in `Parts` holds both) and the assembly's two options (`opts`, `gui_opts`) go; the library's `pardes-syntax` and the editor (the library's and hxlib's) get `pardes_options` with no terminal, the editor's with `lib` as before; the sources' imports follow, one identifier a line (abi/wire.zig and core/Output.zig import both, the hash's and the Build pane's lines reading the version, commit and dependencies from `build_info`); test programs see it as before, through the core module's import table (pane-test, behaviour-test); `pardes version`'s semantics line did not move on any product (38b5ae573b965550; d41689a1f97605b8 with -Dtree-sitter=minimal); build.zig and build/ 2,992 -> 2,960 lines (3,005 at the base); every shape configures and builds as on the base, pardes-isolate and -Dtree-sitter=disabled failing with the base's same errors (pardes-isolate reaching them through its own options module); tui core-test 848/991 (143 skipped), shell-test 1027/1030, pane-test 183/184, behaviour-test 275/275 (and -- --replay), term-test 15/15, kitty-test 45/45, lib-test (11/11 in the consumer), hxlib 538 cases 0 mismatches, process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's), gui unit-test 1625/1629 (the perf check's BaselineHarnessMismatch, the base's); the test names of every suite equal the base's (ledger); the frame and perf gate (gpu/bo-s2 against tree1) PASS: 77/77 frames byte-identical in Debug, the alternated window corpus2x -0.104% (pictures identical in all 10 runs), the 97 per-operation counts within 0.1% (largest image-frame +0.0345%; against the coordinator's pardes-merge22 gate m22-g, 90 within 5 ppm, deep-sel 8-10 ppm, image-frame up to 85 ppm, its known noise); load 5-25 on 16 cores
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig13
1 files changed, 6 insertions, 7 deletions
diff --git a/build.zig b/build.zig
index cf9a851f..fc0c5044 100644
--- a/build.zig
+++ b/build.zig
@@ -166,7 +166,6 @@ pub fn build(b: *std.Build) void {
.pdf_scroll_bench_step = pdf_scroll_bench_step,
});
const parts = a.parts;
- const opts = a.opts;
// Off Linux, whose memfd Addon.zig's loader needs, every core has the
// addons compiled in.
const compiled_in = target.result.os.tag != .linux;
@@ -174,28 +173,28 @@ pub fn build(b: *std.Build) void {
// its own flat C ABI instead of runtime/main.zig. Tracy's client and BSD
// libutil go to the shell (and Tracy's to the core) alone, as before
// core.module.
- const root_set = core.module(b, parts, .{ .root = if (platform == .macos) "runtime/macos.zig" else "runtime/main.zig", .config = opts, .builtin_addons = compiled_in, .tracy = true, .util = true });
+ const root_set = core.module(b, parts, .{ .root = if (platform == .macos) "runtime/macos.zig" else "runtime/main.zig", .platform = platform, .builtin_addons = compiled_in, .tracy = true, .util = true });
const root_mod = root_set.root;
// hxdiff's headless core and pardes-isolate are the primary shell's
// configuration compiled two more ways, not two more frontends.
- const core_cfg: core.Core = .{ .root = "core/root.zig", .config = opts, .builtin_addons = compiled_in, .tracy = true };
+ const core_cfg: core.Core = .{ .root = "core/root.zig", .platform = platform, .builtin_addons = compiled_in, .tracy = true };
const core_set = core.module(b, parts, core_cfg);
const core_module = core_set.root;
// The core without the terminal module (docs/next-terminal.md, Phase 1):
// what core-test is compiled from. No ghostty-vt, wuffs, zstbi or C++;
// a shell boot is a scratch pane, a test that needs a terminal skips,
// and shell-test runs them all with one.
- const lean_cfg: core.Core = .{ .root = "core/root.zig", .config = opts, .builtin_addons = compiled_in, .terminal = false };
+ const lean_cfg: core.Core = .{ .root = "core/root.zig", .platform = platform, .builtin_addons = compiled_in, .terminal = false };
const core_lean = core.module(b, parts, lean_cfg);
- const isolated_mod: ?*std.Build.Module = if (platform == .tui) core.module(b, parts, .{ .root = "runtime/main.zig", .config = opts, .builtin_addons = compiled_in, .isolated = true }).root else null;
+ const isolated_mod: ?*std.Build.Module = if (platform == .tui) core.module(b, parts, .{ .root = "runtime/main.zig", .platform = platform, .builtin_addons = compiled_in, .isolated = true }).root else null;
// `zig build static`'s: the addons compiled in (Addon.zig). Linked
// statically on musl alone, as glibc links only dynamically; the gui's
// is dynamic (SDL and the GPU need the display's libraries) with the
// addons in it all the same.
const static_linkage: ?std.builtin.LinkMode = if (target.result.isMuslLibC()) .static else null;
- const static_set: ?core.Modules = if ((platform == .tui and static_linkage != null) or platform == .gui) core.module(b, parts, .{ .root = "runtime/main.zig", .config = opts, .builtin_addons = true }) else null;
+ const static_set: ?core.Modules = if ((platform == .tui and static_linkage != null) or platform == .gui) core.module(b, parts, .{ .root = "runtime/main.zig", .platform = platform, .builtin_addons = true }) else null;
const static_mod: ?*std.Build.Module = if (static_set) |s| s.root else null;
- const gui_set: ?core.Modules = if (also_gui) core.module(b, parts, .{ .root = "runtime/main.zig", .config = a.gui_opts.?, .builtin_addons = compiled_in }) else null;
+ const gui_set: ?core.Modules = if (also_gui) core.module(b, parts, .{ .root = "runtime/main.zig", .platform = .gui, .builtin_addons = compiled_in }) else null;
const gui_mod: ?*std.Build.Module = if (gui_set) |s| s.root else null;
if (a.pdf.lib) |lib| tools.pdfBenches(b, target, optimize, core_module, lib, pdf_pointer_bench_step, pdf_scroll_bench_step);