The new JSPI does not require wasm type reflection, so it's possible that JS runtimes will have JSPI support but no type reflection, for instance if they are enrolled in the JSPI origin trial or have the JSPI flag on but not the type reflection flag.
If type reflection is missing, we fall back to attempting to instantiate a dummy module that imports a function with a given signature. This will raise a LinkerError if the signature is wrong. By trying all four possibilities, we learn the actual signature of the function.
Also fixes conversion for 64 bit integer buffers. I added a buffer-test package
so we can test 0d buffer conversion code without using numpy. In the future
ideally we should add more test buffer types to buffer-test so that we can move
more coverage of the buffer conversion code out of test_numpy and into the main
test suite.
Resolves pyodide#5084.
The JSPI API changed. Currently v8 implements both the old and the new version.
We want to keep support for the old version for a while so we can use stack
switching in node. This supports both.
I also simplified the implementation by quite a lot somewhat by accident in the
process of trying to work out how to support the new API.
Resolves#4883.
Include type defintion files in pyodide-core.tar.gz
Remove snapshot related files.
Remove test files.
TODO in the future: Remove source maps and webworker.js?
As suggested in #4942
Buster isn't available for anymore for Python 312 so we have to update.
This also updates to Python 3.11.7, which turns out to be relatively invasive. I broadly
xfailed failing tests in `python_tests.yaml` since we'll upgrade to Python 3.12 soon anyways.
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.
It seems that there is a bug in table instructions in Safari 16.3 which is used in the safari tests
but that Safari 16.4 has fixed it. xcode 15.0.0 uses Safari 16.6 which does not have the bug.
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.
This PR makes build variables only accessible through the API, instead of polluting os.environ.
I also changed the API as below, as a preparation to move away from makefiles.
- `get_make_environment_vars` => `get_build_environment_vars`
- `get_make_flag` => `get_build_flag`
Closes https://github.com/pyodide/pyodide/issues/3687
I forgot to make the changes for the dev deployment in
https://github.com/pyodide/pyodide/pull/3667
Overall those are mostly identical lines repeated several times, however
because the cost of error is pretty high I prefer not to factorize it
for now. Instead, we should rethink this system, maybe moving dev
deployment to a separate bucket and making release deployment immutable.
Set the MIME type for wheels and zip files to application/wasm to enable CDN compression. Also optionally disable compression in zip files and wheels to make the brotli compression by the CDN more efficient.
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>