Skip to content

Commit

Permalink
Patch dynlib search to check /usr/lib
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Feb 5, 2025
1 parent 280c14d commit 788b3d0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pyodide/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ if (typeof FinalizationRegistry === "undefined") {
unregister(){}
};
}
function patchDynlibLookup(Module, libName) {
try {
return Module.FS.readFile("/usr/lib/" + libName);
} catch(e) {
console.log("Failed", e);
}
}
"""

REPLACEMENTS = [
Expand Down Expand Up @@ -169,6 +177,10 @@ REPLACEMENTS = [
"eval(UTF8ToString(ptr))",
"(() => {throw new Error('Internal Emscripten code tried to eval, this should not happen, please file a bug report with your requirements.txt file\\'s contents')})()",
],
[
"!libData&&flags.fs",
"!(libData ??= patchDynlibLookup(Module, libName))&&flags.fs"
]
]

expand_template(
Expand Down

0 comments on commit 788b3d0

Please sign in to comment.