Skip to content
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

bpo-40280: Address more test failures on Emscripten (GH-31050) #31050

Merged
merged 9 commits into from
Feb 5, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply Brett's suggestions
Co-authored-by: Brett Cannon <[email protected]>
tiran and brettcannon committed Feb 5, 2022
commit d92424742c2e7d7753590c5aa48d1aec5c8b1e3f
2 changes: 1 addition & 1 deletion Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
@@ -1278,7 +1278,7 @@ def reap_children():
# Need os.waitpid(-1, os.WNOHANG): Windows is not supported
if not (hasattr(os, 'waitpid') and hasattr(os, 'WNOHANG')):
return
if not has_subprocess_support:
elif not has_subprocess_support:
return

# Reap all our dead child processes so we don't leave zombies around.
2 changes: 1 addition & 1 deletion Lib/test/test_os.py
Original file line number Diff line number Diff line change
@@ -1175,7 +1175,7 @@ def test_iter_error_when_changing_os_environ_values(self):
def _test_underlying_process_env(self, var, expected):
if not (unix_shell and os.path.exists(unix_shell)):
return
if not support.has_subprocess_support:
elif not support.has_subprocess_support:
return

with os.popen(f"{unix_shell} -c 'echo ${var}'") as popen:
6 changes: 1 addition & 5 deletions Lib/test/test_pwd.py
Original file line number Diff line number Diff line change
@@ -69,11 +69,7 @@ def test_errors(self):

allnames = list(bynames.keys())
namei = 0
if allnames:
fakename = allnames[namei]
else:
# empty user db
fakename = "invaliduser"
fakename = allnames[namei] if allnames else "invaliduser"
while fakename in bynames:
chars = list(fakename)
for i in range(len(chars)):
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ Fix wasm32-emscripten test failures and platform issues.
wait, getrusage, prlimit, mkfifo, mknod, setres[gu]id, setgroups.
- Use fd_count to cound open fds.
- Add more checks for subprocess and fork.
- Add workarounds for missing _multiprocessing and failing socket.accept()
- Enable bzip2 again
- Disable large file support
- Disable signal.alarm for now
- Add workarounds for missing _multiprocessing and failing socket.accept().
- Enable bzip2.
- Disable large file support.
- Disable signal.alarm.
12 changes: 6 additions & 6 deletions Tools/wasm/README.md
Original file line number Diff line number Diff line change
@@ -81,13 +81,13 @@ node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscri

## wasm32-emscripten limitations and issues

- Most stdlib modules with dependency on external libraries are missing:
- Most stdlib modules with a dependency on external libraries are missing:
``ctypes``, ``readline``, ``sqlite3``, ``ssl``, and more.
- Shared extension modules are not implemented yet. All extension modules
are statically linked into the main binary.
- Processes are not supported. Calls like fork, popen, and subprocess
- Processes are not supported. System calls like fork, popen, and subprocess
fail with ``ENOSYS`` or ``ENOSUP``.
- Blocking sockets are not available. Non-blocking sockets don't work
- Blocking sockets are not available and non-blocking sockets don't work
correctly, e.g. ``socket.accept`` crashes the runtime. ``gethostbyname``
does not resolve to a real IP address. IPv6 is not available.
- The ``select`` module is limited. ``select.select()`` crashes the runtime
@@ -117,7 +117,7 @@ node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscri

### wasm32-emscripten in browsers

- The bundles stdlib is limited. Network-related modules,
- The bundled stdlib is limited. Network-related modules,
distutils, multiprocessing, dbm, tests and similar modules
are not shipped. All other modules are bundled as pre-compiled
``pyc`` files.
@@ -126,9 +126,9 @@ node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscri
### wasm32-emscripten in node

Node builds use ``NODERAWFS``, ``USE_PTHREADS`` and ``PROXY_TO_PTHREAD``
linker option.
linker options.

- Node RawFS allows direct access to the hosts file system.
- Node RawFS allows direct access to the host file system.
- pthread support requires WASM threads and SharedArrayBuffer (bulk memory).
The runtime keeps a pool of web workers around. Each web worker uses
several file descriptors (eventfd, epoll, pipe).