adang1345 / delvewheel

Self-contained Python wheels for Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception: Chained function entry cannot be changed

kuelumbus opened this issue · comments

Hi, I am trying to use delvewheel with cibuildwheel to build windows wheels for https://github.com/kuelumbus/rdkit_platform_wheels/ . Unfortunately, I get an error (https://github.com/kuelumbus/rdkit_platform_wheels/actions/runs/1195363995)

+ delvewheel repair --add-path C:\libs -w C:\Users\RUNNER~1\AppData\Local\Temp\cibuildwheelm5ku8_7m\repaired_wheel C:\Users\RUNNER~1\AppData\Local\Temp\cibuildwheelm5ku8_7m\built_wheel\rdkit_pypi-2021.3.4-cp38-cp38-win_amd64.whl
  Traceback (most recent call last):
    File "c:\cibw\python\python.3.8.10\tools\lib\runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "c:\cibw\python\python.3.8.10\tools\lib\runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "C:\cibw\python\python.3.8.10\tools\Scripts\delvewheel.exe\__main__.py", line 7, in <module>
    File "c:\cibw\python\python.3.8.10\tools\lib\site-packages\delvewheel\__main__.py", line 70, in main
      wr.repair(args.target, no_mangles, args.no_mangle_all, args.lib_sdir)
    File "c:\cibw\python\python.3.8.10\tools\lib\site-packages\delvewheel\wheel_repair.py", line 374, in repair
      discovered, ignored = patch_dll.get_all_needed(extension_module_path, self._add_dlls, self._no_dlls, self._wheel_dirs)[:2]
    File "c:\cibw\python\python.3.8.10\tools\lib\site-packages\delvewheel\patch_dll.py", line 160, in get_all_needed
      with PEContext(lib_path) as pe:
    File "c:\cibw\python\python.3.8.10\tools\lib\site-packages\delvewheel\patch_dll.py", line 17, in __init__
      self._pe = pefile.PE(name)
    File "c:\cibw\python\python.3.8.10\tools\lib\site-packages\pefile.py", line 2742, in __init__
      self.__parse__(name, data, fast_load)
    File "c:\cibw\python\python.3.8.10\tools\lib\site-packages\pefile.py", line 3147, in __parse__
      self.full_load()
    File "c:\cibw\python\python.3.8.10\tools\lib\site-packages\pefile.py", line 3258, in full_load
      self.parse_data_directories()
    File "c:\cibw\python\python.3.8.10\tools\lib\site-packages\pefile.py", line 3553, in parse_data_directories
      value = entry[1](dir_entry.VirtualAddress, dir_entry.Size)
    File "c:\cibw\python\python.3.8.10\tools\lib\site-packages\pefile.py", line 3646, in parse_exceptions_directory
      rf.unwindinfo.set_chained_function_entry(
    File "c:\cibw\python\python.3.8.10\tools\lib\site-packages\pefile.py", line 1945, in set_chained_function_entry
      raise Exception("Chained function entry cannot be changed")
  Exception: Chained function entry cannot be changed
  repairing C:\Users\RUNNER~1\AppData\Local\Temp\cibuildwheelm5ku8_7m\built_wheel\rdkit_pypi-2021.3.4-cp38-cp38-win_amd64.whl
  finding DLL dependencies

Any idea?
Chris

I encounter the same error. Seems the latest version of pefile is throwing an error

Looks like pefile was just updated yesterday. Pinning pefile to 2021.5.24 solved it to me. pip install delvewheel pefile==2021.5.24

It looks like this was reported to pefile at erocarrera/pefile#334 and fixed in version 2021.9.3 of pefile.