Commit Graph

125 Commits

Author SHA1 Message Date
Gyeongjae Choi a64e534d03
Load shared libraries locally (#4876)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-30 20:05:25 +09:00
Hood Chatham c319cc7770
Fix dynamic library loading in cli runner (#4871)
All dependent libs should be loaded as globals. We should try  to use this to
simplify some of the logic in dynload.ts. Most likely what needs to happen is we
need to inspect the wheel at build time to determine which libraries are
"leaves" that are not dependencies of anything else and add this list to the
package metadata.

This should be removed eventually, because it is a bug somewhere else in the
dynamic loader that dependents need to be global.
2024-06-18 17:10:22 -07:00
Gyeongjae Choi 36565c7e9d
Revert "Update Emscripten to 3.1.60" (#4796) 2024-05-25 08:06:50 -04:00
Hood Chatham b16552a660
Update Emscripten to 3.1.60 (#4782) 2024-05-25 10:06:52 +09:00
Hood Chatham 9d2451d1fb
Emscripten 3.1.58 (#4715) 2024-05-07 09:59:57 +02:00
Joe Marshall ed9428e268
fix for exceptions in dynamic linked int64 code (#4698)
This is a backport of https://github.com/emscripten-core/emscripten/pull/21759 

It fixes a crash which happens when 
1) An exception is thrown inside a function returning int64
2) The function is in a dynamic library and has been called through dynamic invocation.
2024-04-17 17:36:26 +02:00
Hood Chatham 008a960945
Fix dup in nodefs (#4554)
Backport of emscripten-core/emscripten#21399. Resolves #4541.
2024-02-24 11:34:55 -08:00
Gyeongjae Choi a14d34fb1b
Emscripten 3.1.52 (#4399)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-23 21:18:42 +09:00
Hood Chatham 08585d91e5
Fix nodylink build (#4385) 2024-01-18 10:57:26 -08:00
Hood Chatham 4bafdafcca Update JSPI patch for Emscripten 3.1.45 2023-10-21 09:20:09 -07:00
Hood Chatham 3085cb9d5e Use Wasm Exceptions for invoke stubs if they exist (#3957)
If wasm exception handling is available, use dynamically generated modules
with wasm exception handling for the invoke stubs instead of a JS trampoline.
This is useful because JS trampolines interact poorly with JS Promise Integration.

In the future, we should switch exception handling ABIs to the compiler-provided
wasm exception handling ABI and we can remove this code. Currently we are
blocked on using compiler-provided wasm eh by Rust support.
2023-10-21 09:20:09 -07:00
Hood Chatham af7544cbbb
Add a no dynamic linking build option (#4203) 2023-10-14 12:13:27 -07:00
Hood Chatham b460383505
Use hoodmane/hiwire library instead of our own implementation (#4128)
This change switches to my external implementation of hiwire. This is the
minimal change set to do this, it uses some hacks to avoid changing any files
outside of `hiwire.{c,h,js}`. In followups, I will gradually switch to using
the new APIs rather than compatibility shims.
2023-09-23 18:21:19 -07:00
Hood Chatham 4774749070
FIX patch a bug in Emscripten that broke matplotlib (#4163) 2023-09-22 19:36:20 +09:00
Hood Chatham f28d8c9efc Revert JSPI Changes
This reverts commits:
9ed5e839ff
8861b317a6
b2c47ae766
ab8dc2eac6
3bcc527c92
2505d4d6a3
2023-09-14 07:26:46 -07:00
Hood Chatham 2505d4d6a3 Update JSPI patch for Emscripten 3.1.45 2023-09-13 16:38:29 -07:00
Hood Chatham 9ed5e839ff Use Wasm Exceptions for invoke stubs if they exist (#3957)
If wasm exception handling is available, use dynamically generated modules
with wasm exception handling for the invoke stubs instead of a JS trampoline.
This is useful because JS trampolines interact poorly with JS Promise Integration.

In the future, we should switch exception handling ABIs to the compiler-provided
wasm exception handling ABI and we can remove this code. Currently we are
blocked on using compiler-provided wasm eh by Rust support.
2023-09-13 16:22:07 -07:00
Hood Chatham df527fdad5
Emscripten 3.1.45 (#4094) 2023-08-29 13:37:31 +02:00
Hood Chatham 4d99d07366
Emscripten 3.1.44 (#4073) 2023-08-26 22:46:42 +02:00
Hood Chatham e19621d483
ENH Rework streams handling (#4035)
This fixes a number problems with the old stream handling:

1. Not possible to set a custom errno (necessary for proper interrupt
   handling and possibly for other things)

2. Inefficient: in a lot of cases we have data in one buffer and we need
   it placed into a different buffer, but we have to implement a function
   that gets one byte out of the source buffer and then call it repeatedly
   to move one byte at a time to the target buffer.

3. Ease of implementation: in many cases we already have perfectly good
   buffer manipulation APIs, so if we have direct access to the true source
   or target buffer we can just use these. See: the node IO code, which got
   much simpler.

This is backwards compatible, so you can still use the old input mechanism
or use buffered or raw output. But it adds a new method of directly implementing
read/write. For simplicity, we insure that the source/destination buffers are
always `Uint8Array` views that point to exactly the region that is meant to be
read/written.

The old mechanisms are faster than before and can correctly support keyboard
interrupts. Other than that I think the original behavior is unchanged. I added a
lot more test coverage to ensure backwards compatibility since there was pretty
anemic coverage before.

I think the read/write APIs are mostly pretty simple to use, with the exception
that someone might forget to return the number of bytes read. JavaScript's ordinary
behavior coerces the `undefined` to a 0, which leads to an infinite loop where the
filesystem repeatedly asks to read/write the same data since it sees no progress.
I added a check that writes an error message to the console and sets EIO when undefined
is returned so the infinite loop is prevented and the problem is explained.
2023-08-21 08:41:44 +02:00
Hood Chatham f8f026a5de
Emscripten 3.1.40 (#3888) 2023-08-08 21:16:43 +02:00
Hood Chatham 27071e63bf
Emscripten 3.1.39 (#3890) 2023-06-04 10:38:41 -07:00
Hood Chatham 01e1fd6e38
MAINT Add useful error when symbol resolution fails (#3894)
See upstream PR:
emscripten-core/emscripten#19402

This only affects development, it is not a user-facing change.
2023-06-02 13:04:58 -07:00
Hood Chatham 78084ef07c
Fix llvm-readobj when emscipten is installed with emsdk out of tree (#3840) 2023-05-08 17:34:00 -07:00
Hood Chatham 3a231a7822
NFC Fix llvm-readobj path hack (#3833)
By linking llvm-readobj into an emscripten directory which is on the path
2023-05-06 13:49:06 -07:00
Hood Chatham 4d09958ba0
Emscripten 3.1.29 (#3408) 2023-01-04 09:30:46 +09:00
Hood Chatham 8560319738
Make fs timestamps have millisecond resolution rather than second resolution (#3313)
Resolves https://github.com/pyodide/pyodide/issues/3311
2022-12-10 09:50:08 -08:00
Hood Chatham 2df7a286ee
Emscripten 3.1.26 (#3280) 2022-11-21 17:34:49 -08:00
Hood Chatham 3692ff8b22
Emscripten 3.1.25 (#3239)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>

Adds a patch reverting an Emscripten commit that dropped a freetype patch.
2022-11-14 13:44:29 -08:00
Hood Chatham 3dfe5b35ef
Emscripten 3.1.23 (#3148) 2022-11-07 08:51:24 -08:00
Gyeongjae Choi a916ea0b34
BLD simplify building CMake based packages (#3128)
This PR makes building CMake based packages easier.
- Introduce a custom toolchain file for Pyodide. It inherits most of settings from the original Emscripten toolchain file with some modifications. Packages built by pyodide-build will automatically use that toolchain file.
- Proxy cmake in pywasmcross.py, in order to proxy other compiler toolchains.
2022-09-22 10:42:26 +09:00
John Wason fd54f86136
Fix Robot Raconteur -Wenum-constexpr-conversion build error (#3105) 2022-09-15 20:44:00 -07:00
Hood Chatham 0eb6036b85
Update to emscripten 3.1.21 (#3107) 2022-09-15 16:58:14 -07:00
Hood Chatham 939b615df0
Emscripten 3.1.20 (#3027)
GSW patch:
TEOS-10/GSW-Python#99

galpy patch:
jobovy/galpy#499

pyerfa patch:
liberfa/pyerfa#89

astropy patch:
astropy/astropy#13586

scipy patch:
scipy/scipy#16924
2022-08-29 18:57:05 -07:00
Hood Chatham 3160ac937e
Add patch to Emscripten to fix some of the Jest problems (#3014)
This fixes one of the problems in #2764. 
See upstream PR emscripten-core/emscripten#17733
2022-08-26 11:57:09 -07:00
Hood Chatham 67aa16861d
Update Emscripten to 3.1.18 (#2950) 2022-08-21 17:17:49 -07:00
Gyeongjae Choi da70299d1e
Update emscripten to 3.1.15 (#2958) 2022-08-17 19:14:10 +09:00
John Wason 810be8869f
Add Robot Raconteur package to Pyodide (without wasm-exceptions) (#2794)
This PR adds the Robot Raconteur Pyodide package, which is a modified version
of Robot Raconteur designed to run in the Pyodide environment, using WebSockets
for communication. See robotraconteur/robotraconteur for the full version of the
package. Robot Raconteur is used to communicate with robots and other automation
components, and has a large library of drivers and packages: robotraconteur/robotraconteur-directory.
It is used as the bases for PyRI, a robotics programming environment: 
https://github.com/pyri-project/pyri-core/blob/master/README.md. Using a bridge, this package can
also be used to communicate with ROS2 networks: robotraconteur-contrib/robotraconteur_ros2_bridge
2022-06-26 21:17:58 -07:00
Hood Chatham f3e8836902
Update emscripten to v3.1.14 (#2775) 2022-06-23 15:51:06 -07:00
Hood Chatham 8d30ebdf13
Update emscripten patches again (#2684)
This drops the Rust patch and "Throw away errors in minify wasm_js" which
I suspect was fixed by an emscripten update (I'm not sure how long ago). It 
replaces the two remaining emscripten patches with new versions that match
the versions I am upstreaming.
2022-06-14 17:01:09 -07:00
Hood Chatham 9c305efc46
Fix cryptography build after emscripten update (#2683) 2022-06-14 14:54:07 +02:00
Hood Chatham c834085995
Use emscripten 3.1.13 (#2679) 2022-06-10 22:26:10 +02:00
Hood Chatham 52f27f06ad
Update to emscripten 3.1.6 (#2672) 2022-06-10 08:13:36 -07:00
Hood Chatham dbbbbb67b2
Cryptography v36.0.2 w/ Rust (#2378) 2022-06-09 10:57:34 -07:00
Hood Chatham 95b1194945
Enable Wasm BigInt (#2643)
This enables WASM_BIGINT while maintaining (hypothetical) Safari 14 support
by shimming BigInt64Array and BigUint64Array if they are missing. I think the
last time we tried to enable WASM_BIGINT was before #2019 so our chances
are significantly better this time.

This will fix dynamic linking bugs and yields a minor reduction in code size.
2022-06-02 10:09:54 -07:00
Hood Chatham 5595eb1305
Fix uname to report emscripten version accurately (#2608)
This is needed for the normal Python packaging system to accurately determine the platform tag for wheels for #2591.
This has been fixed upstream: https://github.com/emscripten-core/emscripten/pull/17026
2022-05-24 15:25:25 -07:00
Hood Chatham 694c47f151
Update emscripten to 2.0.27 (#2295) 2022-03-23 23:31:13 -07:00
Hood Chatham 5897646e04
MAINT Update emscripten to 2.0.24 (#2035) 2022-03-23 23:27:46 -07:00
Hood Chatham 0f2ce88edb
Rework core tests (#2265)
The goal of this commit is to add the capability of skipping specific tests by
glob pattern. Many core test sets have just one test that uses subprocess or
threads. Others have a few tests that are failing due to upstream problems in
emscripten. I went through and switched to skipping specific tests in as many
cases as I could. In modules where most or all tests use threading or
subprocess, I gave up and put a comment saying something like 35/50 tests fork
and I didn't want to bother to salvage the remaining ones.

In order to accommodate using patterns to skip specific tests (and also extra
comments) I switched the format of python_tests to a yaml file. This gives us
significantly more flexibility in the structure of the file and allows us to use
ruamel.yaml to update it. We gain a lot flexibility while reducing the length of
make_test_lists.py modestly from 108 to 78 loc.

In the future, hopefully we should be able to make fixes by deleting one skip
pattern and looking into why that particular test fails.
2022-03-22 13:41:43 -07:00
Hood Chatham 0e1e2ac01c
Python 3.10 (#2225) 2022-03-17 15:48:56 -07:00