Bug 253907

Summary: archivers/py-borgbackup: Check for devel/py-llfuse via PYTHON_PKGNAMEPREFIX
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: jjuanino, mandree
Priority: --- Flags: jjuanino: maintainer-feedback+
dim: merge-quarterly+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Fix RUN_DEPENDS to check for llfuse packages instead of shared library none

Description Dimitry Andric freebsd_committer freebsd_triage 2021-02-28 12:42:04 UTC
Created attachment 222873 [details]
Fix RUN_DEPENDS to check for llfuse packages instead of shared library

Recently in ports r559094 a lot of Python port Makefiles had their path checks relaxed because newer versions of Python changed the dynamic library naming scheme:

"Since ports r558913 Python 3.8 incorporates BPO-42604 [1] which changed the
shared libs naming scheme.  This means "EXT_SUFFIX" is now derived from
SOABI and yields with Python 3.8 to ".cpython-38.so" instead of ".so".

The affected ports strip the libaries in the "post-install" target via
hardcoded path(s) and the build fails at the end because the new extension
is not expected at this place."

Indeed my poudriere failed to find the py-llfuse package, even though it just installed it: 

=======================<phase: run-depends    >============================
===>   py39-borgbackup-1.1.15 depends on file: /usr/local/lib/python3.9/site-packages/llfuse.so - not found
===>   Installing existing package /packages/All/py39-llfuse-1.3.8.txz
[stable12-r367684-default-job-01] Installing py39-llfuse-1.3.8...
[stable12-r367684-default-job-01] `-- Installing fusefs-libs-2.9.9_2...
[stable12-r367684-default-job-01] `-- Extracting fusefs-libs-2.9.9_2: .......... done
[stable12-r367684-default-job-01] Extracting py39-llfuse-1.3.8: ......... done
=====
Message from fusefs-libs-2.9.9_2:

--
Install the FUSE kernel module (kldload fusefs) to use this port.
===>   py39-borgbackup-1.1.15 depends on file: /usr/local/lib/python3.9/site-packages/llfuse.so - not found
*** Error code 1

Actually the .so file is now named /usr/local/lib/python3.9/site-packages/llfuse.cpython-39.so.

Instead of attempting to guess the file extension, I propose to simply check for the existence of the py-llfuse package itself, as is done in many other ports, e.g.:

FUSE_DESC=     Support to mount locally borg backup files
FUSE_RUN_DEPENDS=      ${PYTHON_PKGNAMEPREFIX}llfuse>0:devel/py-llfuse@${PY_FLAVOR}

(Of course, if a minimum version is required, we can always put "> x.y.z" in the comparison).
Comment 1 Jose G. Juanino 2021-02-28 18:03:37 UTC
Hi, thanks for submit this problem reports.

I have done some testing with the proposed patch with distinct python flavors (up to 3.9) and works fine. Please, commit the patch. Regards.
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-02-28 19:52:26 UTC
A commit references this bug:

Author: dim
Date: Sun Feb 28 19:51:25 UTC 2021
New revision: 566802
URL: https://svnweb.freebsd.org/changeset/ports/566802

Log:
  Fix run-depends check for py-llfuse after shared libs naming change

  Newer python versions (after 3.8.7) have changed the names of extension
  shared libraries from ".so" to e.g. ".cpython-38.so". So for the FUSE
  option, now check for the py-llfuse package instead of the dynamic
  library llfuse.so.

  Approved by:    jjuanino@gmail.com (maintainer)
  PR:             253907
  MFH:            2021Q

Changes:
  head/archivers/py-borgbackup/Makefile
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2021-02-28 19:55:34 UTC
Thanks, keeping this open until I've MFH'd it.
Comment 4 Matthias Andree freebsd_committer freebsd_triage 2022-08-13 22:01:43 UTC
this should have propagated to quarterly in April 2021, closing