forked from emscripten-forge/pyjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e15a5c
commit de54a07
Showing
6 changed files
with
523 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,10 +39,11 @@ jobs: | |
run: | | ||
playwright install | ||
- name: Setup emsdk | ||
shell: bash -el {0} | ||
run: | | ||
micromamba activate pyjs-wasm | ||
emsdk install ${{matrix.emsdk_ver}} | ||
./emsdk/setup_emsdk.sh ${{ matrix.emsdk_ver }} $(pwd)/emsdk_install | ||
- name: create wasm build environment | ||
run: | | ||
|
@@ -61,9 +62,8 @@ jobs: | |
- name: Build pyjs | ||
run: | | ||
emsdk activate ${{matrix.emsdk_ver}} | ||
source $CONDA_EMSDK_DIR/emsdk_env.sh | ||
source $(pwd)/emsdk_install/emsdk_env.sh | ||
mkdir build | ||
pushd build | ||
|
@@ -88,8 +88,7 @@ jobs: | |
- name: Build xeus-python | ||
run: | | ||
emsdk activate ${{matrix.emsdk_ver}} | ||
source $CONDA_EMSDK_DIR/emsdk_env.sh | ||
source $(pwd)/emsdk_install/emsdk_env.sh | ||
git clone [email protected]:jupyter-xeus/xeus-python.git | ||
pushd xeus-python | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
emsdk/patches/0001-Add-back-fs.findObject-and-fs.readFile-in-loadLibDat.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From 0170462a78e86de9ee95017bfa7e4a3dd620a375 Mon Sep 17 00:00:00 2001 | ||
From: Hood Chatham <[email protected]> | ||
Date: Fri, 2 Jun 2023 11:59:32 -0700 | ||
Subject: [PATCH] Add back fs.findObject and fs.readFile in loadLibData | ||
|
||
See upstream PR: | ||
https://github.com/emscripten-core/emscripten/pull/19513 | ||
--- | ||
src/library_dylink.js | 13 +++++++++++-- | ||
1 file changed, 11 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/library_dylink.js b/src/library_dylink.js | ||
index d7676cdc2..f616d230d 100644 | ||
--- a/src/library_dylink.js | ||
+++ b/src/library_dylink.js | ||
@@ -993,14 +993,23 @@ var LibraryDylink = { | ||
#endif | ||
|
||
// for wasm, we can use fetch for async, but for fs mode we can only imitate it | ||
+ var libData; | ||
if (handle) { | ||
var data = {{{ makeGetValue('handle', C_STRUCTS.dso.file_data, '*') }}}; | ||
var dataSize = {{{ makeGetValue('handle', C_STRUCTS.dso.file_data_size, '*') }}}; | ||
if (data && dataSize) { | ||
- var libData = HEAP8.slice(data, data + dataSize); | ||
- return flags.loadAsync ? Promise.resolve(libData) : libData; | ||
+ libData = HEAP8.slice(data, data + dataSize); | ||
} | ||
} | ||
+ if (!libData && flags.fs && flags.fs.findObject(libName)) { | ||
+ libData = flags.fs.readFile(libName, {encoding: 'binary'}); | ||
+ if (!(libData instanceof Uint8Array)) { | ||
+ libData = new Uint8Array(libData); | ||
+ } | ||
+ } | ||
+ if (libData) { | ||
+ return flags.loadAsync ? Promise.resolve(libData) : libData; | ||
+ } | ||
|
||
var libFile = locateFile(libName); | ||
if (flags.loadAsync) { | ||
-- | ||
2.25.1 | ||
|
37 changes: 37 additions & 0 deletions
37
emsdk/patches/0001-Add-useful-error-when-symbol-resolution-fails.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
From a8bdb50a29062ee70c8667e4fd94dde47917f8fa Mon Sep 17 00:00:00 2001 | ||
From: Hood Chatham <[email protected]> | ||
Date: Fri, 19 May 2023 12:19:00 -0700 | ||
Subject: [PATCH] Add useful error when symbol resolution fails | ||
|
||
Currently if symbol resolution fails, we get: | ||
```js | ||
TypeError: Cannot read properties of undefined (reading 'apply') | ||
``` | ||
It is very hard for newcomers to Emscripten to recognize this as a | ||
symbol resolution error. Even for people experienced with this message, | ||
it has the annoyance that it doesn't give any hint as to which symbol | ||
went missing. | ||
|
||
This adds a descriptive error message with the name of the missing | ||
symbol. | ||
--- | ||
src/library_dylink.js | 3 +++ | ||
1 file changed, 3 insertions(+) | ||
|
||
diff --git a/src/library_dylink.js b/src/library_dylink.js | ||
index d96e6b425..7f63b5c5e 100644 | ||
--- a/src/library_dylink.js | ||
+++ b/src/library_dylink.js | ||
@@ -727,6 +727,9 @@ var LibraryDylink = { | ||
var resolved; | ||
stubs[prop] = function() { | ||
if (!resolved) resolved = resolveSymbol(prop); | ||
+ if (!resolved) { | ||
+ throw new Error(`Dynamic linking error: cannot resolve symbol ${prop}`); | ||
+ } | ||
return resolved.apply(null, arguments); | ||
}; | ||
} | ||
-- | ||
2.25.1 | ||
|
Oops, something went wrong.