pyo3/emscripten/emscripten_patches/0001-Add-_gxx_personality_v0-stub-to-library.js.patch
Hood Chatham da5b9814cc
Set up CI for wasm32-emscripten target (#2436)
* ci: test on emscripten target

This adds CI to build libpython3.11 for wasm32-emscripten and
running tests against it. We need to patch instant to work
around the emscripten_get_now:
https://github.com/sebcrozet/instant/pull/47

We also have to patch emscripten to work aroung the "undefined
symbol gxx_personality_v0" error:
https://github.com/emscripten-core/emscripten/issues/17128

I set up a nox file to download and install emscripten,
download and build cpython, set appropriate environment variables
then run cargo test. The workflow just installs python, rust,
node, and nox and runs the nox session.

I xfailed all the test failures. There are problems with datetime.
iter_dict_nosegv and test_filenotfounderror should probably be
fixable. The tests that involve threads or asyncio probably can't
be fixed.

* Some cleanup

* Remove instant patch

* Add explanations for xfails
2022-06-08 05:59:18 +01:00

29 lines
1 KiB
Diff

From 4b56f37c3dc9185a235a8314086c4d7a6239b2f8 Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchatham@gmail.com>
Date: Sat, 4 Jun 2022 19:19:47 -0700
Subject: [PATCH] Add _gxx_personality_v0 stub to library.js
Mitigation for an incompatibility between Rust and Emscripten:
https://github.com/rust-lang/rust/issues/85821
https://github.com/emscripten-core/emscripten/issues/17128
---
src/library.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/library.js b/src/library.js
index e7bb4c38e..7d01744df 100644
--- a/src/library.js
+++ b/src/library.js
@@ -403,6 +403,8 @@ mergeInto(LibraryManager.library, {
abort('Assertion failed: ' + UTF8ToString(condition) + ', at: ' + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']);
},
+ __gxx_personality_v0: function() {},
+
// ==========================================================================
// time.h
// ==========================================================================
--
2.25.1