Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#65244 closed defect (fixed)

lensfun @0.3.3_0: python module not installed

Reported by: parafin Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc:
Port: lensfun

Description

"port contents lensfun" shows the following lines:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun-0.3.3-py3.9.egg-info
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun/__init__.py
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun/__pycache__/__init__.cpython-39.pyc

instead of

/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun-0.3.3-py3.9.egg-info
/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun/__init__.py
/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun/__pycache__/__init__.cpython-39.pyc

when attached patch is applied (modifying -DSETUP_PY_INSTALL_PREFIX flag due to https://github.com/lensfun/lensfun/commit/9ec857bb403accc262a9b5a9c2921b5c064fc9c8)

Without python module lensfun-update-data tool doesn't work.

Attachments (2)

Portfile.patch (540 bytes) - added by parafin 2 years ago.
patch.diff (538 bytes) - added by parafin 2 years ago.
source code patch

Download all attachments as: .zip

Change History (15)

Changed 2 years ago by parafin

Attachment: Portfile.patch added

comment:1 Changed 2 years ago by mascguy (Christopher Nielsen)

It looks like this patch has already been applied for v0.3.3, as you can see here:

https://github.com/lensfun/lensfun/blob/v0.3.3/apps/CMakeLists.txt

That said, the change doesn't appear to fully correct the problem, based on what I'm seeing:

/opt/local/var/macports/build/_opt_macports_sources_ports_enabled_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun-0.3.3-py3.9.egg

comment:2 Changed 2 years ago by parafin

You misunderstand, because of that change Portfile has to be adapted as in the patch I attached. Please look at the patch.

comment:3 in reply to:  2 Changed 2 years ago by mascguy (Christopher Nielsen)

Replying to parafin:

You misunderstand, because of that change Portfile has to be adapted as in the patch I attached. Please look at the patch.

Yes indeed, thanks for the clarification.

Your patch improves the situation a little bit, but the only file installed is lensfun-0.3.3-py3.9.egg:

/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun-0.3.3-py3.9.egg

Does your patch work locally?

comment:4 Changed 2 years ago by parafin

Yes, it works for me locally.

comment:6 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In a74e6b7ac1fa0dab0c0f672c56816440c328b205/macports-ports (master):

lensfun: Fix python module installation; use 3.10

Closes: #65244

comment:7 Changed 2 years ago by parafin

Resolution: fixed
Status: closedreopened

With that committed fix I now can reproduce the problem you've been having when only .egg file is being installed. The only difference is python version in the Portfile. This is the relevant part (at the end) of build log with python 3.10 (only .egg installed):

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:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
Checking .pth file support in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/
/opt/local/bin/python3.10 -E -c pass
TEST FAILED: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ 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:

    /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/

and your PYTHONPATH environment variable currently contains:

    ''

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 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info
writing /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info/PKG-INFO
writing dependency_links to /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info/dependency_links.txt
writing top-level names to /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info/top_level.txt
writing manifest file '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info/SOURCES.txt'
reading manifest file '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info/SOURCES.txt'
writing manifest file '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.14-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/lensfun
copying /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun/__init__.py -> build/lib/lensfun
creating build/bdist.macosx-10.14-x86_64
creating build/bdist.macosx-10.14-x86_64/egg
creating build/bdist.macosx-10.14-x86_64/egg/lensfun
copying build/lib/lensfun/__init__.py -> build/bdist.macosx-10.14-x86_64/egg/lensfun
byte-compiling build/bdist.macosx-10.14-x86_64/egg/lensfun/__init__.py to __init__.cpython-310.pyc
creating build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
copying /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info/PKG-INFO -> build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
copying /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info/SOURCES.txt -> build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
copying /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info/dependency_links.txt -> build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
copying /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build/apps/lensfun.egg-info/top_level.txt -> build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/lensfun-0.3.3-py3.10.egg' and adding 'build/bdist.macosx-10.14-x86_64/egg' to it
removing 'build/bdist.macosx-10.14-x86_64/egg' (and everything under it)
Processing lensfun-0.3.3-py3.10.egg
Copying lensfun-0.3.3-py3.10.egg to /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages

Installed /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lensfun-0.3.3-py3.10.egg
Processing dependencies for lensfun==0.3.3
Finished processing dependencies for lensfun==0.3.3
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_lensfun/lensfun/work/build'

And with python 3.9 (working correctly):

running install
running build
running build_py
creating build
creating build/lib
creating build/lib/lensfun
copying /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/build/apps/lensfun/__init__.py -> build/lib/lensfun
running install_lib
creating /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework
creating /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions
creating /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9
creating /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib
creating /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9
creating /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
creating /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun
copying build/lib/lensfun/__init__.py -> /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun
byte-compiling /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun/__init__.py to __init__.cpython-39.pyc
running install_egg_info
Writing /opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lensfun-0.3.3-py3.9.egg-info
make: Leaving directory `/opt/local/var/macports/build/_Users_parafin_ports_graphics_lensfun/lensfun/work/build'

Did you have your problem with python_branch set to 3.9 or 3.10 in the Portfile? On what macOS version are you?

comment:8 in reply to:  7 Changed 2 years ago by mascguy (Christopher Nielsen)

Replying to parafin:

With that committed fix I now can reproduce the problem you've been having when only .egg file is being installed. The only difference is python version in the Portfile. This is the relevant part (at the end) of build log with python 3.10 (only .egg installed):

[...]

Did you have your problem with python_branch set to 3.9 or 3.10 in the Portfile? On what macOS version are you?

I'm seeing the same errant behavior, with both Python 3.9 and 3.10. And it's happening consistently, on multiple macOS versions (10.12 through 10.15).

But interestingly enough, if I build with trace mode enabled, everything works properly:

$ sudo port -st destroot lensfun

And only the following items are hidden, so I don't see any immediately-obvious issues:

:warn:destroot The following existing files were hidden from the build system by trace mode:
:msg:destroot   /opt
:msg:destroot   /var/root/.CFUserTextEncoding

Can you try installing with trace mode, and see if that works?

@jmroot / @reneeotten / anyone, thoughts?

comment:9 Changed 2 years ago by jmroot (Joshua Root)

The CMakeLists appears to be using setup.py incorrectly: https://github.com/lensfun/lensfun/blob/v0.3.3/apps/CMakeLists.txt#L45

There is a --root option that should be used to specify a destroot (it should not just be prepended to the prefix); i.e.

INSTALL(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install --prefix=${SETUP_PY_INSTALL_PREFIX} --root=\$ENV{DESTDIR})")

(untested)

Last edited 2 years ago by jmroot (Joshua Root) (previous) (diff)

comment:10 Changed 2 years ago by parafin

using trace mode indeed helped, as did change proposed by @jmroot (attached), though with python 3.10 I get the following files:

./opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lensfun-0.3.3-py3.10.egg-info/
./opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lensfun-0.3.3-py3.10.egg-info/PKG-INFO
./opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lensfun-0.3.3-py3.10.egg-info/SOURCES.txt
./opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lensfun-0.3.3-py3.10.egg-info/top_level.txt
./opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lensfun-0.3.3-py3.10.egg-info/dependency_links.txt
./opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lensfun/__init__.py
./opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lensfun/__pycache__/
./opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lensfun/__pycache__/__init__.cpython-310.pyc

egg seems to be unpacked or smth like that (no idea what egg files are), but in any case lensfun-update-data works

Changed 2 years ago by parafin

Attachment: patch.diff added

source code patch

comment:11 Changed 2 years ago by jmroot (Joshua Root)

Trace mode would be hiding setuptools from the build since this port doesn't declare a dependency on it.

comment:12 Changed 2 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: reopenedclosed

In bddb4401adb285f4860620a44c6ace925cc41ac3/macports-ports (master):

lensfun: add patch to fix install path

  • Add missing deps: gettext; py-setuptools
  • Remove obsolete patch: c++11.patch
  • Rename existing patchfiles, to specify purpose for each

Fixes: #65244

comment:13 in reply to:  10 Changed 2 years ago by mascguy (Christopher Nielsen)

Replying to parafin:

egg seems to be unpacked or smth like that (no idea what egg files are), but in any case lensfun-update-data works

The egg-related files look correct, based on my understanding.

I'll let @jmroot confirm, though.

Note: See TracTickets for help on using tickets.