diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-01 22:45:09 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | 96ee55b304b0f0a8d340c6a6d0f3c931b08788dd (patch) | |
| tree | d66d5a76b3fb79c50f691f1621612a3c01871d1b | |
| parent | 3bde721b4013136df8076cbb1f5612445cd9808e (diff) | |
| download | pardes-96ee55b304b0f0a8d340c6a6d0f3c931b08788dd.tar.gz pardes-96ee55b304b0f0a8d340c6a6d0f3c931b08788dd.zip | |
added static linking
| -rw-r--r-- | build.zig | 10 | ||||
| -rw-r--r-- | main.zig | 2 | ||||
| -rw-r--r-- | tests.zig | 2 |
3 files changed, 12 insertions, 2 deletions
@@ -13,17 +13,23 @@ pub fn build(b: *std.Build) void { // pump/waitFor and on every assertion) so failures can be inspected live. // Usage: `zig build test -Dtrace`. const trace = b.option(bool, "trace", "print captured tty/screen state during e2e tests") orelse false; + const static_link = b.option(bool, "static", "link all build executables and test binaries statically") orelse false; + const exe_linkage: ?std.builtin.LinkMode = if (static_link) .static else null; + const strip = b.option(bool, "strip", "strip debug info from the compiled pardes binary") orelse false; const exe = b.addExecutable(.{ .name = "pardes", + .linkage = exe_linkage, .root_module = b.createModule(.{ .target = target, .optimize = optimize, .root_source_file = b.path("main.zig"), + .strip = strip, }), }); const tests = b.addExecutable(.{ .name = "pardes-e2e", + .linkage = exe_linkage, .root_module = b.createModule(.{ .target = target, .optimize = optimize, @@ -170,6 +176,7 @@ pub fn build(b: *std.Build) void { // `zig build tutor-gen` runs it; the unit-test step depends on the output. const tutor_gen = b.addExecutable(.{ .name = "tutor-gen", + .linkage = exe_linkage, .root_module = b.createModule(.{ .target = target, .optimize = optimize, @@ -203,6 +210,7 @@ pub fn build(b: *std.Build) void { .root_source_file = b.path("modal.zig"), }), }); + unit_tests.linkage = exe_linkage; const run_unit = b.addRunArtifact(unit_tests); const unit_step = b.step("unit-test", "run modal.zig unit tests"); unit_step.dependOn(&run_unit.step); @@ -217,6 +225,7 @@ pub fn build(b: *std.Build) void { .root_source_file = b.path("petscii.zig"), }), }); + petscii_tests.linkage = exe_linkage; const run_petscii = b.addRunArtifact(petscii_tests); unit_step.dependOn(&run_petscii.step); test_step.dependOn(&run_petscii.step); @@ -231,6 +240,7 @@ pub fn build(b: *std.Build) void { .root_source_file = tutor_cases_lazy, }), }); + tutor_tests.linkage = exe_linkage; // The generated cases `@import("modal")` (a module name, not a relative // path, since the generated file lives in the cache dir, not next to modal.zig). const modal_for_tutor = b.createModule(.{ @@ -83,7 +83,7 @@ extern "c" fn realpath(path: [*:0]const u8, resolved: [*]u8) ?[*:0]u8; // basic file navigation // basic shell io // acme-style layout: columns split horizontally, windows stacked in each column. -// * /home/goblin/05-genizah/plan9port/src/cmd/acme +// * see plan9port's acme: src/cmd/acme // right click and enter on lines to open files at specified lines const PtyRead = struct { id: usize, bytes: []u8 }; @@ -206,7 +206,7 @@ pub fn main(init: std.process.Init) !void { try hs.pump(600); try hs.expectContains("CMDHIDEZZ", "command output not shown in normal mode"); // The prompt row (with the typed command) is hidden in normal mode now too. We - // check "echo CMDHIDEZZ" (this pane's prompt row) rather than "goblin@" since a + // check "echo CMDHIDEZZ" (this pane's prompt row) rather than a shell prompt (e.g. "user@host") since a // raw-tty pane elsewhere could show its own prompt. try hs.expectNotContains("echo CMDHIDEZZ", "command line still visible in normal mode (prompt row not hidden)"); |
