summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 14:30:31 -0300
committerGabriel Schneider <[email protected]>2026-11-17 14:33:52 -0300
commit3e77fdcd57693b337d915873e9919de2e1ec6521 (patch)
treeee27b9006f26f0b83c17a13dd13ceaa07824c244 /build.zig
parent4f281f275f6e9b32b2fb5f0ebfc3e9b9338c0dce (diff)
downloadpardes-3e77fdcd57693b337d915873e9919de2e1ec6521.tar.gz
pardes-3e77fdcd57693b337d915873e9919de2e1ec6521.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig8
1 files changed, 6 insertions, 2 deletions
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;