summaryrefslogtreecommitdiff
path: root/core
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 /core
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 'core')
-rw-r--r--core/Addon.zig4
-rw-r--r--core/Editor.zig2
-rw-r--r--core/Output.zig15
-rw-r--r--core/Term.zig2
-rw-r--r--core/Text.zig2
-rw-r--r--core/config.zig2
-rw-r--r--core/lib_editor.zig2
-rw-r--r--core/memory.zig2
-rw-r--r--core/root.zig10
-rw-r--r--core/syntax.zig2
-rw-r--r--core/tracy.zig2
11 files changed, 23 insertions, 22 deletions
diff --git a/core/Addon.zig b/core/Addon.zig
index ec2f796a..c542e1f1 100644
--- a/core/Addon.zig
+++ b/core/Addon.zig
@@ -236,9 +236,9 @@ fn fileOf(fd: c_int) ?[5]i64 {
/// library exports. A static binary cannot dlopen, and the loader below
/// is Linux's (a memfd): this is how either has image and PDF panes.
/// A build with -Dpdf=false has the image addon alone.
-const compiled_in: []const *const Kind.Ops = if (!@import("builtin_addons").on)
+const compiled_in: []const *const Kind.Ops = if (!@import("pardes_options").builtin_addons)
&.{}
-else if (@import("builtin_addons").pdf)
+else if (@import("pardes_options").builtin_pdf)
&.{ &@import("image_addon").pardes_addon, &@import("pdf_addon").pardes_addon }
else
&.{&@import("image_addon").pardes_addon};
diff --git a/core/Editor.zig b/core/Editor.zig
index 9781d857..aaf6ab05 100644
--- a/core/Editor.zig
+++ b/core/Editor.zig
@@ -10,7 +10,7 @@ const Registers = @import("Registers.zig");
/// The library's build (build.zig `library`): a text with no pane and no
/// core, its characters its own. Where an edit reaches a pane it branches
/// on this at compile time, so the library never compiles the core.
-pub const lib = @import("pardes_config").lib;
+pub const lib = @import("pardes_options").lib;
const Pardes = if (lib) void else @import("Core.zig");
const Syntax = if (lib) @import("lib_editor.zig").Syntax else void;
const modal = @import("modal.zig");
diff --git a/core/Output.zig b/core/Output.zig
index 23409b68..08abc154 100644
--- a/core/Output.zig
+++ b/core/Output.zig
@@ -9,7 +9,8 @@ const Pardes = pardes.Pardes;
const modal = @import("modal.zig");
const limits = @import("memory.zig").limits;
const builtins = @import("builtins.zig");
-const build_options = @import("pardes_config");
+const build_options = @import("pardes_options");
+const build_info = @import("build_info");
const lsp = @import("lsp/lsp.zig");
const look = @import("look.zig");
const locations = @import("locations.zig");
@@ -896,9 +897,9 @@ pub fn openBuild(p: *Pardes, id: usize) !void {
const w = &out.writer;
try w.print("{s}\n", .{@import("runtime").upgrade.version_line});
try w.print("commit {s}\nchange {s}\nbuilt {s}\n", .{
- build_options.commit orelse "not stamped (a Debug build with -Dplatform or --prefix)",
- build_options.change orelse "not stamped",
- build_options.built orelse "not stamped",
+ build_info.commit orelse "not stamped (a Debug build with -Dplatform or --prefix)",
+ build_info.change orelse "not stamped",
+ build_info.built orelse "not stamped",
});
try w.print("zig {s}\nmode {s}\ntarget {s}-{s}-{s}\nplatform {s}\n", .{
builtin.zig_version_string, @tagName(builtin.mode),
@@ -907,9 +908,9 @@ pub fn openBuild(p: *Pardes, id: usize) !void {
});
try w.print("grammars {s}\naddons {s}\nsemantics {x:0>16}\n\ndependencies\n{s}", .{
if (build_options.grammars == .full) "full" else if (build_options.grammars == .minimal) "minimal" else "none",
- if (@import("builtin_addons").on) "compiled in" else "loaded from <prefix>/lib/pardes/addons",
+ if (build_options.builtin_addons) "compiled in" else "loaded from <prefix>/lib/pardes/addons",
@import("wire").semantics,
- build_options.deps,
+ build_info.deps,
});
const content = try out.toOwnedSlice();
return openRead(p, id, .{ .cmd = .Build }, "", content);
@@ -918,7 +919,7 @@ pub fn openBuild(p: *Pardes, id: usize) !void {
pub fn openChangelog(p: *Pardes, id: usize) !void {
var out: std.Io.Writer.Allocating = .init(p.gpa);
errdefer out.deinit();
- try out.writer.print("pardes {s}\n\n", .{build_options.version});
+ try out.writer.print("pardes {s}\n\n", .{build_info.version});
try out.writer.writeAll(@embedFile("CHANGELOG.md"));
const content = try out.toOwnedSlice();
return openRead(p, id, .{ .cmd = .Changelog }, "", content);
diff --git a/core/Term.zig b/core/Term.zig
index fde36420..3f975df6 100644
--- a/core/Term.zig
+++ b/core/Term.zig
@@ -15,7 +15,7 @@ const File = @import("File.zig");
const iface = plain.term;
/// The terminal module's entries; null in a core built without it.
-pub const ops: ?*const iface.Ops = if (@import("term_options").terminal) &@import("term").ops else null;
+pub const ops: ?*const iface.Ops = if (@import("pardes_options").terminal) &@import("term").ops else null;
/// What a core without a terminal says, once, where one would have been.
pub const none = "no terminal in this build";
diff --git a/core/Text.zig b/core/Text.zig
index 51d660cf..1b3e6273 100644
--- a/core/Text.zig
+++ b/core/Text.zig
@@ -113,7 +113,7 @@ refused: bool = false,
pub inline fn pane(t: *Text) ?*Pane {
// the library's text has none (lib_editor.zig): known at compile time,
// so what an edit does with a pane is not compiled there
- if (comptime @import("pardes_config").lib) return null;
+ if (comptime @import("pardes_options").lib) return null;
return switch (t.what) {
.body => @alignCast(@fieldParentPtr("body", t)),
.tag => @alignCast(@fieldParentPtr("tag", t)),
diff --git a/core/config.zig b/core/config.zig
index 792a7e62..bb04d24d 100644
--- a/core/config.zig
+++ b/core/config.zig
@@ -39,7 +39,7 @@ comptime {
@setEvalBranchQuota(20_000);
// A path here is a leaf: no builtin's path is it or runs past it, and
// none of it is a builtin's whole path. The library has no builtins.
- if (!@import("pardes_config").lib) for (leader_args) |la| for (std.enums.values(Builtin)) |b| if (leader_path.get(b)) |path| {
+ if (!@import("pardes_options").lib) for (leader_args) |la| for (std.enums.values(Builtin)) |b| if (leader_path.get(b)) |path| {
if (std.mem.startsWith(u8, path, la.path) or std.mem.startsWith(u8, la.path, path))
@compileError("leader_args path collides with " ++ @tagName(b) ++ ": " ++ la.path);
};
diff --git a/core/lib_editor.zig b/core/lib_editor.zig
index c459241a..3fe631af 100644
--- a/core/lib_editor.zig
+++ b/core/lib_editor.zig
@@ -3,7 +3,7 @@
//! true`, docs/next-editor.md). In-memory editing with helix's keys: no
//! files, commands, builtins, prompts or views, which come back to the
//! caller as an `action`. Nothing is copied here: a key runs the editor's
-//! own normal.zig and edit.zig, built with `pardes_config.lib`, where a
+//! own normal.zig and edit.zig, built with `pardes_options.lib`, where a
//! text has no pane and its characters are its own.
//!
//! The editor is a value of plain data (`Editor(capacity)`): no pointer,
diff --git a/core/memory.zig b/core/memory.zig
index c628ae49..0e0dba29 100644
--- a/core/memory.zig
+++ b/core/memory.zig
@@ -1,6 +1,6 @@
const std = @import("std");
const builtin = @import("builtin");
-const config = @import("pardes_config");
+const config = @import("pardes_options");
const KiB = 1024;
const MiB = 1024 * KiB;
diff --git a/core/root.zig b/core/root.zig
index 69ec3ded..df273738 100644
--- a/core/root.zig
+++ b/core/root.zig
@@ -98,12 +98,12 @@ pub const Host = host_io.Host;
pub const frameMark = tracy.frameMark;
/// The shell this build is for (build.zig's `-Dplatform`).
-pub const platform = @import("pardes_config").platform;
+pub const platform = @import("pardes_options").platform;
-pub const version = @import("pardes_config").version;
-pub const commit: ?[]const u8 = @import("pardes_config").commit;
+pub const version = @import("build_info").version;
+pub const commit: ?[]const u8 = @import("build_info").commit;
-pub const isolated = @import("pardes_isolation").isolated;
+pub const isolated = @import("pardes_options").isolated;
pub const font_picker = platform == .gui or platform == .macos;
@@ -442,7 +442,7 @@ test {
// A window's build links the window's C (font.c over FreeType and
// HarfBuzz) into each of its programs, and their allocator (ui_malloc
// and the rest) is gui.zig's.
- if (comptime @import("term_options").terminal and platform == .gui) _ = @import("dev").gui;
+ if (comptime @import("pardes_options").terminal and platform == .gui) _ = @import("dev").gui;
}
/// The container-level `var`s core/ may hold (at the top of a file, in a
diff --git a/core/syntax.zig b/core/syntax.zig
index 36aa8c2b..ba3851ab 100644
--- a/core/syntax.zig
+++ b/core/syntax.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const config = @import("pardes_config");
+const config = @import("pardes_options");
const tracy = @import("tracy.zig");
const grammar_manifest = @import("grammar_manifest.zig");
const locations = @import("locations.zig");
diff --git a/core/tracy.zig b/core/tracy.zig
index 3b0b8621..56429b1b 100644
--- a/core/tracy.zig
+++ b/core/tracy.zig
@@ -5,7 +5,7 @@
const std = @import("std");
const builtin = @import("builtin");
-pub const enable = if (builtin.is_test) false else @import("pardes_config").enable_tracy;
+pub const enable = if (builtin.is_test) false else @import("pardes_options").enable_tracy;
const SourceLocation = extern struct {
name: ?[*:0]const u8,