diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 11:15:26 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 12:42:13 -0300 |
| commit | 2e0eb4d7e2364a8cfe97eb56314af0b4be36be9b (patch) | |
| tree | 39784e0c093906fbc22ae04e2cffb5ae79422345 /dev/tui/tui.zig | |
| parent | c6234f250ee6f94bdeb57e1d77045d74149325fa (diff) | |
| download | pardes-2e0eb4d7e2364a8cfe97eb56314af0b4be36be9b.tar.gz pardes-2e0eb4d7e2364a8cfe97eb56314af0b4be36be9b.zip | |
upgrade: an Upgrade carries near clients (the last step's design 1.4, Z3): a client let go by an Upgrade dials again as before, and when the session runs another build (or another protocol) and a newer file is installed at its own start path since it started (upgrade.replaced), the client loop ends `.upgrade` and its frontend lets its screen go and execs that file as `--attach=<socket>:<name>` (client.zig execAgain), the same process, for the view the session kept for it (PARDES_JOIN_VIEW, Options.join_view, dialled patiently as a rejoin is): the terminal's is the blink (it leaves the alternate screen and enters it again; no record), the window a new window; a client whose start path holds no newer file keeps today's sentence "session upgraded to a newer pardes: upgrade this client too"; a far client the same, through its forward (PARDES_REPLICA_FAR=1); a pair with no daemon refuses the Upgrade in words ("no daemon keeps this session, so its client could not join it again"), since its first client has no socket to find the session again by (on the base the Upgrade cut the client off and ended the session); test/daemon.py upgrade_clients (a terminal client and a window client, each its own pane in its own view): old->new the base's clients are let go and told to upgrade too (what they do today), new->old they exec the base build and come back in a view of their own (the base reads no PARDES_JOIN_VIEW), new->(this built with -Dembed-sources, another semantics) each is back in ITS view with its own pane; `pair`'s no-daemon Upgrade refused; tui core-test 858/1013 (155 skipped), shell-test 1053/1056, term 17/17, pane 183/184, kitty 45/45, behaviour 275/275 and --replay 275/275, process-test 0 of 144 failed, both soaks diverged 0 unequal 0 corpus 22, daemon.py plain, --far, --games, --window-clients, --gui, --upgrade both ways (with clients) pass, gui unit-test 1650/1654 (the perf check's BaselineHarnessMismatch its one failure), macOS lib (Linux host), aarch64-macos, FreeBSD build (loads 3-15)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev/tui/tui.zig')
| -rw-r--r-- | dev/tui/tui.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig index bf051e9a..a3889d28 100644 --- a/dev/tui/tui.zig +++ b/dev/tui/tui.zig @@ -817,6 +817,12 @@ pub fn runClient(init: std.process.Init, opts: pardes.Options, path: []const u8, screen.leave(); Said.no(io, "{s}", .{start.said()}); }, + .upgrade => |view| { + // The blink: its screen left, the build at its start path + // exec'd, which enters it again. + screen.leave(); + Said.no(io, "{s}", .{client_loop.execAgain(&start, view)}); + }, } } @@ -1315,6 +1321,10 @@ const Shell = struct { const core = s.core; var why: [800]u8 = undefined; const path = upgrade.exe() orelse return core.reportFailure(pane, "Upgrade: this process does not know the path it was started from"); + // A client of a session no daemon keeps is a pair's first (no other + // can attach): let go, it has no socket to find the session again + // by, and the session would end with its last link. + if (s.peers.count() > 0 and daemon.link < 0) return core.reportFailure(pane, "Upgrade: no daemon keeps this session, so its client could not join it again; this session stays as it is"); // 9P is served while the new binary is asked (its clients' clunks // and reads after the word are answered), and not after. pardes.turn.rest(); |
