Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 909880 - app-misc/gramps: uses legacy distutils-r1 code paths (DistutilsNonPEP517Build)
Summary: app-misc/gramps: uses legacy distutils-r1 code paths (DistutilsNonPEP517Build)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal
Assignee: Marek Szuba (RETIRED)
URL: https://gramps-project.org/bugs/view....
Whiteboard:
Keywords:
Depends on: 916194
Blocks: pep517-porting
  Show dependency tree
 
Reported: 2023-07-08 06:46 UTC by Michał Górny
Modified: 2023-10-24 23:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-07-08 06:46:13 UTC
This package still uses the legacy eclass code paths.  These paths are deprecated and pose a significant maintenance cost.  Please update the package to use PEP517 build mode.  For more information, please see the Python Guide, particularly; https://projects.gentoo.org/python/guide/migration.html#migrating-to-pep-517-builds
Comment 1 Marek Szuba (RETIRED) archtester gentoo-dev 2023-07-08 20:32:33 UTC
Will be taken care of shortly, a new version has been released recently.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-08 20:40:54 UTC
[Adding this comment en-masse, sorry for the noise, but it's important.)

1. Please take particular care to check file diffs before/after, possibly using `iwdevtools`. Keep a particular eye out for e.g. config files now missing from /etc and instead being in /usr/lib/python*/site-packages, etc.

2. Please make sure to do the migration in a new revision in ~arch, partly because of 1.
Comment 3 Marek Szuba (RETIRED) archtester gentoo-dev 2023-07-10 21:06:10 UTC
Sadly, no go. Gramps uses one of those problematic customised distutils build systems AND requires the passing of arguments, and an ebuild modified to use PEP-517 mode both breaks the (already quite finicky) test suite and results in missing files.

Given the fairly low level of upstream activity at the moment, I suspect our best bet for making Gramps stop relying on legacy distutils-r1 code paths is to  migrate its ebuilds to python-single-r1. WDYT?
Comment 4 Larry the Git Cow gentoo-dev 2023-07-10 23:04:51 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=968fd2401643524b824134ffefd440ec42e24606

commit 968fd2401643524b824134ffefd440ec42e24606
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2023-07-10 22:10:54 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2023-07-10 23:04:18 +0000

    app-misc/gramps: switch from distutils-r1 to python-single-r1
    
    Gramps uses a heavily customised distutils-based setup.py which was
    already somewhat fragile while using the legacy distutils-r1 mode
    and which simply does not work correctly in PEP-517 mode. Just let
    python-single-r1 handle the plumbing and call setup.py directly
    as needed. Not only does this mean one package less in the tree to
    depend on the legacy distutils-r1 but in the end, not having to
    make the custom setup.py play nicely with that eclass actually makes
    the ebuilds a bit simpler.
    
    Closes: https://bugs.gentoo.org/909880
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 ...{gramps-5.1.6.ebuild => gramps-5.1.6-r1.ebuild} | 49 +++++++---------------
 1 file changed, 16 insertions(+), 33 deletions(-)
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-07-11 04:08:11 UTC
That's not a solution, that's only sweeping the problem under the rug and pretending everything's fine.

When the eclass stops supporting legacy code paths, we are also going to stop patching Python and setuptools to make the plumbing work.  This means that the package will stop working anyway, and now we don't even have a clear note that we're going to break something.

Plus, at some point setuptools upstream may actually break something sooner than later.

That said, at a quick look that's hardly a heavy customization, at least in the current git code.  Upstream definitely supports installing via a wheel, so there is no reason why PEP517 build wouldn't work.
Comment 6 Marek Szuba (RETIRED) archtester gentoo-dev 2023-08-23 11:59:13 UTC
Looks like upstream is finally on it! Current git master has already had setup.py rewritten to setuptools so I'll see if the new version plays nicely with DISTUTILS_USE_PEP517=setuptools.
Comment 7 Larry the Git Cow gentoo-dev 2023-08-23 22:17:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48fad51b53b9aa4dacb87dabbd99c4772f680f0c

commit 48fad51b53b9aa4dacb87dabbd99c4772f680f0c
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2023-08-23 21:48:51 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2023-08-23 22:17:11 +0000

    app-misc/gramps: switch to PEP-517 build mode
    
    Uses backported upstream refactoring of setup.py from distutils to
    setuptools.
    
    Bug: https://bugs.gentoo.org/909880
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 .../gramps/files/gramps-5.1.6-pep517_setup.patch   | 163 +++++++++++++++++++++
 app-misc/gramps/gramps-5.1.6-r2.ebuild             |  82 +++++++++++
 2 files changed, 245 insertions(+)
Comment 8 Julien Papasian 2023-09-06 16:20:22 UTC
This change introduces a critical regression (works fine with 5.1.6-r1).
I can't open the app, I get:
ResourcePath.ERROR: Unable to determine resource path

There are various threads on Gramps forums about this, but basically it worked before.
I don't know the technical details about how this ebuild is written but I can see something that seem close to the error on -r1:
${PYTHON} setup.py --verbose install --root="${ED}" --resourcepath=/usr/share
Here we have a resourcepath parameter.

In -r2, this parameter seems missing from the ebuild.
Comment 9 Marek Szuba (RETIRED) archtester gentoo-dev 2023-09-06 16:23:48 UTC
Thank you for the report but please open a new ticket for that issue.
Comment 10 Larry the Git Cow gentoo-dev 2023-10-24 23:16:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=442c48c43d2a764baa94ef5d27bbc83337a1a201

commit 442c48c43d2a764baa94ef5d27bbc83337a1a201
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2023-10-24 21:31:40 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2023-10-24 23:16:30 +0000

    app-misc/gramps: drop 5.1.6-r1
    
    Closes: https://bugs.gentoo.org/909880
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 app-misc/gramps/gramps-5.1.6-r1.ebuild | 87 ----------------------------------
 1 file changed, 87 deletions(-)