diff --git a/environment-dev_3.1.45.yml b/environment-dev_3.1.45.yml index c91225b..2d5d5c8 100644 --- a/environment-dev_3.1.45.yml +++ b/environment-dev_3.1.45.yml @@ -8,7 +8,7 @@ dependencies: - yarn - click - empack >=3.0.1 - - microsoft::playwright + - microsoft::playwright <= 1.50 - ninja - nodejs - pyjs_code_runner >= 2.0.1 diff --git a/environment-dev_3.1.58.yml b/environment-dev_3.1.58.yml index 1525559..6e520e8 100644 --- a/environment-dev_3.1.58.yml +++ b/environment-dev_3.1.58.yml @@ -8,7 +8,7 @@ dependencies: - yarn - click - empack >=3.0.1 - - microsoft::playwright + - microsoft::playwright <= 1.50 - ninja - nodejs - pyjs_code_runner >= 2.0.1 diff --git a/include/pyjs/pre_js/dynload/dynload.js b/include/pyjs/pre_js/dynload/dynload.js index 1629367..8ee2482 100644 --- a/include/pyjs/pre_js/dynload/dynload.js +++ b/include/pyjs/pre_js/dynload/dynload.js @@ -202,13 +202,18 @@ async function loadDynlib(prefix, lib, global, searchDirs, readFileFunc) { const fs = createDynlibFS(prefix, lib, searchDirs, readFileFunc); const libName = Module.PATH.basename(lib); - //console.log(`load ${lib} (${libName}) `) + + // contains cpython-3 and with wasm32-emscripten + const is_cython_lib = libName.includes("cpython-3") && libName.includes("wasm32-emscripten"); + + // load cython library from full path + const load_name = is_cython_lib ? lib : libName; - await Module.loadDynamicLibrary(libName, { + await Module.loadDynamicLibrary(load_name, { loadAsync: true, nodelete: true, allowUndefined: true, - global: global, + global: global && !is_cython_lib, fs: fs }) @@ -219,13 +224,14 @@ async function loadDynlib(prefix, lib, global, searchDirs, readFileFunc) { console.execption(`Failed to load ${libName} from ${lib} LDSO not found`); } - if (!dsoOnlyLibName) { + if(!is_cython_lib){ + if (!dsoOnlyLibName) { + Module.LDSO.loadedLibsByName[libName] = dsoFullLib + } - Module.LDSO.loadedLibsByName[libName] = dsoFullLib - } - - if(!dsoFullLib){ - Module.LDSO.loadedLibsByName[lib] = dsoOnlyLibName; + if(!dsoFullLib){ + Module.LDSO.loadedLibsByName[lib] = dsoOnlyLibName; + } } } finally { releaseDynlibLock();