diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 19:14:11 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 20:00:43 -0300 |
| commit | b22fa2638bca470bbd8c5ea4768eb0eaaa3e8195 (patch) | |
| tree | 08d0cc564bfe03861313f0acbf14f91f8dc94cc7 /src/Output.zig | |
| parent | 2ddd5bcbe8d470c00b045af5822418fe429357bc (diff) | |
| download | pardes-b22fa2638bca470bbd8c5ea4768eb0eaaa3e8195.tar.gz pardes-b22fa2638bca470bbd8c5ea4768eb0eaaa3e8195.zip | |
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 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Output.zig')
| -rw-r--r-- | src/Output.zig | 27 |
1 files changed, 27 insertions, 0 deletions
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 <prefix>/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(); |
