elfmz / far2l

Linux port of FAR v2
GNU General Public License v2.0
1.76k stars 171 forks source link

far2l does not build with python on ubuntu 24.04 lts #2373

Open faerot opened 1 week ago

faerot commented 1 week ago

I have tried last release 2.6.3, it did not build due to some xerces error I have tried master, and it fails to build

Building wheels for collected packages: cffi, pycparser
  Building wheel for cffi (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for cffi (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [59 lines of output]
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'libffi', required by 'virtual:world', not found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'libffi', required by 'virtual:world', not found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'libffi', required by 'virtual:world', not found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'libffi', required by 'virtual:world', not found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'libffi', required by 'virtual:world', not found
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-312
      creating build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/cparser.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/_shimmed_dist_utils.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/__init__.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/recompiler.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/pkgconfig.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/error.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/_imp_emulation.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/verifier.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/model.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/cffi_opcode.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/ffiplatform.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/api.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/vengine_cpy.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/commontypes.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/setuptools_ext.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/lock.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/backend_ctypes.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/vengine_gen.py -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/_cffi_include.h -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/parse_c_type.h -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/_embedding.h -> build/lib.linux-x86_64-cpython-312/cffi
      copying src/cffi/_cffi_errors.h -> build/lib.linux-x86_64-cpython-312/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-x86_64-cpython-312
      creating build/temp.linux-x86_64-cpython-312/src
      creating build/temp.linux-x86_64-cpython-312/src/c
      x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/home/yaroslav/app/far2l/_build/python/python/include -I/usr/includ
e/python3.12 -c src/c/_cffi_backend.c -o build/temp.linux-x86_64-cpython-312/src/c/_cffi_backend.o
      src/c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
         15 | #include <ffi.h>
            |          ^~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cffi
  Building wheel for pycparser (pyproject.toml) ... done
  Created wheel for pycparser: filename=pycparser-2.22-py3-none-any.whl size=117551 sha256=d01d869e00d8365b7bb830598d8c24ce87aeff684b3f5129d750ea7eb5f67821
  Stored in directory: /home/yaroslav/.cache/pip/wheels/36/53/17/c0ae2e096d359a9a8faf47fd7ded8f4c878af41a3c66cb5199
Successfully built pycparser
Failed to build cffi
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)
gmake[2]: *** [python/CMakeFiles/python.dir/build.make:80: python/incpy/far2lcffi.py] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1334: python/CMakeFiles/python.dir/all] ERror 2
gmake: *** [Makefile:156: all] Error 2
faerot commented 1 week ago

I have configured cmake with: cmake -DUSEWX=no -DPYTHON=yes -DCMAKE_BUILD_TYPE=Release ..

faerot commented 1 week ago

Also question: why far2l that comes via apt install is not built with python? python is essential part of debian based distros, so why not building it with python support there?

unxed commented 1 week ago

Also question: why far2l that comes via apt install is not built with python? python is essential part of debian based distros, so why not building it with python support there?

@alexmyczko

akruphi commented 1 week ago

@faerot you can try build with system python via -DVIRTUAL_PYTHON=python3 (brief details see in https://github.com/akruphi/far2l/wiki#plugins_py )

About python problems lets ask far2l python creator @m32

faerot commented 1 week ago

@faerot you can try build with system python via -DVIRTUAL_PYTHON=python3 (brief details see in https://github.com/akruphi/far2l/wiki#plugins_py )

Does not work either. With -DVIRTUAL_PYTHON=python3 it has this kind of errors:

[ 65%] Generating incpy/far2lcffi.py
XBUILD=/home/yaroslav/app/far2l /home/yaroslav/app/far2l/_build/python python3 /usr/
bin/cc  -Wall -std=c99 -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -ffunction-
sections -fdata-sections -Wl,--gc-sections -DWINPORT_REGISTRY
[ 66%] Built target drawline
/home/yaroslav/app/far2l/python/src/prebuild.sh: рядок 40: /usr/bin/cc  -Wall -std=c
99 -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -ffunction-sections -fdata-sect
ions -Wl,--gc-sections -DWINPORT_REGISTRY: No such file or directory
[ 66%] Built target compare
[ 66%] Built target align
gmake[2]: *** [python/CMakeFiles/python.dir/build.make:80: python/incpy/far2lcffi.py
] Error 127
[ 66%] Built target autowrap
gmake[1]: *** [CMakeFiles/Makefile2:1334: python/CMakeFiles/python.dir/all] Error 
2
[ 67%] Built target filecase
[ 67%] Built target editcase
[ 68%] Built target editorcomp
[ 69%] Built target incsrch   
[ 70%] Built target colorer   
[ 70%] Built target SimpleIndent                                                    
[ 71%] Built target tmppanel    
[ 73%] Built target calc        
[ 74%] Built target inside      
[ 81%] Built target NetRocks    
[100%] Built target multiarc    
gmake: *** [Makefile:156: all] Error 2   

I have installed python3-cffi, python3-pcpp, python3-debugpy, but not adbutils, since there is no official package in the repository and I don't plan to use android plugins. Could it be because of adbutils?

m32 commented 1 week ago

python3 -m venv env /devel/bin/python3 will create a virtual python environment, during the installation "virtual pip3" is also set up. After such python installation you can manually install missing packages, then these are the correct parameters for cmake:

-DVIRTUAL_PYTHON=/devel/bin/python3/bin/python
-DVIRTUAL_PYTHON_VERSION=3

This cannot be the system python interpreter.

This speeds up building far2l and allows you to use your own virtual python instance as well as using a package like adbutils. If you use the --with-python parameter, the virtual python will be created automatically during program building

faerot commented 1 week ago

I don't want to mess with various venvs because frankly I am not really sure what exactly the problem is. I am just trying to build far2l with python as stated by the documentation on front page here. Is the described way to build far2l with python is obsolete or makefiles are broken? Need to either fix the makefile or update the documentation.

m32 commented 1 week ago

Before building with python enabled install requred package: sudo apt install python3-venv

and build as described in README.md, eg: cmake .. -DCMAKE_BUILD_TYPE=Debug -DPYTHON=YES

will create virtual env in install/Plugins/python/plug/python with required python packages

faerot commented 1 week ago

Unfortunately installing python3-venv did not help, I have deleted _build dir contents before trying again just in case, but error is pretty much the same.

  error: subprocess-exited-with-error                                              ░
                                                                                   ░
  × Building wheel for cffi (pyproject.toml) did not run successfully.             ░
  │ exit code: 1                                                                   ░
P ╰─> [59 lines of output]                                                         ░
      Package libffi was not found in the pkg-config search path.                  ░
      Perhaps you should add the directory containing `libffi.pc'                  ░
      to the PKG_CONFIG_PATH environment variable                                  ░
      Package 'libffi', required by 'virtual:world', not found                     ░
      Package libffi was not found in the pkg-config search path.                  ░
      Perhaps you should add the directory containing `libffi.pc'                  ░
      to the PKG_CONFIG_PATH environment variable                                  ░
      Package 'libffi', required by 'virtual:world', not found                     ░
      Package libffi was not found in the pkg-config search path.                  ░
      Perhaps you should add the directory containing `libffi.pc'                  ░
      to the PKG_CONFIG_PATH environment variable                                  ░
      Package 'libffi', required by 'virtual:world', not found                     ░
      Package libffi was not found in the pkg-config search path.                  ░
      Perhaps you should add the directory containing `libffi.pc'                  ░
      to the PKG_CONFIG_PATH environment variable                                  ░
      Package 'libffi', required by 'virtual:world', not found                     ░
      Package libffi was not found in the pkg-config search path.                  ░
      Perhaps you should add the directory containing `libffi.pc'                  ░
      to the PKG_CONFIG_PATH environment variable                                  ░
      Package 'libffi', required by 'virtual:world', not found                     ░
      running bdist_wheel                                                          ░
      running build                                                                ░
      running build_py                                                             ░
      creating build                                                               ░
      creating build/lib.linux-x86_64-cpython-312                                  ░
      creating build/lib.linux-x86_64-cpython-312/cffi                             ░
      copying src/cffi/cparser.py -> build/lib.linux-x86_64-cpython-312/cffi       ░
      copying src/cffi/_shimmed_dist_utils.py -> build/lib.linux-x86_64-cpython-312░
cffi                                                                               ░
      copying src/cffi/__init__.py -> build/lib.linux-x86_64-cpython-312/cffi      ░
      copying src/cffi/recompiler.py -> build/lib.linux-x86_64-cpython-312/cffi    ░
      copying src/cffi/pkgconfig.py -> build/lib.linux-x86_64-cpython-312/cffi     ░
      copying src/cffi/error.py -> build/lib.linux-x86_64-cpython-312/cffi         ░
      copying src/cffi/_imp_emulation.py -> build/lib.linux-x86_64-cpython-312/cffi░
      copying src/cffi/verifier.py -> build/lib.linux-x86_64-cpython-312/cffi      ░
      copying src/cffi/model.py -> build/lib.linux-x86_64-cpython-312/cffi         ░
      copying src/cffi/cffi_opcode.py -> build/lib.linux-x86_64-cpython-312/cffi   ░
      copying src/cffi/ffiplatform.py -> build/lib.linux-x86_64-cpython-312/cffi   ░
      copying src/cffi/api.py -> build/lib.linux-x86_64-cpython-312/cffi           ░
      copying src/cffi/vengine_cpy.py -> build/lib.linux-x86_64-cpython-312/cffi   ░
      copying src/cffi/commontypes.py -> build/lib.linux-x86_64-cpython-312/cffi   ░
      copying src/cffi/setuptools_ext.py -> build/lib.linux-x86_64-cpython-312/cffi░
      copying src/cffi/lock.py -> build/lib.linux-x86_64-cpython-312/cffi          ░
      copying src/cffi/backend_ctypes.py -> build/lib.linux-x86_64-cpython-312/cffi░
      copying src/cffi/vengine_gen.py -> build/lib.linux-x86_64-cpython-312/cffi   ░
      copying src/cffi/_cffi_include.h -> build/lib.linux-x86_64-cpython-312/cffi  ░
      copying src/cffi/parse_c_type.h -> build/lib.linux-x86_64-cpython-312/cffi   ░
      copying src/cffi/_embedding.h -> build/lib.linux-x86_64-cpython-312/cffi     ░
      copying src/cffi/_cffi_errors.h -> build/lib.linux-x86_64-cpython-312/cffi   ░
      running build_ext                                                            ░
      building '_cffi_backend' extension                                           ░
      creating build/temp.linux-x86_64-cpython-312                                 ░
      creating build/temp.linux-x86_64-cpython-312/src                             ░
      creating build/temp.linux-x86_64-cpython-312/src/c                           ░
      x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wal░
 -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I░
usr/include/libffi -I/home/yaroslav/app/far2l/_build/python/python/include -I/usr/i░
clude/python3.12 -c src/c/_cffi_backend.c -o build/temp.linux-x86_64-cpython-312/sr░
/c/_cffi_backend.o                                                                 ░
      src/c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
         15 | #include <ffi.h>                                                     ░
            |          ^~~~~~~                                                     ░
      compilation terminated.                                                      ░
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 
m32 commented 1 week ago

I forgot about cffi requirements: sudo apt install libffi-dev

shmuz commented 1 week ago

@m32 I have working Python plugin on one of my virtual machines.

However I still can not install it on the other (Linux Mint 22) machine.

The following commands were executed successfully: sudo apt install python3-venv sudo apt install libffi-dev

But when I run cmake .. -DPYTHON=yes I get the following: image

shmuz commented 1 week ago

When I tried again to install libffi-dev the response was: libffi-dev is already the newest version (3.4.6-1build1)

Could the libffi-dev version be a problem?

m32 commented 1 week ago

@shmuz

This is something related to cmake - my is 3.25.1 on debian 12 or python3-dev

Python3_INCLUDE_DIRS is available after: find_package(Python3 COMPONENTS Interpreter Development) if(Python3_FOUND AND Python3_Development_FOUND) ... else() echo Missing Python ....

shmuz commented 1 week ago

@m32 I got some additional help on a telegram channel and finally the plugin was installed successfully.

The list of required libraries to be installed is:

It would be helpful to place this list in some easily visible place.

m32 commented 1 week ago

these are downloaded while building plugin: python3-cffi python3-pcpp

the cffi package must be compiled from source, otherwise there may be problems with running the plugin

shmuz commented 1 week ago

Thank you. Indeed I removed these 2 packages and the plugin still builds OK.

But there is an error (that does not prevent the plugin from being built):

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed.
This behaviour is the source of the following dependency conflicts.
yt-dlp 2024.4.9 requires websockets>=12.0, but you have websockets 10.4 which is incompatible.
atolismesh commented 1 week ago

@m32 Grzegorz, please note that some of your .py plugins unconditionally do import debugpy Some - conditionally.

if 0:
    import debugpy

But it (python3-debugpy package) isn't installed by default . And not mentioned in requirements. Thanks

m32 commented 1 week ago

@atolismesh

debugpy, adbutils, cffi, pcpp are instaled while building python plugin - i'm sure CMakeLists.txt:493 line and prebuild.sh lines 19 and 20

python plugin requires only python development package nothing more, rest is installed from pypi

m32 commented 1 week ago

@shmuz yt-dlp = youtube downloader ?

is not used by python plugin, can you provide more context ? log, ...

shmuz commented 1 week ago

@m32 , here is the full log of building the Python plugin:

[ 99%] Built target NetRocks
[ 99%] Generating incpy/far2lcffi.py
XBUILD=/home/shmuel/far2m /home/shmuel/far2m/_build/python 0 /usr/bin/python3 /usr/bin/cc  -Wall -std=c99 -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS
=64 -ffunction-sections -fdata-sections -Wl,--gc-sections -DWINPORT_REGISTRY
Preparing python virtual env at /home/shmuel/far2m/_build/python/python using /usr/bin/python3
Requirement already satisfied: pip in ./python/lib/python3.12/site-packages (24.0)
Collecting pip
  Using cached pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Using cached pip-24.2-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 24.0
    Uninstalling pip-24.0:
      Successfully uninstalled pip-24.0
Successfully installed pip-24.2
Collecting debugpy
  Using cached debugpy-1.8.5-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.1 kB)
Collecting pcpp
  Using cached pcpp-1.30-py2.py3-none-any.whl.metadata (23 kB)
Collecting adbutils
  Using cached adbutils-2.8.0-py3-none-manylinux1_x86_64.whl.metadata (886 bytes)
Collecting requests (from adbutils)
  Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting deprecation<3.0,>=2.0.6 (from adbutils)
  Using cached deprecation-2.1.0-py2.py3-none-any.whl.metadata (4.6 kB)
Collecting retry>=0.9 (from adbutils)
  Using cached retry-0.9.2-py2.py3-none-any.whl.metadata (5.8 kB)
Collecting apkutils2<2.0,>=1.0.0 (from adbutils)
  Using cached apkutils2-1.0.0-py3-none-any.whl
Collecting Pillow (from adbutils)
  Using cached pillow-10.4.0-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (9.2 kB)
Collecting pyelftools (from apkutils2<2.0,>=1.0.0->adbutils)
  Using cached pyelftools-0.31-py3-none-any.whl.metadata (381 bytes)
Collecting cigam (from apkutils2<2.0,>=1.0.0->adbutils)
  Using cached cigam-0.0.3-py3-none-any.whl.metadata (419 bytes)
Collecting xmltodict (from apkutils2<2.0,>=1.0.0->adbutils)
  Using cached xmltodict-0.13.0-py2.py3-none-any.whl.metadata (7.7 kB)
Collecting packaging (from deprecation<3.0,>=2.0.6->adbutils)
  Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
Collecting decorator>=3.4.2 (from retry>=0.9->adbutils)
  Using cached decorator-5.1.1-py3-none-any.whl.metadata (4.0 kB)
Collecting py<2.0.0,>=1.4.26 (from retry>=0.9->adbutils)
  Using cached py-1.11.0-py2.py3-none-any.whl.metadata (2.8 kB)
Collecting charset-normalizer<4,>=2 (from requests->adbutils)
  Using cached charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests->adbutils)
  Using cached idna-3.8-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests->adbutils)
  Using cached urllib3-2.2.2-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests->adbutils)
  Using cached certifi-2024.8.30-py3-none-any.whl.metadata (2.2 kB)
Using cached debugpy-1.8.5-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB)
Using cached pcpp-1.30-py2.py3-none-any.whl (91 kB)
Using cached adbutils-2.8.0-py3-none-manylinux1_x86_64.whl (3.3 MB)
Using cached deprecation-2.1.0-py2.py3-none-any.whl (11 kB)
Using cached retry-0.9.2-py2.py3-none-any.whl (8.0 kB)
Using cached pillow-10.4.0-cp312-cp312-manylinux_2_28_x86_64.whl (4.5 MB)
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Using cached certifi-2024.8.30-py3-none-any.whl (167 kB)
Using cached charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Using cached idna-3.8-py3-none-any.whl (66 kB)
Using cached py-1.11.0-py2.py3-none-any.whl (98 kB)
Using cached urllib3-2.2.2-py3-none-any.whl (121 kB)
Using cached cigam-0.0.3-py3-none-any.whl (3.8 kB)
Using cached packaging-24.1-py3-none-any.whl (53 kB)
Using cached pyelftools-0.31-py3-none-any.whl (180 kB)
Using cached xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB)
Installing collected packages: pyelftools, pcpp, cigam, xmltodict, urllib3, py, Pillow, packaging, idna, decorator, debugpy, charset-normalizer, certifi
, retry, requests, deprecation, apkutils2, adbutils
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following
 dependency conflicts.
yt-dlp 2024.4.9 requires websockets>=12.0, but you have websockets 10.4 which is incompatible.
Successfully installed Pillow-10.4.0 adbutils-2.8.0 apkutils2-1.0.0 certifi-2024.8.30 charset-normalizer-3.3.2 cigam-0.0.3 debugpy-1.8.5 decorator-5.1.1
 deprecation-2.1.0 idna-3.8 packaging-24.1 pcpp-1.30 py-1.11.0 pyelftools-0.31 requests-2.32.3 retry-0.9.2 urllib3-2.2.2 xmltodict-0.13.0
Collecting cffi
  Using cached cffi-1.17.1-cp312-cp312-linux_x86_64.whl
Collecting pycparser (from cffi)
  Using cached pycparser-2.22-py3-none-any.whl
Installing collected packages: pycparser, cffi
  Attempting uninstall: pycparser
    Found existing installation: pycparser 2.21
    Not uninstalling pycparser at /usr/lib/python3/dist-packages, outside environment /home/shmuel/far2m/_build/python/python
    Can't uninstall 'pycparser'. No files were found to uninstall.
Successfully installed cffi-1.17.1 pycparser-2.22
/home/shmuel/far2m/python/src/pythongen.py:49: SyntaxWarning: invalid escape sequence '\|'
  fp.write('''\
[ 99%] Building CXX object python/CMakeFiles/python.dir/src/GlobalInfo.cpp.o
[ 99%] Building CXX object python/CMakeFiles/python.dir/src/python.cpp.o
[100%] Linking CXX shared module ../install/Plugins/python/plug/python.far-plug-wide
[100%] Built target python
m32 commented 1 week ago

@shmuz

yours build is ok [100%] Linking CXX shared module ../install/Plugins/python/plug/python.far-plug-wide [100%] Built target python

your compilation is correct but surprising

start XBUILD=... prebuild.sh:19 Successfully installed pip-24.2 prebuild.sh:20 Installing collected packages: ...

it's normal up to this point

prebuild.sh:21 tries to force reinstallation of packages from sources and somehow a different (system?) python interpreter starts up for you and starts messing around with something other than itself (Not uninstalling pycparser at /usr/lib/python3/dist-packages) Successfully installed cffi-1.17.1 pycparser-2.22 - and it's normal again

on debian 12/python3.11 looks like: [ 99%] Generating incpy/far2lcffi.py XBUILD=/devel/00mirror-cvs/00-m32/far2l /devel/00mirror-cvs/00-m32/far2l/build-std/python 0 /usr/bin/python3 /usr/bin/cc -Wall -std=c99 -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -ffunction-sections -fdata-sections -Wl,--gc-sections -DWINPORT_REGISTRY Preparing python virtual env at /devel/00mirror-cvs/00-m32/far2l/build-std/python/python using /usr/bin/python3 Requirement already satisfied: pip in ./python/lib/python3.11/site-packages (23.0.1) Collecting pip Using cached pip-24.2-py3-none-any.whl (1.8 MB) Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 23.0.1 Uninstalling pip-23.0.1: Successfully uninstalled pip-23.0.1 Successfully installed pip-24.2 Collecting debugpy Using cached debugpy-1.8.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.1 kB) Collecting pcpp Using cached pcpp-1.30-py2.py3-none-any.whl.metadata (23 kB) Collecting adbutils Using cached adbutils-2.8.0-py3-none-manylinux1_x86_64.whl.metadata (886 bytes) Collecting requests (from adbutils) Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB) Collecting deprecation<3.0,>=2.0.6 (from adbutils) Using cached deprecation-2.1.0-py2.py3-none-any.whl.metadata (4.6 kB) Collecting retry>=0.9 (from adbutils) Using cached retry-0.9.2-py2.py3-none-any.whl.metadata (5.8 kB) Collecting apkutils2<2.0,>=1.0.0 (from adbutils) Using cached apkutils2-1.0.0-py3-none-any.whl Collecting Pillow (from adbutils) Using cached pillow-10.4.0-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (9.2 kB) Collecting cigam (from apkutils2<2.0,>=1.0.0->adbutils) Using cached cigam-0.0.3-py3-none-any.whl.metadata (419 bytes) Collecting pyelftools (from apkutils2<2.0,>=1.0.0->adbutils) Using cached pyelftools-0.31-py3-none-any.whl.metadata (381 bytes) Collecting xmltodict (from apkutils2<2.0,>=1.0.0->adbutils) Using cached xmltodict-0.13.0-py2.py3-none-any.whl.metadata (7.7 kB) Collecting packaging (from deprecation<3.0,>=2.0.6->adbutils) Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB) Collecting decorator>=3.4.2 (from retry>=0.9->adbutils) Using cached decorator-5.1.1-py3-none-any.whl.metadata (4.0 kB) Collecting py<2.0.0,>=1.4.26 (from retry>=0.9->adbutils) Using cached py-1.11.0-py2.py3-none-any.whl.metadata (2.8 kB) Collecting charset-normalizer<4,>=2 (from requests->adbutils) Using cached charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB) Collecting idna<4,>=2.5 (from requests->adbutils) Using cached idna-3.8-py3-none-any.whl.metadata (9.9 kB) Collecting urllib3<3,>=1.21.1 (from requests->adbutils) Using cached urllib3-2.2.2-py3-none-any.whl.metadata (6.4 kB) Collecting certifi>=2017.4.17 (from requests->adbutils) Using cached certifi-2024.8.30-py3-none-any.whl.metadata (2.2 kB) Using cached debugpy-1.8.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB) Using cached pcpp-1.30-py2.py3-none-any.whl (91 kB) Using cached adbutils-2.8.0-py3-none-manylinux1_x86_64.whl (3.3 MB) Using cached deprecation-2.1.0-py2.py3-none-any.whl (11 kB) Using cached retry-0.9.2-py2.py3-none-any.whl (8.0 kB) Using cached pillow-10.4.0-cp311-cp311-manylinux_2_28_x86_64.whl (4.5 MB) Using cached requests-2.32.3-py3-none-any.whl (64 kB) Using cached certifi-2024.8.30-py3-none-any.whl (167 kB) Using cached charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (140 kB) Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB) Using cached idna-3.8-py3-none-any.whl (66 kB) Using cached py-1.11.0-py2.py3-none-any.whl (98 kB) Using cached urllib3-2.2.2-py3-none-any.whl (121 kB) Using cached cigam-0.0.3-py3-none-any.whl (3.8 kB) Using cached packaging-24.1-py3-none-any.whl (53 kB) Using cached pyelftools-0.31-py3-none-any.whl (180 kB) Using cached xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB) Installing collected packages: pyelftools, pcpp, cigam, xmltodict, urllib3, py, Pillow, packaging, idna, decorator, debugpy, charset-normalizer, certifi, retry, requests, deprecation, apkutils2, adbutils Successfully installed Pillow-10.4.0 adbutils-2.8.0 apkutils2-1.0.0 certifi-2024.8.30 charset-normalizer-3.3.2 cigam-0.0.3 debugpy-1.8.5 decorator-5.1.1 deprecation-2.1.0 idna-3.8 packaging-24.1 pcpp-1.30 py-1.11.0 pyelftools-0.31 requests-2.32.3 retry-0.9.2 urllib3-2.2.2 xmltodict-0.13.0 Collecting cffi Using cached cffi-1.17.1-cp311-cp311-linux_x86_64.whl Collecting pycparser (from cffi) Using cached pycparser-2.22-py3-none-any.whl Installing collected packages: pycparser, cffi Successfully installed cffi-1.17.1 pycparser-2.22 [ 99%] Building CXX object python/CMakeFiles/python.dir/src/python.cpp.o [ 99%] Linking CXX shared module ../install/Plugins/python/plug/python.far-plug-wide [ 99%] Built target python

m32 commented 1 week ago

@shmuz I installed a fresh Linux Mint 22 and rebuilt far2l with spdlog problem in colorer and the process looks like in debian.

yt-dl ? - I don't know what it's about at all

my script:

#!/bin/bash
cmd_installdeps() {
sudo apt-get install \
libwxgtk3.2-dev libx11-dev libxi-dev libpcre3-dev libxml2-dev \
libuchardet-dev libssh-dev libssl-dev libsmbclient-dev libnfs-dev \
libneon27-dev libarchive-dev cmake pkg-config g++ git \
libpython3-dev python3-venv libffi-dev libspdlog-dev
}

cmd_gitclone() {
git clone https://github.com/elfmz/far2l
}

cmd_cmake() {
pushd far2l
if [ ! -d build-std ]; then
    mkdir build-std
fi
BT=-DCMAKE_BUILD_TYPE=Release
BT=-DCMAKE_BUILD_TYPE=Debug

PYTHON=-DPYTHON=YES
#PYTHON=-DPYTHON=NO

#VIRTUAL_PYTHON=-DVIRTUAL_PYTHON=/devel/bin/python3/bin/python
#VIRTUAL_PYTHON_VERSION=-DVIRTUAL_PYTHON_VERSION=3

pushd build-std
cmake .. -DEACP=NO -DEDITORCOMP=NO -DUSESPDLOG=YES \
$PYTHON $VIRTUAL_PYTHON $VIRTUAL_PYTHON_VERSION \
$BT
popd
popd
}

cmd_make() {
pushd far2l
if [ ! -d build-std ]; then
    mkdir build-std
fi
cd build-std
make
popd
}

cmd_installdeps
cmd_gitclone
# comment lines 270-274 far2l/colorer/src/Colorer-library/src/CMakeLists.txt
cmd_cmake
cmd_make
shmuz commented 1 week ago

@m32 , I don't have a clue about what that yt-dl is. And it is possible that something is wrong with my system (though I don't remember doing something unusual with it), It is not my main Linux system, it's one of several Linuxes that I use for testing.

I don't consider it as a major problem and even don't have plans to investigate it. So, thanks for your help, it is appreciated.

faerot commented 1 week ago

I forgot about cffi requirements: sudo apt install libffi-dev

Indeed, that helped to build it. README needs to be updated to include libffi-dev requirement not to waste your time every time someone will try to build far2l with python :)