From 3e77fdcd57693b337d915873e9919de2e1ec6521 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 14:30:31 -0300 Subject: build: typst found at make time; the deprecated build names replaced docs.add takes typst through b.findProgramLazy: the three renders run the program found at make time, and without typst on PATH the step that renders fails ("program not found") where three addFail steps and the optional renders said so before. findProgram was the configure cache's poison; build() now poisons it itself, with the reason (the environment, the clock and vendor/ are read untracked: REORG decision 20 keeps the configure uncached). Line for a line: lazyDependency -> dependencyLazy (catch for orelse), runAllowFail -> runFallible, b.dupe -> b.graph.dupeString, .ReleaseSafe -> .safe; build.zig through zig fmt. Left: gui.zig's three lazyDependency calls (lines 62-176, which another change rewrites) and std.Build.package_map (no line-for-line replacement: dependencyLazy's error would have to reach build()). Gates: zig build -l and -h byte-identical, whole matrix and test/lib (its configuration too); the configuration gains the find-program step and the typst runs are named run typst (...) instead of by the path found, nothing else changes; --print-configuration-path still a tmp/ path, twice; zig build cheatsheet writes cheatsheet.pdf, and with PATH holding zig alone fails "program not found" while -l succeeds. Warm: install addons, core-test shell-test unit-test process-test on tui, and install addons on gui: 0 compiles not cached, binaries cmp-identical. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- build.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index d7906cfb..9fbea32f 100644 --- a/build.zig +++ b/build.zig @@ -10,7 +10,6 @@ const process_build = @import("build/process.zig"); /// The package manifest, imported untyped (build/core.zig has the reason). const zon = @import("build.zig.zon"); - pub const Platform = enum { tui, gui, macos }; pub const PerfBuild = struct { @@ -34,11 +33,16 @@ pub const macos_min_version: std.SemanticVersion = .{ .major = 13, .minor = 0, . pub const TreeSitterGrammars = enum { disabled, zig, minimal, full }; - pub fn build(b: *std.Build) void { // A package that depends on pardes takes its library; nothing of the // editor is configured for it. if (!b.isRoot()) return @import("build/library.zig").build(b); + // This configure reads the environment (HOME, XDG_DATA_HOME, + // HX_HARNESS), the clock (-Dtest-rebuild) and vendor/themes and + // vendor/queries without telling the configure cache, so it is never + // cached (REORG decision 20; typst's lookup did this before it moved to + // make time). + b.graph.poisonCache(); const requested_platform = b.option(Platform, "platform", "which shell to build (tui, gui, macos); absent builds the tui cli and the SDL gui together"); const platform = requested_platform orelse .tui; const also_gui = requested_platform == null; -- cgit v1.3