Skip to content

Python tests for dynamic build#122

Closed
vidyalakshmir wants to merge 18 commits intomainfrom
python-tests-dynamic
Closed

Python tests for dynamic build#122
vidyalakshmir wants to merge 18 commits intomainfrom
python-tests-dynamic

Conversation

@vidyalakshmir
Copy link
Copy Markdown
Contributor

@vidyalakshmir vidyalakshmir commented Mar 5, 2026

Update 4/14/26
PR 191 has a clean version of python build script. Hence closing this.

This PR is to aimed to track the progress of the python tests for dynamic build of python and fix failed tests. We will have another PR to actually integrate python tests to the repo. Preferably a single test script that works for both static and dynamic builds.

We use

  • dylink_impl_integration_Mar5 branch of lind-wasm repo. This repo currently have some hacks since multi-process and signal support is not supported in dynamic loading. Glibc fixes from PR is integrated into the dylink_impl_integration_Mar5 branch
  • build-python branch of lind-wasm-apps repo

How to run the tests:

cd lind-wasm
git pull
git checkout dylink_impl_integration_Mar5
make
scripts/make_shared_glibc.sh
scripts/make_shared_libm.sh 
cd src/lind-boot
cargo build --features disable_signals
cd ~/
git clone --recursive https://github.com/Lind-Project/lind-wasm-apps.git
cd lind-wasm-apps/
make merge-sysroot
git checkout build-python
cd python
./build_python_wasm.sh
./build_shared_python_wasm.sh
./run_python_shared_tests.sh

Test Results :

Total duration: 2 min 57 sec
Total tests: run=16,949 failures=33 skipped=937
Total test files: run=486/491 failed=96 env_changed=2 skipped=158 resource_denied=5

Failures

  1. unknown import: env::mpd_setminalloc has not been defined

  2. unknown import: env::PyExpat_XML_ExpatVersion has not been defined

  3. unknown import: env::openpty has not been defined

  4. unknown import: env::getrusage has not been defined

  5. FileNotFoundError: [Errno 2] No such file or directory: '/tmp/test_python_435196æ/@test_1_tmpæcan_symlink'

  6. OSError: [Errno 38] Function not implemented: '@test_1_tmp-?| ò?~X?~A?~_'
    test_single_files (test.test_unicode_file.TestUnicodeFiles.test_single_files)

  7. Decore Error

ERROR: test_decode_strict (test.test_codecs.LocaleCodecTest.test_decode_strict) (encoded=b'UCS:\xc3\xa9\xe2\x82\xac\xf4\x8f\xbf\xbf')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/test/test_codecs.py", line 3808, in check_decode_strings
    decoded = self.decode(encoded, errors)
  File "/usr/local/lib/python3.14/test/test_codecs.py", line 3775, in decode
    return _testinternalcapi.DecodeLocaleEx(encoded, 0, errors)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
RuntimeError: decode error: pos=4, reason=decoding error
  1. Encode Error

ERROR: test_encode_surrogateescape (test.test_codecs.LocaleCodecTest.test_encode_surrogateescape) (text='UCS:é?~B?\U0010ffff')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/test/test_codecs.py", line 3748, in check_encode_strings
    encoded = self.encode(text, errors)
  File "/usr/local/lib/python3.14/test/test_codecs.py", line 3735, in encode
    return _testinternalcapi.EncodeLocaleEx(text, 0, errors)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
RuntimeError: encode error: pos=4, reason=encoding error
  1. Assertion Error
FAIL: test_decode_surrogateescape (test.test_codecs.LocaleCodecTest.test_decode_surrogateescape) (encoded=b'UCS:\xc3\xa9\xe2\x82\xac\xf4\x8f\xbf\xbf')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/test/test_codecs.py", line 3809, in check_decode_strings
    self.assertEqual(decoded, expected)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
AssertionError: 'UCS:\udcc3\udca9\udce2\udc82\udcac\udcf4\udc8f\udcbf\udcbf' != 'UCS:é?~B?\U0010ffff'
- UCS:\udcc3\udca9\udce2\udc82\udcac\udcf4\udc8f\udcbf\udcbf
+ UCS:é?~B??~O??
ERROR: testZip64LargeFile (test.test_zipimport.UncompressedZipImportTestCase.testZip64LargeFile)
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/test/test_zipimport.py", line 992, in testZip64LargeFile
    with ZipFile(TEMP_ZIP, "r") as z:
         ~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/zipfile/__init__.py", line 1471, in __init__
    self._RealGetContents()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.14/zipfile/__init__.py", line 1561, in _RealGetContents
    raise BadZipFile("Bad magic number for central directory")
zipfile.BadZipFile: Bad magic number for central directory
ERROR: test_absolute_imports (test.test_modulefinder.ModuleFinderTest.test_absolute_imports)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/test/test_modulefinder.py", line 324, in tearDown
    shutil.rmtree(self.test_dir)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/shutil.py", line 852, in rmtree
    _rmtree_impl(path, dir_fd, onexc)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/shutil.py", line 721, in _rmtree_safe_fd
    _rmtree_safe_fd_step(stack, onexc)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/shutil.py", line 802, in _rmtree_safe_fd_step
    onexc(func, path, err)
    ~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/shutil.py", line 762, in _rmtree_safe_fd_step
    orig_st = orig_entry.stat(follow_symlinks=False)
OSError: [Errno 75] Value too large for defined data type: '/tmp/tmpxiq8m2ox/a'
ERROR: test_check_closed (test.test_dbm_dumb.DumbDBMTestCase.test_check_closed)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/test/test_dbm_dumb.py", line 206, in test_check_closed
    f = dumbdbm.open(_fname, 'c')
  File "/usr/local/lib/python3.14/dbm/dumb.py", line 310, in open
    um = _os.umask(0)
FileNotFoundError: [Errno 2] No such file or directory
ERROR: test_dumbdbm_creation_mode (test.test_dbm_dumb.DumbDBMTestCase.test_dumbdbm_creation_mode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/test/test_dbm_dumb.py", line 48, in test_dumbdbm_creation_mode
    old_umask = os.umask(0o002)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.14/test/test_dbm_dumb.py", line 52, in test_dumbdbm_creation_mode
    os.umask(old_umask)
             ^^^^^^^^^
UnboundLocalError: cannot access local variable 'old_umask' where it is not associated with a value
test_warn_explicit_non_ascii_filename (test.test_warnings.PyWarnTests.test_warn_explicit_non_ascii_filename) ...
thread 'main' (2182) panicked at /home/lind/lind-wasm/src/wasmtime/crates/typemap/src/path_conversion.rs:125:19:
-1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (2182) panicked at /rustc/b90dc1e597db0bbc0cab0eccb39747b1a9d7e607/library/core/src/panicking.rs:225:5:
panic in a function that cannot unwind

FAIL: test_thread_info (test.test_sys.SysModuleTest.test_thread_info)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/test/test_sys.py", line 740, in test_thread_info
    self.assertEqual(info.name, "pthread-stubs")
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'pthread' != 'pthread-stubs'
- pthread
+ pthread-stubs

@vidyalakshmir vidyalakshmir changed the title Python tests for dynamic build Python build script with tests and cleanup scripts Apr 14, 2026
@vidyalakshmir vidyalakshmir changed the title Python build script with tests and cleanup scripts Build and test python Apr 14, 2026
@vidyalakshmir vidyalakshmir changed the title Build and test python Python tests for dynamic build Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants