diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-14 21:26:47 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-09-15 17:24:42 -0300 |
| commit | a624a56e289e4a02a411f83741f0f2c9fc0f0b2e (patch) | |
| tree | b87e3ca10dd1c4417112164f792b5da1e26de0a6 /build.zig | |
| parent | 95681ff7017b8a9e4c8f9fa6a7371d1233432f2f (diff) | |
| download | pardes-a624a56e289e4a02a411f83741f0f2c9fc0f0b2e.tar.gz pardes-a624a56e289e4a02a411f83741f0f2c9fc0f0b2e.zip | |
Add Linux Tty9p mounted terminals and forward raw TTY keys
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 53 |
1 files changed, 53 insertions, 0 deletions
@@ -1131,6 +1131,43 @@ pub fn build(b: *std.Build) void { run_fs_test.has_side_effects = true; b.step("fs-test", "exercise default 9P service and mounts with an independent client").dependOn(&run_fs_test.step); + const run_discovery = b.addSystemCommand(&.{ "python3", "-B", "test/fs.py" }); + run_discovery.addArtifactArg(exe); + run_discovery.addArg("--discovery"); + run_discovery.setCwd(b.path(".")); + run_discovery.has_side_effects = true; + b.step("fs-discovery-test", "test browsable pane creation over 9P").dependOn(&run_discovery.step); + + if (target.result.os.tag == .linux) { + const v9fs_helper = b.addExecutable(.{ + .name = "pardes-v9fs", + .root_module = b.createModule(.{ + .root_source_file = b.path("src/linux/v9fs.zig"), + .target = target, + .optimize = requested_optimize, + .link_libc = true, + }), + }); + // Ordinary executable; each launch asks sudo inside its own PTY. + b.installArtifact(v9fs_helper); + const run_v9fs = b.addSystemCommand(&.{ "python3", "-B", "test/v9fs.py" }); + run_v9fs.addArtifactArg(exe); + run_v9fs.addArtifactArg(v9fs_helper); + run_v9fs.setCwd(b.path(".")); + run_v9fs.has_side_effects = true; + b.step("v9fs-test", "probe Linux kernel 9P mounts in a private subprocess namespace (requires sudo -v)").dependOn(&run_v9fs.step); + const run_v9fs_driver = b.addSystemCommand(&.{ "python3", "-B", "test/v9fs_driver_test.py" }); + run_v9fs_driver.setCwd(b.path(".")); + run_v9fs_driver.has_side_effects = true; + b.step("v9fs-driver-test", "test kernel-mount probe launcher without privileges or compiling the editor").dependOn(&run_v9fs_driver.step); + const run_v9fs_terminal = b.addSystemCommand(&.{ "python3", "-B", "test/v9fs_terminal.py" }); + run_v9fs_terminal.addArtifactArg(exe); + run_v9fs_terminal.addArtifactArg(v9fs_helper); + run_v9fs_terminal.setCwd(b.path(".")); + run_v9fs_terminal.has_side_effects = true; + b.step("v9fs-terminal-test", "exercise Tty9p authentication routing and cleanup without mount privileges").dependOn(&run_v9fs_terminal.step); + } + const run_agent_session_test = b.addSystemCommand(&.{ "python3", "-B", "test/agent_session_test.py" }); run_agent_session_test.addArtifactArg(exe); if (platform == .gui) run_agent_session_test.addArg("--gui-grid"); @@ -1229,6 +1266,22 @@ pub fn build(b: *std.Build) void { b.step("9p-io-test", "run native 9P transport and client integration tests") .dependOn(&b.addRunArtifact(ninep_io_tests).step); + const fs_module = b.createModule(.{ + .root_source_file = b.path("src/fs.zig"), + .target = target, + .optimize = optimize, + .link_libc = true, + }); + fs_module.link_objects.appendSlice(b.allocator, core_module.link_objects.items) catch @panic("OOM"); + var fs_imports = core_module.import_table.iterator(); + while (fs_imports.next()) |entry| fs_module.addImport(entry.key_ptr.*, entry.value_ptr.*); + if (enable_quic) { + fs_module.linkSystemLibrary("ssl", .{}); + fs_module.linkSystemLibrary("crypto", .{}); + } + const fs_tests = b.addTest(.{ .root_module = fs_module, .filters = test_filters }); + b.step("fs-unit-test", "run filesystem unit tests").dependOn(&b.addRunArtifact(fs_tests).step); + const protocol_step = b.step("9p-test", "run freestanding 9P protocol tests"); const history_step = b.step("history-test", "test historical comparisons and regression gates"); const protocol_match = testMatch(b, unit_profile, test_filters, protocol_step); |
