File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -362,7 +362,7 @@ export function preloadDynamicLibs(Module: Module): void {
362362 base = dynlibPath ;
363363 }
364364
365- const pathSplit = path . split ( '/' ) ;
365+ const pathSplit = Module . PATH . normalizeArray ( path . split ( '/' ) , true ) ;
366366 if ( pathSplit [ 0 ] == '' ) {
367367 // This is a file path beginning with `/`, like /session/metadata/vendor/pkg/lib.so. So we
368368 // are loading the vendored package's dynlibs here.
Original file line number Diff line number Diff line change @@ -56,6 +56,11 @@ interface DSO {
5656 exports : WebAssembly . Exports ;
5757}
5858
59+ // https://github.com/emscripten-core/emscripten/blob/main/src/lib/libpath.js
60+ interface PATH {
61+ normalizeArray : ( parts : string [ ] , allowAboveRoot : boolean ) => string [ ] ;
62+ }
63+
5964type PreRunHook = ( mod : Module ) => void ;
6065
6166interface EmscriptenSettings {
@@ -84,6 +89,7 @@ interface Module {
8489 API : API ;
8590 ENV : ENV ;
8691 LDSO : LDSO ;
92+ PATH : PATH ;
8793 newDSO : ( path : string , opt : object | undefined , handle : string ) => DSO ;
8894 _Py_Version : number ;
8995 _py_version_major ?: ( ) => number ;
You can’t perform that action at this time.
0 commit comments