New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to emscripten 1.38.34 with fastcomp #480
Conversation
No updates -- I had meant to look at this last week, but got derailed on other things... |
I'm getting a little farther by moving this to emscripten 1.38.38... Will report more later. |
Getting an error about needing |
Closing in favor of #531 |
08a39cb
to
71365a6
Compare
This is another attempt to update emscripten version by small increments. Current situation is that building CPython works (at least locally for me), but loading pyodide fails in tests which needs more investigation. Once CPython is working, it might be necessary to manually install binaryen as we did before to re-apply the |
I believe the |
This should be a bit easier now that update to 1.38.31 was made in #674 |
The error doesn't seem to be a numpy error. It happens with all C libraries. For example, the following also fail: import regex
from lxml import etree |
Ahh, thank you that's very helpful! In particular, |
I am very confused about why this happens. Running wasm-objdump on the
.so file shows that the same symbols are exported. On the other hand, as
far as I can tell, python is looking at the right file, because if I
delete the file, python complains in a different way. There doesn't seem
to be much room in between for things to go wrong.
|
FYI, |
I inserted the following snippet into void *handle = dlopen("/lib/python3.8/site-packages/regex/_regex.so", RTLD_LAZY);
if (handle == NULL) {
printf("Cannot dlopen\n");
} else {
printf("Can dlopen\n");
}
void *sym = dlsym(handle, "PyInit__regex");
if (sym == NULL) {
char* err = dlerror();
if (err != NULL) {
printf("%s\n", err);
printf("Cannot dlsym\n");
} else {
printf("Loaded symbol is NULL\n");
}
} else {
printf("Can dlsym\n");
} and forced the js bits to load
In other words, both EDIT 2: On the javascript side, the symbol |
Now C libraries can be correctly imported The relevant code was removed in upstream at emscripten-core/emscripten@16d0187 Thus, I have no intentions to upstream this fix.
The problem is identified and fixed in rth#1 . Feel free to merge, cherry pick, and/or squash it into your PR. |
Great work @dalcde, thank you! |
This reverts commit 4dc3fcb. scipy fails to build otherwise.
Thanks so much @dalcde ! The rest of the CI was fine. I'm truly happy about this being merged. That typo in emscripten was really a blocker. Now we can try to incrementally update to the latest emscripten version #476 (comment) |
This aims to upgrade the build system to use emscripten 1.36.36 (still with fastcomp), which should help with moving to the upstream llvm backend in #476 (using the same emscrtipten version).
One challenge is that previously we used emscripten, binaryen, patched clang of the same emsdk version, built from source to which additional patches were applied.
Currently, the latest available tags in emsdk are,
when we use the 1.38.36 tag, we do get that version of emscripten but then it's unclear whether previous versions of binaryen should be used (or if there is another way of setting
NUM_PARAMS
forFuncCastEmulation
).Here, I tried the 1.38.36 tag (emscripten) + binaryen-tag-1.38.31-64bit and I tried removing the clang-e1.38.31-64bit tag (since anyway we wouldn't be able to patch it with upstream llvm). This builds (locally) but fails to load for tests.
Will try re-adding clang tag, next.
cc @mdboom