mirror of
https://github.com/stablyai/orca.git
synced 2026-11-03 02:27:43 +00:00
fix(wsl): restore Windows interop after another distro wipes it (#27682)
* fix(wsl): detect and restore a wiped WSLInterop entry in running distros On WSL < 3.0.1 a graceful stop of any systemd distro deletes every binfmt_misc entry VM-wide, so Windows .exe launches (code ., explorer.exe, the orca WSL CLI bridge) fail with Exec format error in every other distro. Check, never boot: 5 s after a WSL terminal env build (gated on the distro being in the confirmed running list, at most once a minute per distro), and whenever a confirmed running-distro probe shows another distro stopped. Repair is automatic and idempotent as root, skipped when the distro's wsl.conf sets [interop] enabled=false, single-flight per distro, with a 10 minute backoff after a failed repair. * fix(wsl): repair interop with a single register write matching WSL's flags Busybox printf writes a trailing newline separately; the kernel registers the entry, then rejects the lone newline, so the repair reported failure after succeeding. Write without the newline and let the re-check decide. Use WSL's own P flags rather than PF, and treat an entry restored between probe and repair as intact. Add a spawn-budget test.
This commit is contained in:
@@ -17,9 +17,15 @@ export function quotePosixShell(value: string): string {
|
||||
*/
|
||||
export function buildWslExecArgs(
|
||||
distro: string | undefined,
|
||||
shellArgs: readonly string[]
|
||||
shellArgs: readonly string[],
|
||||
options: { user?: string } = {}
|
||||
): string[] {
|
||||
return [...(distro ? ['-d', distro] : []), '--exec', ...shellArgs]
|
||||
return [
|
||||
...(distro ? ['-d', distro] : []),
|
||||
...(options.user ? ['-u', options.user] : []),
|
||||
'--exec',
|
||||
...shellArgs
|
||||
]
|
||||
}
|
||||
|
||||
export function buildWslLoginShellCommand(command: string): string {
|
||||
|
||||
Reference in New Issue
Block a user