Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 487788 - distutils-r1.eclass: distutils-r1_python_install does not support overriding scriptdir (was: games-board/pychess)
Summary: distutils-r1.eclass: distutils-r1_python_install does not support overriding ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Python Gentoo Team
URL: http://thread.gmane.org/gmane.linux.g...
Whiteboard:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2013-10-12 15:18 UTC by Julian Ospald
Modified: 2013-10-22 15:16 UTC (History)
1 user (show)

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


Attachments
Patch rev1 (0001-distutils-r1-parse-handle-custom-install-scripts.patch,3.41 KB, patch)
2013-10-20 06:34 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Ospald 2013-10-12 15:18:45 UTC
any scripts in /usr/games/bin are no longer wrapped correctly and cause a random script appearing there since _distutils-r1_wrap_scripts changed

example is games-board/pychess which is in stable branch

hardcoding the paths is not a good idea.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-12 16:20:15 UTC
I don't understand what you mean by 'random script'. It just causes the script to be installed in /usr/bin.
Comment 2 Julian Ospald 2013-10-12 16:21:35 UTC
That is not correct.

I get a python2.6 script in /usr/games/bin/pychess.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-12 16:36:47 UTC
(I'm on python@)
Comment 4 Mike Gilbert gentoo-dev 2013-10-12 21:41:06 UTC
Yeah, looks like _distutils-r1_wrap_scripts doesn't really work when the scripts are not in PYTHON_SCRIPTDIR.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-12 21:48:14 UTC
1. We could parse argv passed to distutils-r1_python_install. But that sucks real much since distutils has a lot of magic in that syntax we'd rather not reinvent.

2. We could just let distutils install wherever it wants and then use 'find' to find wherever files landed. This is a bit fragile though.

With python-exec:2, the script install location and name finally matches whatever setup.py installs and therefore expects. If we implement (2), then we lose this benefit.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-13 07:03:28 UTC
Oh, I wasn't able to reproduce since I had a sane GAMES_BINDIR set.

@hasufell, please use python-single-r1 for this particular packages. There's no real reason why a game would be installed for multiple impls. In the meantime, we'll find out how to fix it.
Comment 7 Julian Ospald 2013-10-13 10:11:15 UTC
(In reply to Michał Górny from comment #6)
> 
> @hasufell, please use python-single-r1 for this particular packages.

no.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-13 11:17:38 UTC
(In reply to Julian Ospald (hasufell) from comment #7)
> (In reply to Michał Górny from comment #6)
> > 
> > @hasufell, please use python-single-r1 for this particular packages.
> 
> no.

Rationale? DISTUTILS_SINGLE_IMPL kills your kitten?
Comment 9 Julian Ospald 2013-10-13 11:49:00 UTC
(In reply to Michał Górny from comment #8)
> (In reply to Julian Ospald (hasufell) from comment #7)
> > (In reply to Michał Górny from comment #6)
> > > 
> > > @hasufell, please use python-single-r1 for this particular packages.
> > 
> > no.
> 
> Rationale? DISTUTILS_SINGLE_IMPL kills your kitten?

No, you have to give ME a rationale why I should not support multiple implementations. The fact that the eclass is currently broken for these packages is not one.
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-13 12:07:11 UTC
The package is an application and its Python modules are practically private. It is not a dependency of any other package. There's no real benefit of having multiple copies of the same file for a regular user. That's python team policy.

That said, I admit that there's a bug in the eclass. It will be fixed once one of us has enough time to find a proper solution. Feel free to provide a patch. You don't need to terrorize us by forcing the users to hit the issue.
Comment 11 Julian Ospald 2013-10-13 12:11:12 UTC
(In reply to Michał Górny from comment #10)
> You don't need to terrorize us by forcing the users to hit the issue.

I'm sorry, but I feel terrorized by unstable eclasses, random changes in their behavior and maintainers who don't communicate/test very well.
Comment 12 Julian Ospald 2013-10-13 13:55:11 UTC
(In reply to Michał Górny from comment #10)
> The package is an application and its Python modules are practically
> private. It is not a dependency of any other package. There's no real
> benefit of having multiple copies of the same file for a regular user.
> That's python team policy.
> 

I have no idea how users intend to use the packages I provide. I try not to assume too much about it. I provide the maximum of features to satisfy both users, hackers, developers and whoever may use this package in whatever way while trying to not make it overcomplex for the user.

Most people only have one python2 and one python3 implementation installed. So the majority of users will not have multiple copies anyway.

That said, I don't know what a "regular" gentoo user is.
Comment 13 Mike Gilbert gentoo-dev 2013-10-13 19:47:31 UTC
We have offered a workaround for what we acknowledge to be a bug in the eclass. There is nothing more we can do to help solve this problem in the immediate future.

Let's keep the discussion of terrorism to a minimum here.
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-19 08:54:35 UTC
Fixing this for python-exec:0 should be pretty straightforward.

For python-exec:2, it's much harder. We definitely want setup.py to get the final script location (for any potential in-package use) rather than some random path given in ebuild.

So far, I can't see other solution than:

a) parsing command-line arguments given to setup.py during install,

b) adding an environment variable that would override the install path.

I think a) is a better solution here since it doesn't require specifying the same information twice. It would require some knowledge on how exactly distutils parses the arguments though.
Comment 15 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-19 22:19:08 UTC
Patch sent to the ml for review. Please test.
Comment 16 Julian Ospald 2013-10-19 23:16:17 UTC
(In reply to Michał Górny from comment #15)
> Patch sent to the ml for review. Please test.

please attach it here as well, I'm not subscribed and gmane breaks patch syntax
Comment 17 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-20 06:34:33 UTC
Created attachment 361402 [details, diff]
Patch rev1
Comment 18 Julian Ospald 2013-10-20 12:51:06 UTC
(In reply to Michał Górny from comment #17)
> Created attachment 361402 [details, diff] [details, diff]
> Patch rev1

tested on all games reverse deps, seems to work
Comment 19 Julian Ospald 2013-10-20 13:06:48 UTC
a few more random tests on

vboxgtk trash-cli elogv gentoopm layman smart-live-rebuild keepnote jedi simplegui zfec ninja-ide tahoe-lafs pybugz

seemed to work (those don't override scriptdir)
Comment 20 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-22 15:16:01 UTC
+  22 Oct 2013; Michał Górny <mgorny@gentoo.org> distutils-r1.eclass:
+  Support installing Python scripts with custom --install-scripts argument. Bug
+  #487788.