Repository navigation
Conversation
make test-e2e failed on macOS with the default TMPDIR. The e2e helpers budgeted the bytes of a bridge socket path against the sun_path limit and refused any home too deep for it, which every home under the macOS temp dir is. The budget was the helpers' own rule: the daemon binds and dials a socket at a path of any length. The daemon's choice of socket directory fed the problem. Without XDG_RUNTIME_DIR it used ~/.local/state on every system, macOS included, and it named each socket after its target, 44 bytes for a Local System session. - On macOS without XDG_RUNTIME_DIR, keep sockets in run/ in the provider's state directory, so under ~/Library by default (hostbridge runDirFor). Linux and XDG_RUNTIME_DIR keep the directories they had. - Name a socket by a 12-hex digest of its target, with the exit record beside it. A default macOS install then dials its sockets directly for a user name of up to 25 bytes. - Keep serving sessions that an earlier version started. Their bridges stay at <target>.sock in the directory that version used, and the runtime uses that socket while a bridge listens on it. Start refuses a target such a bridge still serves and clears a dead one's socket. - When a start fails because the run directory cannot hold a socket, the error says to set XDG_RUNTIME_DIR. - Drop the socket budget and the 4-char prefix limit from the e2e helpers. Teardown finds bridge sockets in every layout. - The fake bridge of the Go tests binds a long path through a short symlink, as a client dials one, and takes a connection that sends nothing, as the real bridge does. Fixes eclipse-enclave#36 Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
EclipseSourceAI
left a comment
There was a problem hiding this comment.
Note
Autonomous AI review. May contain mistakes.
Useful comment? React 👍. Disagree? React 👎 to reject it for follow-up reviews. A reply explaining why helps too.
Agent approval means no blocking issues found. Unrelated and Follow-up comments are non-blocking. A maintainer must still sign off.
Only a maintainer can re-request a review from this agent.
Powered by Eclipse Enclave via review-guard-mcp
Fixes #36. The e2e helpers no longer enforce their own sun_path budget, and the daemon changes where it keeps session bridge sockets: on macOS without XDG_RUNTIME_DIR they now go in run/ inside the provider's state dir, and every socket is named by a 12-hex digest of its target instead of <target>.sock. Bridges an earlier version started keep working, because Runtime.sock dials the old <target>.sock first and uses it while something answers there.
What maintainers should look at:
Runtime.socknow does I/O. Each operation for a target that still has an old socket file costs an extra connect (listening). Uncertain dial errors count as "alive", soStartrefuses rather than risk a duplicate agent. That fits the existingLocateElsewhereguard, but the not-serving classification is now written out in a second place (inline comment).- Sockets in the data dir on macOS. The removed comment said a networked home can't hold a unix socket. The PR answers that with a bind-failure hint, and that hint also appears when
XDG_RUNTIME_DIRis already set, where it gives the wrong advice (inline comment). - The new API e2e spec pins the digest file name, which is a daemon internal (inline nit).
Docs (ARCHITECTURE, CONFIGURATION, DEV) and the changelog block are updated and match the code. There's no UI change, so I didn't test anything visually. This environment has no Go toolchain and no installed node_modules, so I couldn't run the Go or vitest suites. I reviewed the code by reading it.
A bridge that cannot bind its socket made Start advise setting XDG_RUNTIME_DIR, also when XDG_RUNTIME_DIR had already chosen the directory the bind failed in. - The runtime remembers whether XDG_RUNTIME_DIR chose its run directory, and bindAdvice says nothing then. - sbridge.Listening takes over the bare connection check from hostbridge and shares its notion of "not serving" with ErrNotServing, so the two cannot drift apart. - shortHash and socketName share one digest helper. - The API e2e spec for socket placement no longer pins the shape of the socket's file name, which is the daemon's own business. Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
EclipseSourceAI
left a comment
There was a problem hiding this comment.
Note
Autonomous AI review. May contain mistakes.
Useful comment? React 👍. Disagree? React 👎 to reject it for follow-up reviews. A reply explaining why helps too.
Agent approval means no blocking issues found. Unrelated and Follow-up comments are non-blocking. A maintainer must still sign off.
Only a maintainer can re-request a review from this agent.
Powered by Eclipse Enclave via review-guard-mcp
Follow-up review. The single commit pushed since my last pass (ec795ce) addresses all four threads I opened, and I checked each claim against the code rather than taking the reply at face value:
sbridge.Listeningis now exported next toErrNotServing, both backed by the samenotServinghelper, andhostbridge.listeningis gone. Confirmed no leftover references.bindAdvicenow checks a newRuntime.inRuntimeDirfield, which is set fromenv.xdgRuntimeDir != ""innewRuntime. That's exactly the condition under whichrunDirForpicksXDG_RUNTIME_DIRas the run dir (namespacedRunDir), so the hint is correctly suppressed only when it would be useless.TestStartSaysHowToMoveSocketsWhenTheBindFailsnow covers that case.shortHashandsocketNameboth go through a shareddigest12, no more duplicated hashing logic.- The e2e spec now matches
[^/]+\.sockinstead of pinning the digest file name, keeping the directory (user-visible) checked without depending on the daemon-internal digest format.
No new issues in the diff since my last review; it's a tight, well-tested fix-up. No UI change, so no Playwright pass needed.
Suggested squash commit message:
fix: Keep session sockets where each platform keeps a user's
Fixes #36
`make test-e2e` failed on macOS with the default `TMPDIR`. The e2e helpers
counted the bytes of a bridge socket path against the `sun_path` limit and
refused any isolated home too deep for it, and every home under the macOS
temp directory is. That budget was the helpers' own rule, so this removes
it and fixes what made the paths long and odd: where the daemon puts its
session bridge sockets.
- On macOS without XDG_RUNTIME_DIR, sockets now go in `run/` inside the
provider's state directory instead of `~/.local/state`.
- A socket is named by a 12-hex digest of its target instead of
`<target>.sock`, keeping every path well inside sun_path even for a
deep -home-dir.
- Sessions an earlier version started keep working across the upgrade:
Start looks for that version's `<target>.sock` before picking a new one.
- A bind failure on a filesystem without unix sockets now says to set
XDG_RUNTIME_DIR, unless XDG_RUNTIME_DIR already chose the directory the
bind failed in.
- sbridge.Listening is now the one place that tells whether a bridge still
serves a socket; ErrNotServing and Listening agree on every case by
construction.
Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
These previous comments can be resolved as they are now handled:
- classification duplication fixed by exporting
sbridge.Listeningnext toErrNotServing - bindAdvice no longer suggests XDG_RUNTIME_DIR when it already chose the run dir
- e2e spec no longer pins the digest file name, only the directory
- shortHash and socketName now share one digest12 helper
I can't resolve them myself as I would need write permission on this repository.
Fixes #36
What and why
make test-e2efailed on macOS with the defaultTMPDIR. The e2e helpers counted the bytes of a bridge socket path against thesun_pathlimit and refused any isolated home too deep for it, and every home under the macOS temp directory is. That budget was the helpers' own rule. The daemon binds and dials a socket at a path of any length (proto.Listen,proto.DialContext), and with the check switched off the suite passed under the long temp directory.So this PR removes the budget instead of working around it, and fixes what made the paths long and odd in the first place: where the daemon puts its session bridge sockets. Without
XDG_RUNTIME_DIRit used~/.local/stateon every system, macOS included, and it named each socket after its target, which is 44 bytes for a Local System session.Daemon
On macOS without
XDG_RUNTIME_DIR, sockets now go torun/in the provider's state directory, so under~/Libraryby default (hostbridgerunDirFor). Nothing else moves:XDG_RUNTIME_DIRis set, on any system$XDG_RUNTIME_DIR/homeshell-<hash>/, as beforerun/in the state directory~/.local/state/homeshell-<hash>/, as beforeA socket file is named by a 12-hex digest of its target, with the exit record beside it. A default macOS install then dials its sockets directly for a user name of up to 25 bytes. Longer paths still work through the existing long-path handling.
Sessions that an earlier version started keep working across the upgrade. Their bridges stay at
<target>.sockin the directory that version used, and the runtime uses that socket while a bridge listens on it.Startrefuses a target such a bridge still serves, and clears the socket file of one that died.legacyRunDiris unchanged.A data directory on a filesystem without unix sockets (exFAT, for one) cannot hold
run/. A start that fails on the bind now says to setXDG_RUNTIME_DIR, unlessXDG_RUNTIME_DIRis already set and chose the directory the bind failed in.e2e helpers
checkSocketBudget,worstSocketPath, and the 4-char prefix limit ofisolatedHomeare gone. The e2e root stays$TMPDIR/hs-e2e-<hash>on every platform.bridgeSocketsfinds sockets in every layout the daemon uses, so the teardown still stops each bridge.sbridgetest) binds a long path through a short symlink, the way a client dials one, and takes a connection that sends nothing, as the real bridge does.How I checked the upgrade path
Besides the unit tests, I started a session with a daemon built without this change, stopped that daemon, and started this branch's daemon on the same data directory, once with
XDG_RUNTIME_DIRand once without. In both cases the session stayedrunning, took a prompt, and could be deleted, and a new session got a digest-named socket. With the lookup disabled the same session never becamerunning.On macOS with the default
TMPDIR, the test failures left are the ones #37, #38, #30, and #32 fix, and an occasionalEOFwhen an Enclave session is stopped, which is #40.Changelog
Checklist
AGENTS.md)AGENTS.md