@@ -286,7 +286,7 @@ describe("WSL runtime cache", () => {
286286
287287 expect ( script ) . toContain ( 'runtime_parent="$HOME/.t3/wsl-runtime"' ) ;
288288 expect ( script ) . toContain ( ' [ -f "$ready_marker" ] &&' ) ;
289- expect ( script ) . toContain ( ' runtime_entry_runs "$runtime_root" &&' ) ;
289+ expect ( script ) . toContain ( ' runtime_entry_runs "$runtime_root" 2>/dev/null &&' ) ;
290290 expect ( script ) . toContain ( "if runtime_is_ready; then" ) ;
291291 expect ( script ) . not . toContain ( "bin.mjs" ) ;
292292 expect ( script ) . not . toContain ( "node-pty" ) ;
@@ -366,7 +366,7 @@ describe("WSL runtime cache", () => {
366366 "b" . repeat ( 64 ) ,
367367 ) ;
368368
369- expect ( script ) . toContain ( ' [ -x "$1/t3" ] && "$1/t3" --version >/dev/null 2>&1 ' ) ;
369+ expect ( script ) . toContain ( ' [ -x "$1/t3" ] && "$1/t3" --version >/dev/null' ) ;
370370
371371 const entryCheckDefined = script . indexOf ( "runtime_entry_runs() {" ) ;
372372 const readinessDefined = script . indexOf ( "runtime_is_ready() {" ) ;
@@ -478,14 +478,14 @@ describe.skipIf(posixShellRunner === null)("WSL runtime install script (executed
478478 fixtures . length = 0 ;
479479 } ) ;
480480
481- const createFixture = ( ) => {
481+ const createFixture = ( serverEntry = SERVER_ENTRY_SOURCE ) => {
482482 const result = runShell (
483483 [
484484 "set -eu" ,
485485 "work=$(mktemp -d)" ,
486486 'stage="$work/stage/t3-0.0.0-linux-x64"' ,
487487 'mkdir -p "$stage/node_modules/node-pty/build/Release" "$work/home"' ,
488- `printf '%s' ${ sh ( SERVER_ENTRY_SOURCE ) } > "$stage/t3"` ,
488+ `printf '%s' ${ sh ( serverEntry ) } > "$stage/t3"` ,
489489 'chmod +x "$stage/t3"' ,
490490 `printf '%s' 'pty-native-payload' > "$stage/node_modules/node-pty/build/Release/pty.node"` ,
491491 `tar -czf "$work/wsl-runtime.tar.gz" -C "$work/stage" t3-0.0.0-linux-x64` ,
@@ -599,6 +599,18 @@ describe.skipIf(posixShellRunner === null)("WSL runtime install script (executed
599599 expect ( parseWslRuntimeRoot ( warm . stdout ) ) . toBe ( fixture . runtimeRoot ) ;
600600 } ) ;
601601
602+ it ( "retains the loader error when a bundled executable needs a missing system library" , ( ) => {
603+ const fixture = createFixture (
604+ '#!/bin/sh\nprintf "error while loading shared libraries: libatomic.so.1: cannot open shared object file\\n" >&2\nexit 127\n' ,
605+ ) ;
606+
607+ const result = fixture . install ( ) ;
608+
609+ expect ( result . status ) . not . toBe ( 0 ) ;
610+ expect ( result . stderr ) . toContain ( "libatomic.so.1" ) ;
611+ expect ( parseWslRuntimeRoot ( result . stdout ) ) . toBeNull ( ) ;
612+ } ) ;
613+
602614 it ( "reinstalls a cache whose executable was truncated" , ( ) => {
603615 const fixture = createFixture ( ) ;
604616 expect ( fixture . install ( ) . status ) . toBe ( 0 ) ;
0 commit comments