diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-26 19:43:00 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-26 19:43:00 -0300 |
| commit | 87822a49e691c31566f257765dbcae5eeffc89dc (patch) | |
| tree | d1133330f322b148baf6a2c6bbb589df0482467b /core/panes.zig | |
| parent | 06c9201b3bea985a8d9658a9a95f09b11cb00535 (diff) | |
| download | pardes-87822a49e691c31566f257765dbcae5eeffc89dc.tar.gz pardes-87822a49e691c31566f257765dbcae5eeffc89dc.zip | |
Messages.readPlaces: a failed run's places are read against the directory its tool says it is in, as Emacs's compilation mode and Vim's errorformat (%D, %X) read them: after a make's `Entering directory 'X'` X's, until its `Leaving directory` (a make -C, a make in a make), after ninja's relative `Entering directory `out/x64'` the run's directory's out/x64; those lines are no detail (VIDEO2's B7, agent V5: `:make -C ../..` from V8's src/torque failed naming `src/torque/types.cc:163:53`, read as /tmp/v8/src/torque/src/torque/types.cc, so SPC e could not go there); THE CAUSE: readPlaces joined every relative path to the run's own directory (Pane.commandDone passes pane.cwdSlice()), and make's `make: Entering directory '/tmp/v8'` (and its Leaving) went by as rows; THE FIX: readPlaces keeps the directories entered, innermost last, in a fixed [8] (past it the depth still counts, so each Leaving leaves its own), and joins a relative place to the innermost (to the run's directory and it when that one is relative); no other reader of places, no dump, digest, frame or hot path touched (a failed run's last 400 rows, once at its exit); NOT COVERED: a Look on the same `path:line:col` words in the command pane's body still reads them against the pane's directory (look.zig), and a report row longer than the pane is wrapped by the terminal, its continuation read as a row (the long clang line of this change's first test gave its tail as detail: the test's line is shortened); RUN (TEST FIRST): panes.zig "a failed run's places are read against the directory its tool says it is in ..." runs `make -C ../..` from /tmp/pardes-cmd/src/torque and feeds the pane make's report: Entering /tmp/pardes-cmd, an error at src/torque/types.cc:163:53, make[1] Entering tools/ with a warning at check.cc:3:1, its Leaving, a note at utils.cc:7:2, make's Leaving, a note at types.h:1:1; it asks the four places /tmp/pardes-cmd/src/torque/types.cc:163:53, /tmp/pardes-cmd/tools/check.cc:3:1, /tmp/pardes-cmd/utils.cc:7:2, /tmp/pardes-cmd/src/torque/types.h:1:1 and no detail: fails on mnywmkpn 06c9201b3bea (the four read as /tmp/pardes-cmd/src/torque/src/torque/types.cc, .../src/torque/check.cc, .../src/torque/utils.cc, .../src/torque/types.h), passes now; Messages.zig's readPlaces test gains ninja's relative directory (`/src/v8/out/x64/../../src/api.cc`); a user hit it with every make -C or recursive make whose report names a relative path (and ninja -C, V8's own build); the real check (make 4.4 and clang++ on .scratch/walkui/CA/demo, this tree's Debug tui in a private session): see CA's report; GATES (Debug tui): shell-test -Dtest-filter=directory 79/79, core-test 1172/1348 (176 skipped: the new test needs a terminal, +1); load 1.5 to 7.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/panes.zig')
| -rw-r--r-- | core/panes.zig | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/panes.zig b/core/panes.zig index f4f528b7..67cee035 100644 --- a/core/panes.zig +++ b/core/panes.zig @@ -2023,6 +2023,33 @@ test "a command whose run fails naming places is an error of its pane, those pla try std.testing.expect(p.messages.headline() == null or p.messages.headline().?.kind != .@"error"); } +test "a failed run's places are read against the directory its tool says it is in: make's `Entering directory` (make -C, a make in a make) until its `Leaving directory`, as Emacs's compilation mode and Vim's %D and %X read them, those two lines no detail" { + if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane's terminal + const gpa = std.testing.allocator; + const p = try Pardes.init(gpa, .{}); + defer p.deinit(); + while (p.nextEffect()) |_| {} + p.setCwd(.at(0), "/tmp/pardes-cmd/src/torque"); + _ = try pardes.Kind.open(p, 1, pardes.Kind.test_kind.of(p), "/tmp/pardes-cmd/src/torque/pic.ppm", null); + const dst = exec.execute(p, 1, "make -C ../..") orelse return error.NoCommandPane; + while (p.nextEffect()) |_| {} + p.update(.{ .output = .{ .pane = .at(dst), .bytes = "make: Entering directory '/tmp/pardes-cmd'\r\n" ++ + "src/torque/types.cc:163:53: error: did you mean to use '->'?\r\n" ++ + "make[1]: Entering directory '/tmp/pardes-cmd/tools'\r\n" ++ + "check.cc:3:1: warning: unused variable 'b'\r\n" ++ + "make[1]: Leaving directory '/tmp/pardes-cmd/tools'\r\n" ++ + "utils.cc:7:2: note: declared here\r\n" ++ + "make: Leaving directory '/tmp/pardes-cmd'\r\n" ++ + "types.h:1:1: note: in the run's own directory again\r\n" } }); + p.update(.{ .exited = .{ .pane = .at(dst), .status = 2 } }); + const said = p.messages.headline() orelse return error.NothingSaid; + var names: [512]u8 = undefined; + var w: std.Io.Writer = .fixed(&names); + for (said.places[0..said.places_len]) |*place| try w.print("{s}:{d}:{d} ", .{ place.path.slice(), place.line, place.col }); + try std.testing.expectEqualStrings("/tmp/pardes-cmd/src/torque/types.cc:163:53 /tmp/pardes-cmd/tools/check.cc:3:1 /tmp/pardes-cmd/utils.cc:7:2 /tmp/pardes-cmd/src/torque/types.h:1:1 ", w.buffered()); + try std.testing.expectEqual(@as(u8, 0), said.detail_len); +} + test "a failed run's error names that run's places, each once: a rerun in the same pane does not read the run before it again, and a note at an error's place is not a second place" { if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane's terminal const gpa = std.testing.allocator; |
