diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 05:54:02 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 07:16:43 -0300 |
| commit | 94f0c9359dc1b8ccd73bf58812bec9e78fb52073 (patch) | |
| tree | f68697ffebe65a1d7f8d5bf78bf97d8c625ff9a8 | |
| parent | c84834523cc53d2a46eea06ae7e26d92df0d022b (diff) | |
| download | pardes-94f0c9359dc1b8ccd73bf58812bec9e78fb52073.tar.gz pardes-94f0c9359dc1b8ccd73bf58812bec9e78fb52073.zip | |
Every EINVAL or ENOENT refusal a unit test meets must say its errno in words a 9ns mount maps back: pardes re-pins cloud9, whose fs.enameErrno knows acme's address and argument refusals
The tests' request helper asks cloud9's fs.enameErrno, the rules 9ns
turns a refusal's words back into an errno with, for every EINVAL and
ENOENT a request is refused with, and fails the test when a mount
would hear another (EIO, mostly): "this pane has no text to address"
was one. The re-pinned cloud9 maps acme's own refusals, which pardes
keeps in acme's words: no match for regexp, address out of range,
addresses out of order, range past end of body and the rest.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| -rw-r--r-- | build.zig.zon | 4 | ||||
| -rw-r--r-- | src/ninep/testing.zig | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/build.zig.zon b/build.zig.zon index a478df6e..5efe9c28 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -9,8 +9,8 @@ // read-only HTTPS URL is what a manifest can carry. Re-pin with // `zig fetch --save=cloud9 git+https://git.sr.ht/~gbrls/cloud9#<commit>`. .cloud9 = .{ - .url = "git+https://git.sr.ht/~gbrls/cloud9#12d78be492351e29144daa379232bbd955b47631", - .hash = "cloud9-0.1.0-yt86qjoTHgAqXvz1h23WqTagtZNodmM5lkWFZ7Ld_880", + .url = "git+https://git.sr.ht/~gbrls/cloud9#552584ad79448988646231c7993a36e55b0e8c05", + .hash = "cloud9-0.1.0-yt86qlkdHgCC4CRZQA1ttzUYpZ07PoIxzIysTOSSbmqW", }, // Pinned to the exact libvaxis commit ghostty is built against, so it // is compatible with ghostty's uucode configuration (the one we share diff --git a/src/ninep/testing.zig b/src/ninep/testing.zig index b8eaa02b..a35a9cf0 100644 --- a/src/ninep/testing.zig +++ b/src/ninep/testing.zig @@ -3,6 +3,7 @@ const std = @import("std"); const pardes = @import("../pardes.zig"); const tree = @import("tree.zig"); +const cloud9 = @import("cloud9"); const Pardes = pardes.Pardes; pub const Req = tree.Req; @@ -33,6 +34,13 @@ pub const Answer = struct { pub fn call(p: *Pardes, req: Req) Answer { var ans: Answer = .{}; ans.reply = p.serveFs(req); + // An EINVAL or ENOENT refusal says so in words a 9ns mount maps back + // to it (cloud9's enameErrno), or a shell through the mount hears EIO. + const said = ans.reply; + if (said.status == .err and said.ename.len > 0 and (said.errno == E.INVAL or said.errno == E.NOENT) and cloud9.fs.enameErrno(said.ename) != said.errno) { + std.debug.print("a mount reads this refusal as errno {d}, not {d}: \"{s}\"\n", .{ cloud9.fs.enameErrno(said.ename), said.errno, said.ename }); + @panic("a refusal's words do not say its errno"); + } ans.bytes = p.fsPayload(ans.reply); while (p.nextEffect()) |e| switch (e) { .save_file, .save_text => ans.saved = true, |
