From ba996acfcad1698adbf4a1834fe50e73b1c6cab9 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 19 Sep 2026 23:28:22 -0300 Subject: Rename programs: 9player -> 9ns, introspect -> 9proc, app -> web (9web) Directories, binaries, build options (-D9ns, -D9proc), step names, module name (9proc), thread and fs names, env var NINEPLAYER_MOUNT -> NINE_MOUNT, docs and test scripts. Browser assets move to web/static. Co-Authored-By: Claude Fable 5.1 --- build.zig | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 63d9735..13e54ec 100644 --- a/build.zig +++ b/build.zig @@ -16,7 +16,7 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); const wasm = b.addExecutable(.{ .name = "cloud9", .root_module = b.createModule(.{ - .root_source_file = b.path("app/client.zig"), + .root_source_file = b.path("web/client.zig"), .target = wasm_target, .optimize = optimize, .imports = &.{.{ .name = "cloud9", .module = wasm_core }}, @@ -30,10 +30,10 @@ pub fn build(b: *std.Build) void { const web = b.step("web", "Install the standalone browser client into zig-out/web"); web.dependOn(&b.addInstallFileWithDir(wasm.getEmittedBin(), .{ .custom = "web/_cloud9" }, "cloud9.wasm").step); for ([_][]const u8{ "index.html", "app.mjs", "client.mjs", "style.css" }) |file| { - web.dependOn(&b.addInstallFileWithDir(b.path(b.fmt("app/web/{s}", .{file})), .{ .custom = if (std.mem.eql(u8, file, "index.html")) "web" else "web/_cloud9" }, file).step); + web.dependOn(&b.addInstallFileWithDir(b.path(b.fmt("web/static/{s}", .{file})), .{ .custom = if (std.mem.eql(u8, file, "index.html")) "web" else "web/_cloud9" }, file).step); } - const bridge = b.addExecutable(.{ .name = "cloud9-http", .root_module = b.createModule(.{ - .root_source_file = b.path("app/main.zig"), + const bridge = b.addExecutable(.{ .name = "9web", .root_module = b.createModule(.{ + .root_source_file = b.path("web/main.zig"), .target = target, .optimize = optimize, .link_libc = true, @@ -44,7 +44,7 @@ pub fn build(b: *std.Build) void { const run_bridge = b.addRunArtifact(bridge); if (b.args) |args| run_bridge.addArgs(args); b.step("serve", "Run the HTTP/WebSocket bridge (--upstream tcp:127.0.0.1:564)").dependOn(&run_bridge.step); - const native_http = b.addExecutable(.{ .name = "cloud9-http-test", .root_module = b.createModule(.{ + const native_http = b.addExecutable(.{ .name = "9web-test", .root_module = b.createModule(.{ .root_source_file = b.path("test/web/native.zig"), .target = target, .optimize = optimize, @@ -127,58 +127,58 @@ pub fn build(b: *std.Build) void { // ------------------------------------------------------------------ // Programs related to cloud9. Each lives in its own directory beside - // src/ (introspect/, 9player/) with a build.zig *fragment* exposing + // src/ (9proc/, 9ns/) with a build.zig *fragment* exposing // `add(b, ctx)`; it is imported here and runs with this builder, so its // b.path() calls are relative to this root and its steps are namespaced // by the program's name. New related programs follow the same pattern: // add a directory, a fragment, a toggle here, and the path to // build.zig.zon. // - // -Dintrospect=[bool] library module (any target) + freestanding check; - // demo server and Linux suites when the target is Linux - // -D9player=[bool] the FUSE mount CLI (Linux only) + // -D9proc=[bool] library module (any target) + freestanding check; + // demo server and Linux suites when the target is Linux + // -D9ns=[bool] the FUSE mount CLI (Linux only) // // Both default to true on a Linux target and false elsewhere. Enabled - // programs are installed by the plain `zig build` next to cloud9-http + // programs are installed by the plain `zig build` next to 9web // and cloud9-probe. const is_linux = target.result.os.tag == .linux; - const want_introspect = b.option(bool, "introspect", "Build the introspect library module and demo (default: target is Linux)") orelse is_linux; - const want_9player = b.option(bool, "9player", "Build the 9player FUSE mount CLI (default: target is Linux; Linux only)") orelse is_linux; - if (want_9player and !is_linux) { - std.debug.print("error: -D9player=true needs a Linux target (got {s})\n", .{@tagName(target.result.os.tag)}); + const want_9proc = b.option(bool, "9proc", "Build the 9proc library module and demo (default: target is Linux)") orelse is_linux; + const want_9ns = b.option(bool, "9ns", "Build the 9ns FUSE mount CLI (default: target is Linux; Linux only)") orelse is_linux; + if (want_9ns and !is_linux) { + std.debug.print("error: -D9ns=true needs a Linux target (got {s})\n", .{@tagName(target.result.os.tag)}); std.process.exit(1); } const programs_test = b.step("programs-test", "Run every enabled program's unit tests and checks"); const programs_itest = b.step("programs-itest", "Run every enabled program's integration suites"); - const introspect_build = @import("introspect/build.zig"); - const nineplayer_build = @import("9player/build.zig"); + const proc_build = @import("9proc/build.zig"); + const ns_build = @import("9ns/build.zig"); - const introspect: ?introspect_build.Artifacts = if (want_introspect) introspect_build.add(b, .{ + const proc: ?proc_build.Artifacts = if (want_9proc) proc_build.add(b, .{ .target = target, .optimize = optimize, .cloud9 = module, }) else null; - if (introspect) |i| { + if (proc) |i| { programs_test.dependOn(i.test_step); programs_test.dependOn(i.check_step); if (i.debug_test_step) |s| programs_test.dependOn(s); } - const nineplayer: ?nineplayer_build.Artifacts = if (want_9player) nineplayer_build.add(b, .{ + const ns: ?ns_build.Artifacts = if (want_9ns) ns_build.add(b, .{ .target = target, .optimize = optimize, .cloud9 = module, - .introspect_demo = if (introspect) |i| i.demo else null, + .proc_demo = if (proc) |i| i.demo else null, }) else null; - if (nineplayer) |p| { + if (ns) |p| { programs_test.dependOn(p.test_step); programs_itest.dependOn(p.itest_step); } - // introspect's end-to-end suites drive the demo through a 9player mount, + // 9proc's end-to-end suites drive the demo through a 9ns mount, // so they are wired once both fragments have run. - if (introspect) |i| { - if (introspect_build.addPlayerTests(b, i, if (nineplayer) |p| p.exe else null)) |s| programs_itest.dependOn(s); + if (proc) |i| { + if (proc_build.addNsTests(b, i, if (ns) |p| p.exe else null)) |s| programs_itest.dependOn(s); } } -- cgit v1.3