pavelliavonau/cmakeconverter

Termux ImportError: cannot import name 'SemLock' from '_multiprocessing'

GuckTubeYT opened this issue · 5 comments

How to fix that?

Logs error

0.000139 processes count = 8
0.000230 warnings level = 2                                0.005242 WARN L1 : Solution architecture is x86 and may be mapped onto Win32 at projects.To avoid problems rename x86 -> Win32.
0.005350 WARN L1 : Solution architecture is x86 and may be mapped onto Win32 at projects.To avoid problems rename x86 -> Win32.
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/synchronize.py", line 28, in <module>               from _multiprocessing import SemLock, sem_unlink
ImportError: cannot import name 'SemLock' from '_multiprocessing' (/data/data/com.termux/files/usr/lib/python3.9/lib-dynload/_multiprocessing.cpython-39.so)

During handling of the above exception, another exception occurred:
                                                           Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/cmake-converter", line 8, in <module>
    sys.exit(main())
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/cmake_converter/main.py", line 144, in main
    converter.convert_solution(project_context, os.path.abspath(args.solution))                                         File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/cmake_converter/visual_studio/solution.py", line 331, in convert_solution                                        results = self.do_conversion(project_context, input_data_for_converter)                                             File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/cmake_converter/data_converter.py", line 297, in do_conversion
    pool = Pool(project_context.jobs)                        File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/context.py", line 119, in Pool                      return Pool(processes, initializer, initargs, maxtasksperchild,                                                     File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/pool.py", line 191, in __init__                     self._setup_queues()
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/pool.py", line 343, in _setup_queues
    self._inqueue = self._ctx.SimpleQueue()                  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/context.py", line 113, in SimpleQueue               return SimpleQueue(ctx=self.get_context())
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/queues.py", line 342, in __init__
    self._rlock = ctx.Lock()                                 File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/context.py", line 67, in Lock                       from .synchronize import Lock
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/synchronize.py", line 30, in <module>
    raise ImportError("This platform lacks a functioning sem_open" +
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.```

Hi. Have you checked exception message before creating issue here??
After quick check I suppose that it's an issue of python implementation of your platform.
In a case when you cannot use multiprocessing - you may try to use 1 single main thread for convertion with jobs option. (-j 1)

Hi. Have you checked exception message before creating issue here??
After quick check I suppose that it's an issue of python implementation of your platform.
In a case when you cannot use multiprocessing - you may try to use 1 single main thread for convertion with jobs option. (-j 1)

So, it Will like this cmake-converter -s file.sln -j 1?

Okay, I close the issue, if I have problem again, I will open the issue again

It's invalid issue for cmakeconverter. Force fix python first