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

CPython 3.11 fails under WASI SDK 21 #116831

Closed
brettcannon opened this issue Mar 14, 2024 · 4 comments
Closed

CPython 3.11 fails under WASI SDK 21 #116831

brettcannon opened this issue Mar 14, 2024 · 4 comments
Labels
3.11 only security fixes OS-wasi tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@brettcannon
Copy link
Member

brettcannon commented Mar 14, 2024

Bug report

Bug description:

https://buildbot.python.org/all/#/builders/1370/builds/146/steps/11/logs/stdio

======================================================================
ERROR: test_issue16421_multiple_modules_in_one_dll (test.test_imp.ImportTests.test_issue16421_multiple_modules_in_one_dll)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_imp.py", line 249, in test_issue16421_multiple_modules_in_one_dll
    fileobj, pathname, description = imp.find_module(m)
                                     ^^^^^^^^^^^^^^^^^^
  File "/Lib/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_testimportmultiple'
======================================================================
ERROR: test_issue24748_load_module_skips_sys_modules_check (test.test_imp.ImportTests.test_issue24748_load_module_skips_sys_modules_check)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_imp.py", line 295, in test_issue24748_load_module_skips_sys_modules_check
    module = imp.load_dynamic(name, spec.origin)
                                    ^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'origin'
======================================================================
ERROR: test_load_module_extension_file_is_None (test.test_imp.ImportTests.test_load_module_extension_file_is_None)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_imp.py", line 278, in test_load_module_extension_file_is_None
    found = imp.find_module(name)
            ^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_testimportmultiple'
----------------------------------------------------------------------
Ran 29 tests in 0.131s
FAILED (errors=3, skipped=2)
test test_imp failed

CPython versions tested on:

3.11

Operating systems tested on:

Other

Linked PRs

@brettcannon brettcannon added type-bug An unexpected behavior, bug, or error 3.11 only security fixes tests Tests in the Lib/test dir OS-wasi labels Mar 14, 2024
@brettcannon
Copy link
Member Author

If the decision is made not to fix this, then the buildbot config should be updated to select the appropriate WASI SDK version when building CPython 3.11 (or bite the bullet and define builders based on the WASI SDK version).

@brettcannon
Copy link
Member Author

brettcannon commented Mar 14, 2024

Simplest solution may be to just skip those tests under WASI that involve extension modules. Can do that by updating requires_load_dynamic():

def requires_load_dynamic(meth):
"""Decorator to skip a test if not running under CPython or lacking
imp.load_dynamic()."""
meth = support.cpython_only(meth)
return unittest.skipIf(getattr(imp, 'load_dynamic', None) is None,
'imp.load_dynamic() required')(meth)

@bedevere-app
Copy link

bedevere-app bot commented Mar 17, 2024

GH-116933 is a backport of this pull request to the 3.11 branch.

kushaldas added a commit that referenced this issue Mar 18, 2024
…GH-116831) (#116933)

gh-116831: Fixes tests for c extension in WASI

We can skip the C extension based tests under WASI.
@brettcannon
Copy link
Member Author

And now everything passes under WASI SDK 21 on Python 3.11! https://buildbot.python.org/all/#/builders/1370/builds/155

Thanks, @kushaldas !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes OS-wasi tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant