acxz / pkgbuilds

PKGBUILDs for Arch Linux
25 stars 43 forks source link

[python-cfclient] error: [Errno 2] No such file or directory: 'build/exe.linux-x86_64-3.9/cfclient' #140

Closed goekce closed 1 year ago

goekce commented 3 years ago

While building python-cfclient I get:

copying src/cfclient/ui/toolboxes/crtpSharkToolbox.ui -> build/lib/cfclient/ui/toolboxes
copying src/cfclient/ui/widgets/plotter.ui -> build/lib/cfclient/ui/widgets
running build_exe
creating directory build/exe.linux-x86_64-3.9/lib
copying /usr/lib/libpython3.9.so -> build/exe.linux-x86_64-3.9/lib/libpython3.9.so
error: [Errno 2] No such file or directory: 'build/exe.linux-x86_64-3.9/cfclient'

Could be related to cx_freeze. Indeed the path cfclient does not exist in build/exe.linux-x86_64-3.9.

I also tried manually using cxfreeze:

In src/crazyflie-clients-python-2021.6.1:

$ cxfreeze -c bin/cfclient --target-dir aman
creating directory aman/lib
copying /usr/lib/libpython3.9.so -> aman/lib/libpython3.9.so
Traceback (most recent call last):
  File "/usr/bin/cxfreeze", line 33, in <module>
    sys.exit(load_entry_point('cx-Freeze==6.7', 'console_scripts', 'cxfreeze')())
  File "/usr/lib/python3.9/site-packages/cx_Freeze/cli.py", line 262, in main
    freezer.Freeze()
  File "/usr/lib/python3.9/site-packages/cx_Freeze/freezer.py", line 598, in Freeze
    self._freeze_executable(executable)
  File "/usr/lib/python3.9/site-packages/cx_Freeze/freezer.py", line 222, in _freeze_executable
    mode = os.stat(target_path).st_mode
FileNotFoundError: [Errno 2] No such file or directory: 'aman/cfclient'

Can someone confirm this?

acxz commented 3 years ago

I am actually getting the following error: https://bugs.archlinux.org/task/70560?string=patchelf

After manually installing patchelf, I get the same error as you mention.

goekce commented 3 years ago

Yeah, I also had to install patchelf. Sorry, I forgot to mention that.

Thank you for confirming!

acxz commented 3 years ago

spent some time lookin into this today. Patched the issue with d00f488. Essentially the following if statement was being triggered. (https://github.com/marcelotduarte/cx_Freeze/blob/9b11b50027dacb2ed88724a5a25aef7f3a5ec869/cx_Freeze/freezer.py#L356) P sure my patch is not the best way to get the package the compile, but we'll keep it in there now until a better solution comes up.

Make sure to update cflib as well!

acxz commented 1 year ago

With b6929e4 this patch is not needed, nor the error occurs.