From b22fa2638bca470bbd8c5ea4768eb0eaaa3e8195 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 19:14:11 -0300 Subject: Build: a word that prints this build into a +Build pane (SPC h b): the version line, the commit, the jj change and the build time (stamped as the commit is: release builds and the ~/.local install, else "not stamped"), the zig that built it, its mode, target, platform and grammars, whether the addons are compiled in, the wire's semantics hash and the dependencies; build.zig stamps the change (jj log -r git_head()) and the time (date -u) through one command helper beside gitCommit; a T1 case reads the pane Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/Output.zig | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/Output.zig') diff --git a/src/Output.zig b/src/Output.zig index 384bb500..c719f909 100644 --- a/src/Output.zig +++ b/src/Output.zig @@ -1029,6 +1029,33 @@ pub fn openMessages(p: *Pardes, id: usize) !void { /// The version banner plus the embedded CHANGELOG, so an installed binary can /// say what it is and what changed without a repository beside it. +/// The `Build` word's pane: what this binary is, one fact a line. +pub fn openBuild(p: *Pardes, id: usize) !void { + const builtin = @import("builtin"); + var out: std.Io.Writer.Allocating = .init(p.gpa); + errdefer out.deinit(); + const w = &out.writer; + try w.print("{s}\n", .{@import("upgrade.zig").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", + }); + try w.print("zig {s}\nmode {s}\ntarget {s}-{s}-{s}\nplatform {s}\n", .{ + builtin.zig_version_string, @tagName(builtin.mode), + @tagName(builtin.cpu.arch), @tagName(builtin.os.tag), + @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 (@import("builtin_addons").on) "compiled in" else "loaded from /lib/pardes/addons", + @import("wire.zig").semantics, + build_options.deps, + }); + const content = try out.toOwnedSlice(); + return openRead(p, id, .{ .cmd = .Build }, "", content); +} + pub fn openChangelog(p: *Pardes, id: usize) !void { var out: std.Io.Writer.Allocating = .init(p.gpa); errdefer out.deinit(); -- cgit v1.3