summaryrefslogtreecommitdiff
path: root/src/fs.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 11:40:11 -0300
committerGabriel Schneider <[email protected]>2026-11-05 12:41:36 -0300
commit3f1533813b6692a736251e4d467a7f108229ddee (patch)
tree37a32c5ebbf9d3af08923856fd6fa516f3b33a39 /src/fs.zig
parentcfd2b993feda1b3f7474225bb32db8cac8edc5ae (diff)
downloadpardes-3f1533813b6692a736251e4d467a7f108229ddee.tar.gz
pardes-3f1533813b6692a736251e4d467a7f108229ddee.zip
targets: the DOM web shell goes (src/web.zig and src/web/, its harnesses web_harness, web_snapshot, web_driver_test and web-snapshots/, tools/web_fixture.py, -Dplatform=web, -Ddump, and the web, web-harness, web-snap, web-e2e and web-driver-test steps), and with it what only a freestanding build needed: `hosted` and every guard on it (every build has a host now), memory's stack-fallback arenas and reduced_target sizes, the emscripten main, the tree-sitter libc shim and the stb stub, lsp's has_client, the web arms of the platform switches (-Dplatform is tui, gui or macos); the macOS files pass zig ast-check; docs/web.md is a paragraph on what it was
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/fs.zig')
-rw-r--r--src/fs.zig13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/fs.zig b/src/fs.zig
index 06351731..f32c6ea7 100644
--- a/src/fs.zig
+++ b/src/fs.zig
@@ -293,7 +293,6 @@ pub fn validMountName(name: []const u8) bool {
}
test "/os refuses a rename or a mode change as not permitted, in words, and still truncates to zero" {
- if (comptime !pardes.hosted) return error.SkipZigTest;
const p = try th.withFile(std.testing.allocator, "x\n");
defer p.deinit();
var tmp = std.testing.tmpDir(.{});
@@ -815,7 +814,6 @@ pub fn dotRelative(word: []const u8) bool {
/// Restore, a forwarded `pardes ~/x`. The path itself when there is no
/// `~` to expand, or no home for it.
pub fn expandHome(path: []const u8, out: *[4096]u8) []const u8 {
- if (comptime !pardes.hosted) return path;
if (path.len == 0 or path[0] != '~') return path;
// Home as the session that recorded found it (src/tape.zig).
return pardes.tape.value(.env, expandHomeHost, .{ path, out });
@@ -1096,10 +1094,7 @@ fn findEmbeddedSource(path: []const u8, allow_root_suffix: bool) ?Source {
return null;
}
-pub const platform_has_fs = !pardes.isolated and switch (pardes.platform) {
- .tui, .gui, .macos => true,
- .web => false,
-};
+pub const platform_has_fs = !pardes.isolated;
pub const find_skip = [_][]const u8{
".git", ".jj", "target", "node_modules",
@@ -1445,7 +1440,7 @@ pub const Namespace = struct {
pub fn mount(st: *Namespace, gpa: std.mem.Allocator, name: []const u8, dial: []const u8) !void {
if (!validMountName(name)) return error.BadMountName;
- if (comptime pardes.hosted) try ninep_io.Client.validateDial(dial);
+ try ninep_io.Client.validateDial(dial);
if (dial.len == 0 or std.mem.indexOfScalar(u8, dial, 0) != null) return error.BadDial;
for (st.mounts.items) |entry| if (std.mem.eql(u8, name, entry.name)) return error.AlreadyMounted;
if (st.mounts.items.len == max_mounts) return error.TooManyMounts;
@@ -1487,7 +1482,7 @@ pub fn unmount(p: *Pardes, name: []const u8) !void {
(path.len == prefix.len or path[prefix.len] == '/')) return error.MountInUse;
}
const removed = p.fs.mounts.orderedRemove(index);
- if (comptime pardes.hosted) ninep_io.Client.forget(removed.dial);
+ ninep_io.Client.forget(removed.dial);
p.gpa.free(removed.name);
p.gpa.free(removed.dial);
return;
@@ -1504,7 +1499,7 @@ test "the tree's README lists src/ only when the build serves it" {
}
test "a write open(2) refuses says its errno in words" {
- if (comptime @import("builtin").os.tag != .linux or !pardes.hosted) return error.SkipZigTest;
+ if (comptime @import("builtin").os.tag != .linux) return error.SkipZigTest;
// /proc takes no new file: ENOENT, which used to read "open failed".
try std.testing.expectError(error.NoSuchFileOrDirectory, writeFile("/proc/pardes-no-such-file", "x"));
var words: [128]u8 = undefined;