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

Test w/ WASI SDK >=22 #120371

Closed
brettcannon opened this issue Jun 11, 2024 · 17 comments
Closed

Test w/ WASI SDK >=22 #120371

brettcannon opened this issue Jun 11, 2024 · 17 comments
Assignees
Labels
build The build process and cross-build OS-wasi type-feature A feature request or enhancement

Comments

@brettcannon
Copy link
Member

brettcannon commented Jun 11, 2024

@brettcannon brettcannon added type-feature A feature request or enhancement OS-wasi build The build process and cross-build labels Jun 11, 2024
@brettcannon brettcannon changed the title Test w/ WASI SDK 22 Test w/ WASI SDK 23 Jul 10, 2024
@brettcannon brettcannon changed the title Test w/ WASI SDK 23 Test w/ WASI SDK >=22 Jul 11, 2024
@brettcannon
Copy link
Member Author

With WASI SDK 22:

======================================================================
ERROR: test_modes (test.test_tarfile.TestExtractionFilters.test_modes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_tarfile.py", line 3894, in test_modes
    os.chmod(tmp_filename, new_mode)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: '/build/test_python_worker_829327æ/@test_42_tmpæ-tardir/tmp.file'

======================================================================
FAIL: test_extract_pathlike_dir (test.test_tarfile.MiscReadTest.test_extract_pathlike_dir)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_tarfile.py", line 784, in test_extract_pathlike_dir
    self.assertEqual(os.path.getmtime(extracted), tarinfo.mtime)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 1721084428.370809 != 1041808783

----------------------------------------------------------------------

I'm going to quickly check that it is WASI SDK 22 causing the failures and not main.

@brettcannon
Copy link
Member Author

The failures don't happen under WASI SDK 21, so it's a new issue. I'm going to try the WASI SDK 23 pre-release to see if it's a bug in wasi-libc.

@brettcannon
Copy link
Member Author

Under WASI SDK 23 pre-release, 17 tests failed:
test_dbm test_dbm_dumb test_ensurepip test_filecmp test_largefile
test_os test_pathlib test_pickle test_pickletools test_posix
test_shelve test_shutil test_support test_tarfile test_tempfile
test_unicode_file test_zipapp

@brettcannon
Copy link
Member Author

brettcannon commented Jul 16, 2024

test_dbm

FAILED (errors=13, skipped=3)
======================================================================
ERROR: test_anydbm_access (__main__.TestCase_dumb.test_anydbm_access)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 131, in test_anydbm_access
    self.init_db()
    ~~~~~~~~~~~~^^
  File "/Lib/test/test_dbm.py", line 57, in init_db
    f = dbm.open(_fname, 'n')
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_anydbm_creation (__main__.TestCase_dumb.test_anydbm_creation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 75, in test_anydbm_creation
    f = dbm.open(_fname, 'c')
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_anydbm_creation_n_file_exists_with_invalid_contents (__main__.TestCase_dumb.test_anydbm_creation_n_file_exists_with_invalid_contents)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 85, in test_anydbm_creation_n_file_exists_with_invalid_contents
    with dbm.open(_fname, 'n') as f:
         ~~~~~~~~^^^^^^^^^^^^^
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_anydbm_keys (__main__.TestCase_dumb.test_anydbm_keys)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 111, in test_anydbm_keys
    self.init_db()
    ~~~~~~~~~~~~^^
  File "/Lib/test/test_dbm.py", line 57, in init_db
    f = dbm.open(_fname, 'n')
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_anydbm_modification (__main__.TestCase_dumb.test_anydbm_modification)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 89, in test_anydbm_modification
    self.init_db()
    ~~~~~~~~~~~~^^
  File "/Lib/test/test_dbm.py", line 57, in init_db
    f = dbm.open(_fname, 'n')
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_anydbm_read (__main__.TestCase_dumb.test_anydbm_read)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 99, in test_anydbm_read
    self.init_db()
    ~~~~~~~~~~~~^^
  File "/Lib/test/test_dbm.py", line 57, in init_db
    f = dbm.open(_fname, 'n')
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_clear (__main__.TestCase_dumb.test_clear)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 166, in test_clear
    with dbm.open(_fname, 'c') as d:
         ~~~~~~~~^^^^^^^^^^^^^
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_empty_value (__main__.TestCase_dumb.test_empty_value)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 120, in test_empty_value
    f = dbm.open(_fname, 'c')
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_keys (__main__.TestCase_dumb.test_keys)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 153, in test_keys
    with dbm.open(_fname, 'c') as d:
         ~~~~~~~~^^^^^^^^^^^^^
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_open_with_bytes (__main__.TestCase_dumb.test_open_with_bytes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 139, in test_open_with_bytes
    dbm.open(os.fsencode(_fname), "c").close()
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_open_with_pathlib_path (__main__.TestCase_dumb.test_open_with_pathlib_path)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 142, in test_open_with_pathlib_path
    dbm.open(os_helper.FakePath(_fname), "c").close()
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_open_with_pathlib_path_bytes (__main__.TestCase_dumb.test_open_with_pathlib_path_bytes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 145, in test_open_with_pathlib_path_bytes
    dbm.open(os_helper.FakePath(os.fsencode(_fname)), "c").close()
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/__init__.py", line 95, in open
    return mod.open(file, flag, mode)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

======================================================================
ERROR: test_whichdb (__main__.WhichDBTestCase.test_whichdb)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/dbm/dumb.py", line 83, in _create
    f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 44] No such file or directory: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Lib/test/test_dbm.py", line 200, in test_whichdb
    with module.open(_fname, 'c'): pass
         ~~~~~~~~~~~^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 319, in open
    return _Database(file, mode, flag=flag)
  File "/Lib/dbm/dumb.py", line 71, in __init__
    self._create(flag)
    ~~~~~~~~~~~~^^^^^^
  File "/Lib/dbm/dumb.py", line 88, in _create
    self._chmod(self._datfile)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Lib/dbm/dumb.py", line 284, in _chmod
    self._os.chmod(file, self._mode)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 52] Function not implemented: b'@test_42_tmp\xc3\xa6/@test_42_tmp\xc3\xa6.dat'

----------------------------------------------------------------------

@brettcannon
Copy link
Member Author

test_dbm_dumb looks similar to test_dbm

@dicej
Copy link

dicej commented Jul 16, 2024

@brettcannon do you have a branch you're running these tests on, and/or instructions for reproducing the failures?

I'll take a look when I get a chance (but note that I'll be out on vacation starting Thursday and all of next week, so I might not get to it until after that).

@dicej
Copy link

dicej commented Jul 16, 2024

Ah, I think I can explain the chmod failures:

In this commit I added stub implementations of chmod and related functions, since that was the only way to address WebAssembly/wasi-sdk#373, which was due to upstream changes in LLVM's libc++. Prior to that commit, wasi-libc didn't have chmod at all, so I'm guessing CPython's autotools config skipped using it. Now that the stub is there, autotools is trying to use it, and it doesn't work because it's a stub.

As a temporary measure, perhaps we could force autotools to not use chmod and friends even though they're present. Longer term, we'll want to turn those stub functions into real implementations insofar as that's possible with WASIp2.

@brettcannon
Copy link
Member Author

@dicej this is all off main and build instructions are at https://devguide.python.org/getting-started/setup-building/#wasi .

What I don't get is why does WASI SDK 23 have so many more failures when there was just the test_tarfile failure under 22 (and I'm running the tests again to make sure dad brain didn't cause me to get the different failures wrong)?

@dicej
Copy link

dicej commented Jul 16, 2024

What I don't get is why does WASI SDK 23 have so many more failures when there was just the test_tarfile failure under 22 (and I'm running the tests again to make sure dad brain didn't cause me to get the different failures wrong)?

Like I said above, my theory is that autoconf couldn't find a chmod implementation in WASI-SDK 21 and earlier and either skipped the tests that used chmod or else built the tests with the chmod calls #ifdefed out. With WASI-SDK 22 and later, though, it is finding chmod and so the tests are trying to use it and failing.

@brettcannon
Copy link
Member Author

Looks like my hunch was right and the amount of failures holds true for WASI SDK 22 as well.

@dicej
Copy link

dicej commented Jul 16, 2024

Oops, I misread your question, sorry. I thought you were asking about 21 and earlier vs. 22 and later.

@brettcannon
Copy link
Member Author

I should be able to edit https://github.com/python/cpython/blob/main/Tools/wasm/config.site-wasm32-wasi to explicitly opt out of chmod.

@brettcannon
Copy link
Member Author

Looks like I have to turn off all the stubs covered by WebAssembly/wasi-libc@cc62fa8 .

@brettcannon
Copy link
Member Author

@dicej is there a list of stubs vs. implemented symbols in wasi-libc? That way I can just process some file to update the denylist of functions which don't work?

@dicej
Copy link

dicej commented Jul 16, 2024

@dicej is there a list of stubs vs. implemented symbols in wasi-libc? That way I can just process some file to update the denylist of functions which don't work?

Sorry, no; not that I know of.

brettcannon added a commit to brettcannon/cpython that referenced this issue Jul 16, 2024
@brettcannon
Copy link
Member Author

@dicej is there a list of stubs vs. implemented symbols in wasi-libc? That way I can just process some file to update the denylist of functions which don't work?

Sorry, no; not that I know of.

I opened WebAssembly/wasi-libc#515 to request such a list.

@brettcannon brettcannon self-assigned this Jul 16, 2024
brettcannon added a commit that referenced this issue Jul 16, 2024
Required disabling stub functions now provided by wasi-libc.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 16, 2024
Required disabling stub functions now provided by wasi-libc.
(cherry picked from commit f589f26)

Co-authored-by: Brett Cannon <brett@python.org>
brettcannon added a commit that referenced this issue Jul 16, 2024
GH-120371: Add WASI SDK 22 support (GH-121870)

Required disabling stub functions now provided by wasi-libc.
(cherry picked from commit f589f26)

Co-authored-by: Brett Cannon <brett@python.org>
@brettcannon
Copy link
Member Author

Everything is now passing under WASI SDK 22!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build OS-wasi type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants