Skip to content

Commit

Permalink
Revert changes other than to scipy
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Aug 31, 2022
1 parent 87d8462 commit 19bcdf1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/js/load-package.ts
Expand Up @@ -226,7 +226,7 @@ async function installPackage(
source: channel === DEFAULT_CHANNEL ? "pyodide" : channel,
});
for (const dynlib of dynlibs) {
await loadDynlib(dynlib);
await loadDynlib(dynlib, pkg.shared_library);
}
}

Expand Down Expand Up @@ -269,7 +269,7 @@ const acquireDynlibLock = createLock();
* @param shared Is this a shared library or not?
* @private
*/
async function loadDynlib(lib: string) {
async function loadDynlib(lib: string, shared: boolean) {
const node = Module.FS.lookupPath(lib).node;
let byteArray;
if (node.mount.type == Module.FS.filesystems.MEMFS) {
Expand Down Expand Up @@ -301,6 +301,12 @@ async function loadDynlib(lib: string) {
});
Module.preloadedWasm[lib] = module;
Module.preloadedWasm[lib.split("/").pop()!] = module;
if (shared) {
Module.loadDynamicLibrary(lib, {
global: true,
nodelete: true,
});
}
} catch (e: any) {
if (e && e.message && e.message.includes("need to see wasm magic number")) {
console.warn(
Expand Down

0 comments on commit 19bcdf1

Please sign in to comment.