divvun / libdivvun

lib for running gramcheck and other pipelines + cli; modules for CG→spelling, CG→feedback, tagging blanks
https://giellalt.github.io/proof/gramcheck/GrammarCheckerDocumentation.html
GNU General Public License v3.0
9 stars 1 forks source link

macOS MacPorts run-python-bindings fail #51

Closed TinoDidriksen closed 2 years ago

TinoDidriksen commented 2 years ago

Happens on macOS with Python 3.10 and other build helpers from MacPorts.

FAIL: ./run-python-bindings
===========================

running install
/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/opt/local/bin/python3 -E -c pass
TEST FAILED: /private/tmp/build/nightly/libdivvun/libdivvun-0.3.10+g518~fd5c4c6a/test/checker/python-build/ does NOT support .pth files
bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /private/tmp/build/nightly/libdivvun/libdivvun-0.3.10+g518~fd5c4c6a/test/checker/python-build/

and your PYTHONPATH environment variable currently contains:

    '/usr/local/lib/python3.10/site-packages'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:

  https://setuptools.pypa.io/en/latest/deprecated/easy_install.html#custom-installation-locations

Please make the appropriate changes for your system and try again.
running bdist_egg
running egg_info
creating python_divvun_gramcheck.egg-info
writing manifest file 'python_divvun_gramcheck.egg-info/SOURCES.txt'
writing manifest file 'python_divvun_gramcheck.egg-info/SOURCES.txt'
running install_lib
running build_py
running build_ext
creating build/bdist.macosx-10.15-x86_64
creating build/bdist.macosx-10.15-x86_64/egg
byte-compiling build/bdist.macosx-10.15-x86_64/egg/libdivvun.py to libdivvun.cpython-310.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/_libdivvun.py to _libdivvun.cpython-310.pyc
creating build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying python_divvun_gramcheck.egg-info/PKG-INFO -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying python_divvun_gramcheck.egg-info/SOURCES.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying python_divvun_gramcheck.egg-info/dependency_links.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying python_divvun_gramcheck.egg-info/top_level.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
__pycache__._libdivvun.cpython-310: module references __file__
creating dist
removing 'build/bdist.macosx-10.15-x86_64/egg' (and everything under it)
creating /private/tmp/build/nightly/libdivvun/libdivvun-0.3.10+g518~fd5c4c6a/test/checker/python-build/python_divvun_gramcheck-0.3.10-py3.10-macosx-10.15-x86_64.egg
Extracting python_divvun_gramcheck-0.3.10-py3.10-macosx-10.15-x86_64.egg to /private/tmp/build/nightly/libdivvun/libdivvun-0.3.10+g518~fd5c4c6a/test/checker/python-build
byte-compiling /private/tmp/build/nightly/libdivvun/libdivvun-0.3.10+g518~fd5c4c6a/test/checker/python-build/python_divvun_gramcheck-0.3.10-py3.10-macosx-10.15-x86_64.egg/_libdivvun.py to _libdivvun.cpython-310.pyc
byte-compiling /private/tmp/build/nightly/libdivvun/libdivvun-0.3.10+g518~fd5c4c6a/test/checker/python-build/python_divvun_gramcheck-0.3.10-py3.10-macosx-10.15-x86_64.egg/libdivvun.py to libdivvun.cpython-310.pyc

Installed /private/tmp/build/nightly/libdivvun/libdivvun-0.3.10+g518~fd5c4c6a/test/checker/python-build/python_divvun_gramcheck-0.3.10-py3.10-macosx-10.15-x86_64.egg
Processing dependencies for python-divvun-gramcheck==0.3.10
Finished processing dependencies for python-divvun-gramcheck==0.3.10
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool-classic: can't open file: _libdivvun.cpython-310-darwin.so (No such file or directory)
FAIL run-python-bindings (exit status: 1)
unhammer commented 2 years ago

So there's one warning that we're installing to something not in PYTHONPATH. But I think that's the intention here. But then it fails because otool can't find _libdivvun.cpython-310-darwin.so – I guess this is the swig-generated file?

Are there any .so files within /private/tmp/build/nightly/libdivvun/libdivvun-0.3.10+g518~fd5c4c6a/test/checker/python-build/?

TinoDidriksen commented 2 years ago

There is, in the python_divvun_gramcheck-0.3.10-py3.10-macosx-10.15-x86_64.egg subfolder:

$ ls -l /tmp/build/nightly/libdivvun/libdivvun-0.3.10+g518~fd5c4c6a/test/checker/python-build/python_divvun_gramcheck-0.3.10-py3.10-macosx-10.15-x86_64.egg/
total 2348
drwxr-xr-x  8 tino  wheel      256 Jan 19 11:16 EGG-INFO/
drwxr-xr-x  4 tino  wheel      128 Jan 19 11:16 __pycache__/
-rwxr-xr-x  1 tino  wheel  1148952 Jan 19 11:16 _libdivvun.cpython-3.10.so*
-rwxr-xr-x  1 tino  wheel  1148952 Jan 19 11:16 _libdivvun.cpython-310-darwin.so*
-rw-r--r--  1 tino  wheel      426 Jan 19 11:16 _libdivvun.py
-rw-r--r--  1 tino  wheel    96980 Jan 19 11:16 libdivvun.py
TinoDidriksen commented 2 years ago

Until this is figured out, I've disabled building Python bindings on Nightly macOS.