From f33e4bfc32de821df5fa15fbae3da73b341d5890 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 23:19:01 -0300 Subject: Only kept builds carry the commit, so a jj new rebuilds nothing The git commit sat in the options module every binary imports, so each HEAD move (jj new, jj commit) recompiled every test and snapshot binary: measured 24.4 s and +0.6 GB of .zig-cache for test-build -Dplatform=tty after one no-op HEAD move. Now -Dstamp-commit decides, defaulting to on for release builds and the bare zig build that installs into ~/.local; every other Debug build prints `pardes ` alone. After: 0.21 s, +0 bytes. Co-Authored-By: Claude Opus 5.5 --- build.zig | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index a78cd442..3c1447eb 100644 --- a/build.zig +++ b/build.zig @@ -60,7 +60,8 @@ pub fn build(b: *std.Build) void { const requested_platform = b.option(Platform, "platform", "which shell to build (tty, gui, web, macos, esp32p4); absent builds the tty cli and the SDL gui together"); const platform = requested_platform orelse .tty; const also_gui = requested_platform == null; - if (also_gui and prefixIsUntouched(b)) { + const home_install = also_gui and prefixIsUntouched(b); + if (home_install) { if (b.graph.environ_map.get("HOME")) |home| { b.resolveInstallPrefix(b.pathJoin(&.{ home, ".local" }), .{}); std.debug.print("pardes: installing into {s} (override with --prefix)\n", .{b.install_prefix}); @@ -311,6 +312,16 @@ pub fn build(b: *std.Build) void { // The macOS shell carries the workspace tag row's commands in its native // menu bar; the row itself goes away. `-Dworkspace-tag=true` puts it back. const workspace_tag = b.option(bool, "workspace-tag", "draw the workspace tag row (default: on except on macOS, whose menu bar carries its commands)"); + // The commit is a build input: every `jj new` or `jj commit` moves HEAD, + // changes the options module and so recompiles every binary that imports + // it, which is all of them (~0.6 GB of fresh test objects per move). Only + // builds someone keeps are stamped: release builds and the bare + // `zig build` that installs into ~/.local. Every other Debug build (any + // -Dplatform or --prefix, so every test and snapshot run) prints + // `pardes ` alone, like a tarball build; -Dstamp-commit=true + // stamps one anyway. + const stamp_commit = b.option(bool, "stamp-commit", "embed the git commit in --version and crash records (default: release builds and the ~/.local install)") orelse + (optimize != .Debug or home_install); const shell_cfg: ShellConfig = .{ .tree_sitter_grammars = tree_sitter_grammars, .tracy = tracy != null, @@ -323,7 +334,7 @@ pub fn build(b: *std.Build) void { .prebuilt_shaders = prebuilt_shaders, .embed_sources = embed_sources, .zig_lib_dir = b.graph.zig_lib_directory.path orelse "", - .commit = gitCommit(b), + .commit = if (stamp_commit) gitCommit(b) else null, }; const opts = shellOptions(b, shell_cfg, platform); const gui_opts: ?*std.Build.Step.Options = if (also_gui) shellOptions(b, shell_cfg, .gui) else null; @@ -1607,8 +1618,8 @@ fn shellOptions(b: *std.Build, cfg: ShellConfig, platform: Platform) *std.Build. o.addOption([]const u8, "zls_version", if (cfg.zls_backend) zls_version else "none"); o.addOption(bool, "embed_sources", cfg.embed_sources); o.addOption([]const u8, "version", zon.version); - // ...and the commit it was built from, when there is one. See `gitCommit` - // for why this is optional and why it is read at configure time. + // ...and the commit it was built from, when there is one and the build + // is stamped at all (see `stamp_commit`). Read at configure time. o.addOption(?[]const u8, "commit", cfg.commit); o.addOption([]const u8, "zig_lib_dir", cfg.zig_lib_dir); return o; -- cgit v1.3 From f0c947bd1b1e6e172b11f007d7bdeff2d6599e03 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 23:19:54 -0300 Subject: config-test goes: config.zig is the core now, and core-test runs its tests config.zig imports pardes.zig and builtins.zig, so it cannot be compiled "without the editor" any more; the step failed with 40 missing-module errors (zls, uucode, cloud9, mupdf, ...). Its two tests (Space-k unbound, wheel drift guard) already run in core-test, checked with -Dtest-filter. Wiring every core import into it would only rebuild core-test for two tests. Co-Authored-By: Claude Opus 5.5 --- README.md | 1 - build.zig | 12 ------------ 2 files changed, 13 deletions(-) (limited to 'build.zig') diff --git a/README.md b/README.md index 267b5ca7..d2f3d995 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,6 @@ zig build test-build compile the unit-test programs without running them zig build unit-profile test request time and process memory as JSONL zig build unit-profile-test profiler timing, failure and timeout checks zig build core-test core tests without native shell tests -zig build config-test configuration tests without compiling the editor zig build pane-test pane and namespace integration tests zig build syntax-test tree-sitter tests without building the editor zig build syntax deterministic per-byte highlighting snapshots diff --git a/build.zig b/build.zig index 3c1447eb..4a478ac5 100644 --- a/build.zig +++ b/build.zig @@ -1375,18 +1375,6 @@ pub fn build(b: *std.Build) void { lspbench_test_step.dependOn(&run_lspbench_tests.step); lspbench_check_step.dependOn(&run_lspbench_tests.step); if (testMatch(b, unit_profile, test_filters, lspbench_test_step)) |check| check.addArtifactArg(lspbench_tests); - const config_module = b.createModule(.{ - .target = target, - .optimize = optimize, - .root_source_file = b.path("src/config.zig"), - }); - config_module.addImport("pardes_config", core_module.import_table.get("pardes_config").?); - const config_tests = b.addTest(.{ .root_module = config_module, .filters = test_filters }); - const run_config_tests = b.addRunArtifact(config_tests); - run_config_tests.has_side_effects = true; - const config_test_step = b.step("config-test", "run configuration tests without compiling the editor"); - config_test_step.dependOn(&run_config_tests.step); - if (testMatch(b, unit_profile, test_filters, config_test_step)) |check| check.addArtifactArg(config_tests); const diff_tests = b.addTest(.{ .root_module = hxdiff.root_module, .filters = test_filters }); const run_diff_tests = b.addRunArtifact(diff_tests); run_diff_tests.has_side_effects = true; -- cgit v1.3 From 97a55ab32adf7e65494fd9f23d7f973798bb646a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 23:24:22 -0300 Subject: The board image links again: sources are no longer embedded by default on esp32p4 uzksuumxruzr turned -Dembed-sources on for esp32p4 (before it, the board was the one build without them). The sources are ~1.8 MB against a 1.5 MiB app partition, so the object built but the firmware did not link: .flash.rodata overflowed by 786392 bytes and .flash.text by 1732312. Default off everywhere; -Dembed-sources=true still embeds them. Without them the image is 1459760 B, 113104 B under 1.5 MiB. Co-Authored-By: Claude Opus 5.5 --- build.zig | 4 +++- docs/config.md | 2 +- docs/fs.md | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 4a478ac5..b3382d4b 100644 --- a/build.zig +++ b/build.zig @@ -109,7 +109,9 @@ pub fn build(b: *std.Build) void { ninep_options.addOption(bool, "quic", enable_quic); const enable_mupdf = b.option(bool, "mupdf", "native PDF rendering with MuPDF (AGPL/commercial; native default on, web/esp32p4 off; -Dmupdf=false disables)") orelse !freestanding_core; const enable_jpx = b.option(bool, "jpx", "JPEG 2000 in PDFs, for scanned documents (default on; -Djpx=false drops openjpeg)") orelse true; - const embed_sources = b.option(bool, "embed-sources", "serve the editor's own sources under /src of its 9P tree (default off; on for -Dplatform=esp32p4, whose only source is the device)") orelse is_esp32p4; + // Off on the board too: the sources are ~1.8 MB, more than the whole + // 1.5 MiB app partition, and with them the image does not link. + const embed_sources = b.option(bool, "embed-sources", "serve the editor's own sources under /src of its 9P tree (default off; the esp32p4 image has no room for them)") orelse false; const is_web_target = target.result.cpu.arch == .wasm32 and target.result.os.tag == .freestanding; const is_esp32p4_target = target.result.cpu.arch == .riscv32 and target.result.os.tag == .freestanding; const optimize = if (is_web) diff --git a/docs/config.md b/docs/config.md index 0332d854..a9db1467 100644 --- a/docs/config.md +++ b/docs/config.md @@ -556,7 +556,7 @@ while unset. `Motion` sets how every such effect moves: see docs/effects.md. `EffectCode PanelAscii` or `EffectCode Crt` lists the current backend's build-embedded source paths under `/virtual`. Look opens each full file; no checkout is needed, but the build must carry them (`-Dembed-sources=true`, -the default only for esp32p4); otherwise the command reports them unavailable. TTY exposes grid transitions, native GUI builds also +off by default); otherwise the command reports them unavailable. TTY exposes grid transitions, native GUI builds also expose scene shaders, and web has neither. Shared implementations share paths. SDL reports whether GLSL was compiled during this build or came from the `-Dprebuilt-shaders` snapshot paired with the committed SPIR-V. diff --git a/docs/fs.md b/docs/fs.md index 45b04675..27a36248 100644 --- a/docs/fs.md +++ b/docs/fs.md @@ -645,8 +645,9 @@ Fid), released on close or disconnect; past that such an open fails with `-Dembed-sources=true` embeds the editor's sources and serves them under `/src` (and `/shaders` on GUI builds). `EffectCode ` lists the current backend's implementation files under `/virtual`, which Look opens; without the -option the command reports the sources as unavailable. The esp32p4 build -enables the option by default, so the device can serve its own source. +option the command reports the sources as unavailable. It is off by default +everywhere; the esp32p4 image in particular has no room for them (~1.8 MB of +source against a 1.5 MiB app partition). This is a control filesystem, not a complete POSIX export. Native filenames may contain up to 255 bytes. Existing regular OS files support read, write, -- cgit v1.3