summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 22:17:29 -0300
committerGabriel Schneider <[email protected]>2026-11-19 23:08:49 -0300
commit55a5f91305df47cd56d7776f4193b6198208e891 (patch)
treec6a885b6a4d8bcc60dc1c9958473ee8c0a21f4a1
parent0db34fbf28e70c8c6a3c6025c0888fc5ec75201c (diff)
downloadpardes-55a5f91305df47cd56d7776f4193b6198208e891.tar.gz
pardes-55a5f91305df47cd56d7776f4193b6198208e891.zip
build: the dead and the doubled options go (the start design's step 1, pardes-build-options change 1): `ShellConfig.prebuilt_shaders`, set at build.zig:147 and read nowhere (the `-Dprebuilt-shaders` flag stays: gui.make hands it to sketchbook and the perf identity names it); `tools.add` and `core.assemble` handed the grammar set and -Dtracy beside the `shell_cfg` that holds them (`ShellConfig.tracy` is the checkout's path now, so Parts and the perf identity read it there); `syntax_zig_grammar`, always equal to `syntax_highlighting`; and the four `syntax_*` bools as the one enum they said four ways, `grammars` (`-Dtree-sitter`'s `TreeSitterGrammars`), read by syntax.zig, Output.zig's Build pane and three tests, with abi/wire.zig hashing it as the four words it was hashed as, so `pardes version`'s semantics line did not move on any product (38b5ae573b965550 on tui, gui, the bare build's two, both statics, FreeBSD; d41689a1f97605b8 with -Dtree-sitter=minimal, as on the base); build.zig and build/ 3,005 -> 2,992 lines; every shape configures (12 configurations) and builds as on the base (tui, gui, bare, the macOS library for Linux and aarch64-macos, static on musl and on the window, FreeBSD, -Dtree-sitter=minimal), and the two that fail on the base fail with the same errors (pardes-isolate: core/builtins.zig:510, core/ninep/ctl.zig:1298; -Dtree-sitter=disabled: core/indent.zig:48); 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, hxlib 538 cases 0 mismatches, process-test 3 of 144 failed (lspcomplete and lspcompletemoved, the base's, and headersweep-restored, on the flaky list: passed alone, 1364 ms), gui unit-test 1625/1629 (the perf check's BaselineHarnessMismatch, the base's); the test names of every suite equal the base's (ledger); load 15-45 on 16 cores
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
-rw-r--r--abi/wire.zig11
-rw-r--r--build.zig7
-rw-r--r--build/core.zig17
-rw-r--r--build/tools.zig7
-rw-r--r--core/Output.zig2
-rw-r--r--core/syntax.zig11
-rw-r--r--test/behaviour/panes.zig2
-rw-r--r--test/behaviour/settings.zig2
-rw-r--r--test/output.zig2
9 files changed, 25 insertions, 36 deletions
diff --git a/abi/wire.zig b/abi/wire.zig
index b2d32033..26a7131e 100644
--- a/abi/wire.zig
+++ b/abi/wire.zig
@@ -61,16 +61,19 @@ const family = switch (config.platform) {
/// their options and dependencies; -Dstamp-commit stamps one.
pub const semantics: u64 = blk: {
@setEvalBranchQuota(1_000_000);
+ // The grammar set as the four words it was hashed as when it was four
+ // options (highlighting, zig, minimal, full), so the hash stays.
+ const g = config.grammars;
// The two long ones (the dependencies, 2.5 KB, and the tape's shape,
// 11 KB) joined on, not formatted: formatting them at comptime was 5 %
// of a compile of the core.
break :blk std.hash.Wyhash.hash(0, std.fmt.comptimePrint(
"wire {d}\npardes {s} {s}\n{s} grammars {} {} {} {} workspace_tag {} sources {}\nusize {d} {t}\n",
.{
- version, config.version, config.commit orelse "unstamped",
- family, config.syntax_highlighting, config.syntax_zig_grammar,
- config.syntax_minimal_grammars, config.syntax_full_grammars, config.workspace_tag,
- config.embed_sources, @sizeOf(usize), builtin.cpu.arch.endian(),
+ version, config.version, config.commit orelse "unstamped",
+ family, g != .disabled, g != .disabled,
+ g == .minimal or g == .full, g == .full, config.workspace_tag,
+ config.embed_sources, @sizeOf(usize), builtin.cpu.arch.endian(),
},
) ++ config.deps ++ "\n" ++ pardes.tape.shape);
};
diff --git a/build.zig b/build.zig
index b81390c4..cf9a851f 100644
--- a/build.zig
+++ b/build.zig
@@ -142,9 +142,8 @@ pub fn build(b: *std.Build) void {
const shell_cfg: core.ShellConfig = .{
.tree_sitter_grammars = tree_sitter_grammars,
- .tracy = tracy != null,
+ .tracy = tracy,
.workspace_tag = workspace_tag,
- .prebuilt_shaders = prebuilt_shaders,
.embed_sources = embed_sources,
.commit = if (stamp_commit) core.gitCommit(b) else null,
.change = if (stamp_commit) core.jjChange(b) else null,
@@ -156,8 +155,6 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
.c_optimize = c_optimize,
- .tree_sitter_grammars = tree_sitter_grammars,
- .tracy = tracy,
.shell_cfg = shell_cfg,
.platform = platform,
.also_gui = also_gui,
@@ -320,8 +317,6 @@ pub fn build(b: *std.Build) void {
.shell_cfg = shell_cfg,
.target = target,
.test_filters = test_filters,
- .tracy = tracy,
- .tree_sitter_grammars = tree_sitter_grammars,
.unit_profile = unit_profile,
});
tests.add(b, .{
diff --git a/build/core.zig b/build/core.zig
index 974d5c7e..b35c066b 100644
--- a/build/core.zig
+++ b/build/core.zig
@@ -60,11 +60,11 @@ pub fn command(b: *std.Build, argv: []const []const u8) ?[]const u8 {
pub const ShellConfig = struct {
tree_sitter_grammars: TreeSitterGrammars,
- tracy: bool = false,
+ /// -Dtracy's checkout, whose client a core that asks compiles in.
+ tracy: ?[]const u8 = null,
/// null = "the platform's own default": the macOS shell hands the row to
/// its native menu bar, every other shell keeps the acme topbar.
workspace_tag: ?bool = null,
- prebuilt_shaders: bool = false,
embed_sources: bool = false,
commit: ?[]const u8 = null,
/// The jj change git HEAD is in, and when this configure ran: the
@@ -79,11 +79,8 @@ pub const ShellConfig = struct {
pub fn shellOptions(b: *std.Build, cfg: ShellConfig, platform: Platform) *std.Build.Step.Options {
const o = b.addOptions();
o.addOption(Platform, "platform", platform);
- o.addOption(bool, "syntax_highlighting", cfg.tree_sitter_grammars != .disabled);
- o.addOption(bool, "syntax_zig_grammar", cfg.tree_sitter_grammars != .disabled);
- o.addOption(bool, "syntax_minimal_grammars", cfg.tree_sitter_grammars == .minimal or cfg.tree_sitter_grammars == .full);
- o.addOption(bool, "syntax_full_grammars", cfg.tree_sitter_grammars == .full);
- o.addOption(bool, "enable_tracy", cfg.tracy);
+ o.addOption(TreeSitterGrammars, "grammars", cfg.tree_sitter_grammars);
+ o.addOption(bool, "enable_tracy", cfg.tracy != null);
o.addOption(bool, "workspace_tag", cfg.workspace_tag orelse (platform != .macos));
o.addOption(bool, "embed_sources", cfg.embed_sources);
o.addOption([]const u8, "version", display_version);
@@ -429,8 +426,6 @@ pub fn assemble(b: *std.Build, c: struct {
target: std.Build.ResolvedTarget,
optimize: std.lang.Optimize,
c_optimize: std.lang.Optimize,
- tree_sitter_grammars: TreeSitterGrammars,
- tracy: ?[]const u8,
shell_cfg: ShellConfig,
platform: Platform,
also_gui: bool,
@@ -455,7 +450,7 @@ pub fn assemble(b: *std.Build, c: struct {
// nothing else. pardes takes these whatever it builds: the missing ones
// are asked for here in one round, the grammars with them, where each
// `b.dependency` below would end the configure to fetch its own alone.
- const ts = treeSitter(b, io, target, c_optimize, c.tree_sitter_grammars);
+ const ts = treeSitter(b, io, target, c_optimize, c.shell_cfg.tree_sitter_grammars);
inline for (.{ "cloud9", "vaxis", "ghostty", "uucode", "zstbi", "mvzr", "zstd", "xitdb" }) |name| {
// A dependency by path (none of these today) has no hash and is always there.
const dep = @field(zon.dependencies, name);
@@ -623,7 +618,7 @@ pub fn assemble(b: *std.Build, c: struct {
.target = target,
.optimize = optimize,
.cloud9 = cloud9,
- .tracy = c.tracy,
+ .tracy = c.shell_cfg.tracy,
.zstd = zstd,
.image = image_addon.root_module,
.pdf = pdf_built.module,
diff --git a/build/tools.zig b/build/tools.zig
index 1343fef9..62e9817a 100644
--- a/build/tools.zig
+++ b/build/tools.zig
@@ -2,7 +2,6 @@ const std = @import("std");
const builtin = @import("builtin");
const Platform = @import("../build.zig").Platform;
const PerfBuild = @import("../build.zig").PerfBuild;
-const TreeSitterGrammars = @import("../build.zig").TreeSitterGrammars;
const core = @import("core.zig");
const testMatch = @import("tests.zig").testMatch;
@@ -42,8 +41,6 @@ pub fn add(b: *std.Build, c: struct {
shell_cfg: core.ShellConfig,
target: std.Build.ResolvedTarget,
test_filters: []const []const u8,
- tracy: ?[]const u8,
- tree_sitter_grammars: TreeSitterGrammars,
unit_profile: *std.Build.Step.Compile,
}) Tools {
const image_harness = program(b, "pardes-image-harness", "test/image_harness.zig", c.target, c.optimize, &.{});
@@ -191,10 +188,10 @@ pub fn add(b: *std.Build, c: struct {
.c_optimize = @tagName(c.c_optimize),
.terminal_optimize = @tagName(c.ghostty_optimize),
.platform = @tagName(c.platform),
- .grammars = @tagName(c.tree_sitter_grammars),
+ .grammars = @tagName(c.shell_cfg.tree_sitter_grammars),
.mupdf = c.pdf_addon != null,
.jpx = c.enable_jpx,
- .tracy = c.tracy != null,
+ .tracy = c.shell_cfg.tracy != null,
.terminal_simd = c.ghostty_simd,
.prebuilt_shaders = c.platform == .gui and c.prebuilt_shaders,
});
diff --git a/core/Output.zig b/core/Output.zig
index 3ac9f521..23409b68 100644
--- a/core/Output.zig
+++ b/core/Output.zig
@@ -906,7 +906,7 @@ pub fn openBuild(p: *Pardes, id: usize) !void {
@tagName(builtin.abi), @tagName(build_options.platform),
});
try w.print("grammars {s}\naddons {s}\nsemantics {x:0>16}\n\ndependencies\n{s}", .{
- if (build_options.syntax_full_grammars) "full" else if (build_options.syntax_minimal_grammars) "minimal" else "none",
+ 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",
@import("wire").semantics,
build_options.deps,
diff --git a/core/syntax.zig b/core/syntax.zig
index f95b745a..36aa8c2b 100644
--- a/core/syntax.zig
+++ b/core/syntax.zig
@@ -7,10 +7,9 @@ const regexp = @import("regexp.zig");
const c_heap = @import("c_heap");
const diff = @import("diff.zig");
-pub const enabled = config.syntax_highlighting;
-const zig_grammar = config.syntax_zig_grammar;
-const minimal_grammars = config.syntax_minimal_grammars;
-const full_grammars = config.syntax_full_grammars;
+pub const enabled = config.grammars != .disabled;
+const minimal_grammars = config.grammars == .minimal or config.grammars == .full;
+const full_grammars = config.grammars == .full;
pub const ts = if (enabled) @import("tree-sitter") else struct {
pub const Language = opaque {};
@@ -44,7 +43,7 @@ const Spec = struct {
fn grammarSelected(comptime g: grammar_manifest.Grammar) bool {
return switch (g.tier) {
- .zig => zig_grammar,
+ .zig => enabled,
.minimal => minimal_grammars,
.full => full_grammars,
};
@@ -2169,7 +2168,7 @@ test "a kept tree told its edits parses to the fresh parse's tree, places and al
}
test "syntax: a grammar handed in at run time colours and walks as the one compiled in" {
- if (!zig_grammar) return error.SkipZigTest;
+ if (!enabled) return error.SkipZigTest;
const gpa = std.testing.allocator;
start(gpa);
defer stop();
diff --git a/test/behaviour/panes.zig b/test/behaviour/panes.zig
index 67155776..8fb85cb7 100644
--- a/test/behaviour/panes.zig
+++ b/test/behaviour/panes.zig
@@ -888,7 +888,7 @@ test "panes: truncating body empties it, and a stat says the length after" {
}
test "panes: a rename colours a source its new name's language names, its text unchanged" {
- if (!@import("pardes_config").syntax_highlighting) return error.SkipZigTest;
+ if (@import("pardes_config").grammars == .disabled) return error.SkipZigTest;
var s = try Session.initFile(std.testing.allocator, "fn check() void {}\n");
defer s.deinit();
const n = try s.focused();
diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig
index 66cd97df..bd88b75e 100644
--- a/test/behaviour/settings.zig
+++ b/test/behaviour/settings.zig
@@ -158,7 +158,7 @@ test "settings: Back and Forward written to exec keep to the focused file" {
});
}
-const syntax = @import("pardes_config").syntax_highlighting;
+const syntax = @import("pardes_config").grammars != .disabled;
/// The style /screen draws the cell `into` cells into the first place
/// `text` is drawn.
diff --git a/test/output.zig b/test/output.zig
index 38e8ba0d..17525616 100644
--- a/test/output.zig
+++ b/test/output.zig
@@ -786,7 +786,7 @@ test "identical result refresh keeps warm content caches without allocation" {
const index = try panes.File.lineIndex(p.gpa, file);
const styles = try std.testing.allocator.dupe(u8, file.highlights);
defer std.testing.allocator.free(styles);
- if (@import("pardes_config").syntax_zig_grammar) try std.testing.expect(styles.len > 0);
+ if (@import("pardes_config").grammars != .disabled) try std.testing.expect(styles.len > 0);
const revision = file.revision;
const saved_revision = file.saved_revision;
const body_ptr = file.content.ptr;