runtimeverification / runtimeverification/evm-semantics

`import inotify.adapters` does not work on M1 Mac

Open
#2,145 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
KCL
Stars
591
Forks
156
Avg merge
2h 19m
Merged PRs (30d)
1

Description

There is a problem with the newly introduced inotify dependency. In particular, when I try to run the integrataion tests of KEVM locally on my M1 Mac, I get the following error:

petarmax@PetarMax kevm-pyk % make test-integration PYTEST_ARGS='-k test_prove.py --update-expected-output'
poetry install
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: kevm-pyk (1.0.329)
poetry run pytest src/tests/integration --verbose --durations=0 --dist=worksteal --maxfail=1 --numprocesses=8 -k test_prove.py --update-expected-output
====================================================================================== test session starts ======================================================================================
platform darwin -- Python 3.10.13, pytest-7.4.2, pluggy-1.3.0 -- /Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/bin/python
cachedir: .pytest_cache
rootdir: /Users/petarmax/Projects/RV/kevm/worktree/lemmas/kevm-pyk
plugins: pyk-0.1.478, timeout-2.2.0, cov-4.1.0, mock-3.12.0, xdist-3.3.1
collecting 0 items / 1 error                                                                                                                                                                    
============================================================================================ ERRORS =============================================================================================
_____________________________________________________________________ ERROR collecting src/tests/integration/test_prove.py ______________________________________________________________________
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/_pytest/python.py:531: in collect
    self._inject_setup_module_fixture()
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
    self.obj, ("setUpModule", "setup_module")
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/_pytest/python.py:310: in obj
    self._obj = obj = self._getobj()
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/_pytest/python.py:528: in _getobj
    return self._importtestmodule()
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
src/tests/integration/test_prove.py:10: in <module>
    import inotify.adapters  # type: ignore
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/inotify/adapters.py:11: in <module>
    import inotify.calls
/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/inotify/calls.py:39: in <module>
    inotify_init = _LIB.inotify_init
/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ctypes/__init__.py:387: in __getattr__
    func = self.__getitem__(name)
/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ctypes/__init__.py:392: in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
E   AttributeError: dlsym(0x3a9c6d5d8, inotify_init): symbol not found
==================================================================================== short test summary info ====================================================================================
ERROR src/tests/integration/test_prove.py - AttributeError: dlsym(0x3a9c6d5d8, inotify_init): symbol not found

which can be isolated to

petarmax@dyn3230-161 kevm-pyk % poetry run python                                                                              
^[[APython 3.10.13 (main, Aug 24 2023, 22:36:46) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import inotify.adapters
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/inotify/adapters.py", line 11, in <module>
    import inotify.calls
  File "/Users/petarmax/Library/Caches/pypoetry/virtualenvs/kevm-pyk-kQJ01N3y-py3.10/lib/python3.10/site-packages/inotify/calls.py", line 39, in <module>
    inotify_init = _LIB.inotify_init
  File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x3a9c6d5d8, inotify_init): symbol not found

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/tests/integration/test_prove.py and reproduce the import failure using the reported poetry and make test-integration commands on an M1 Mac. Done means the inotify import no longer prevents integration-test collection on that platform and the affected tests can run.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, python
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.