Repository navigation
perf(wsl): fold the first libc probe into the WSL host facts exec - #35324
Conversation
The WSL connect's facts exec now also runs the libc probe's first command after its own marker. resolveOrcadRemoteContext takes it (with the login home) as a known fact, answering that one probe; the fallbacks still run over the transport if it proves nothing. One fewer serial guest round trip per connect; SSH passes no known facts, so its probes are unchanged.
|
STATUS: ready for e9-reviewer. Head 69fe0b0. Checks run: pnpm tc, typecheck:ci, code-quality:changed, anti-slop, oxlint, ast-grep, plus the wsl, managed-server, ssh and node-runtime suites (4379 passed). Lane re-measure: this PR's WSL2 run. Expect preLaunchCommands to go from 20 to 19. |
[Low impact] The PR appears safe to merge; no actionable issues were found. SummaryThe PR folds the first libc probe into the WSL host-facts command, avoiding one separate command before server startup.
Reviews (2) · Last reviewed commit: "fix(wsl): run the libc fallbacks through..." · Reviewed by Greptile |
With a folded first answer, the remaining libc probes used the fenced orcad runner; they now use the same plain execCommand the default probe does, so they match main exactly.
|
STATUS: e9-reviewer's LOW is fixed. Head e749b0f. The libc fallbacks now run through execCommand(connection, command, { signal }), the same as the default probe. A test asserts the getconf fallback uses that exact call. Checks run: pnpm tc, typecheck:ci, code-quality:changed, anti-slop, oxlint, ast-grep, plus the touched suites (134 passed). |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 minutes. View limit details
No actionable comments were generated in the recent review.
|
ELI5
Since #35070, connecting to a WSL distro reads the kernel version, home folder and platform in one trip into the distro. This adds the C-library check (
ldd --version) to that same trip, so each connect makes one fewer trip before the server starts.What Changed
WSL_HOST_FACTS_COMMANDnow ends withprintf '\n__ORCA_WSL_LIBC__\n'; LC_ALL=C ldd --version 2>&1 || true.readWslHostFactsaccepts the libc section only in its exact place: a blank line, then the marker line. Everything after the marker is the probe's output, so a multi-line answer such as musl's stays whole. Output missing that section fails the shape, and everything falls back to separate probes, as before.resolveOrcadRemoteContext's fifth parameter is now an options object:known: { loginHome?, firstLibcProbeOutput? }. It replaces perf(wsl): read the kernel, login home and platform in one exec #35070'sknownLoginHomestring, whose only caller is the WSL path.firstLibcProbeOutputanswers exactly one call of the libc probe's first command (LINUX_LIBC_FIRST_PROBE, now exported). If that output proves nothing, the probe's fallbacks (getconf, loaders) still run over the transport.Why
Lead decision: batch (a′) of the pre-launch batching proposal. It is low-risk and WSL-only. Batches (b) and (c) stay held because they touch shared SSH fence code.
SSH blast radius: no behavior change. SSH callers pass no
knownfacts, soresolveOrcadRuntimeTargetkeeps its default exec, and the probe text is unchanged. The shared files only gain an export and an optional parameter.Flag-off: no change. The facts exec runs only on the WSL host deploy path (
ORCA_INTERNAL_WSL_HOSTS).User-risk: low. The same probe runs, in the same shell as the other facts. A misparse falls back to the old separate probes.
Linked Issue
Internal WSL-via-orcad tracker, D3 bar (restart → first usable prompt).
Visual Proof
N/A: no UI.
Testing
orcad-remote-primitives.test.ts: a folded glibc answer yieldslinux-x64-glibcwith nolddexec. An unhelpful folded answer still runs thegetconffallback, and doesn't re-runldd.wsl-orcad-held-context.test.ts: a multi-line musl answer is kept whole; output without the libc section is rejected; the context receives{ loginHome, firstLibcProbeOutput }; fallbacks pass no libc. The real-shshape test still parses.src/main/wsl,managed-server,sshandnode-runtimesuites: 4379 passed.pnpm tc,typecheck:ci, code-quality, anti-slop and ast-grep pass.Status
Ready for e9-reviewer. The lane re-measure is this PR's WSL2 run:
preLaunchCommandsshould drop from 20 to 19.Checklist
N/Afor visuals with reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (CI runs the rest)