@@ -917,14 +917,12 @@ const manifestInterpreterFromWrapArgObject = async (
917
917
// If this is not a "normal" interpreter run the library path optimization, including any additional paths from the user.
918
918
if ( interpreter . kind !== "normal" ) {
919
919
const { executable, libraryPaths, libraryPathStrategy } = arg ;
920
- if ( executable ) {
921
- interpreter = await optimizeLibraryPaths ( {
922
- executable,
923
- interpreter,
924
- libraryPaths,
925
- libraryPathStrategy,
926
- } ) ;
927
- }
920
+ interpreter = await optimizeLibraryPaths ( {
921
+ executable,
922
+ interpreter,
923
+ libraryPaths,
924
+ libraryPathStrategy,
925
+ } ) ;
928
926
}
929
927
930
928
return manifestInterpreterFromWrapInterpreter ( interpreter ) ;
@@ -1263,7 +1261,7 @@ const interpreterFromElf = async (
1263
1261
} ;
1264
1262
1265
1263
type OptimizeLibraryPathsArg = {
1266
- executable : string | tg . Template | tg . File | tg . Symlink ;
1264
+ executable ? : string | tg . Template | tg . File | tg . Symlink | undefined ;
1267
1265
interpreter :
1268
1266
| wrap . DyLdInterpreter
1269
1267
| wrap . LdLinuxInterpreter
@@ -1318,17 +1316,21 @@ const optimizeLibraryPaths = async (
1318
1316
}
1319
1317
1320
1318
// Prepare to map needed libraries to their locations.
1321
- let neededLibraries = await getInitialNeededLibraries ( executable ) ;
1319
+ let neededLibraries = executable
1320
+ ? await getInitialNeededLibraries ( executable )
1321
+ : new Map ( ) ;
1322
1322
1323
1323
// Produce a set of the available library paths as directories with optional subpaths.
1324
1324
const libraryPathSet = await createLibraryPathSet ( paths ) ;
1325
1325
1326
1326
// Find any transitively needed libraries in the set and record their location.
1327
- neededLibraries = await findTransitiveNeededLibraries (
1328
- executable ,
1329
- libraryPathSet ,
1330
- neededLibraries ,
1331
- ) ;
1327
+ neededLibraries = executable
1328
+ ? await findTransitiveNeededLibraries (
1329
+ executable ,
1330
+ libraryPathSet ,
1331
+ neededLibraries ,
1332
+ )
1333
+ : new Map ( ) ;
1332
1334
1333
1335
// All optimization strategies required filtering first.
1334
1336
const filtereredNeededLibraries : Map < string , DirWithSubpath > = new Map ( ) ;
0 commit comments