Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 517496 - dev-lang/python-exec-2.0.1-r1 with sys-apps/proot-3.2.2-r1(?) AND sys-apps/pkgcore - proot pmerge: /usr/lib64/python-exec/python-exec2: no supported Python implementation variant found!
Summary: dev-lang/python-exec-2.0.1-r1 with sys-apps/proot-3.2.2-r1(?) AND sys-apps/pk...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sergey Popov
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-19 11:30 UTC by Joakim Tjernlund
Modified: 2014-11-28 09:47 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 Joakim Tjernlund 2014-07-19 11:30:53 UTC
Trying to use proot with sys-apps/pkgcore I get:
> proot pmerge 
/usr/lib64/python-exec/python-exec2: no supported Python implementation variant found!

pmerge has shebang:
#!/usr/lib/python-exec/python-exec2-c

I don't know if this is a proot or python-exec issue though, lets
start with python-exec as it is a gentoo-tool
Comment 1 Sergey Popov gentoo-dev 2014-07-23 11:49:30 UTC
That's VERY strange. proot DOES NOT install any parts of Python-related code, so it can not be the real issue.

CCing pkgcore maintainers
Comment 2 Joakim Tjernlund 2014-07-23 12:31:49 UTC
I don't think this is a pkgcore issue, its is either a proot or
python-exec.

A guess is that python-exec requires some particular argv0 handling
This works:
proot sh -c pmerge
usage: pmerge [-h] [--version] [--debug] [--color BOOLEAN]
              [--add-config SECTION KEY VALUE]
              [--new-config SECTION KEY VALUE] [--empty-config]
              [--domain DOMAIN] [-N] [-s SET] [-C] [--clean] [-p]
              [--ignore-failures] [-a] [--force] [-f] [-1] [-u] [-D]
              [--preload-vdb-state] [-i] [-B] [-O] [-n] [-k] [-K] [-S] [-e]
              [-v] [--quiet-repo-display] [-F FORMATTER]
              [targets [targets ...]]
pmerge: error: Need at least one atom/set
Comment 3 Sergey Popov gentoo-dev 2014-07-23 12:51:29 UTC
(In reply to Joakim Tjernlund from comment #2)
> I don't think this is a pkgcore issue, its is either a proot or
> python-exec.
> 
> A guess is that python-exec requires some particular argv0 handling
> This works:
> proot sh -c pmerge
> usage: pmerge [-h] [--version] [--debug] [--color BOOLEAN]
>               [--add-config SECTION KEY VALUE]
>               [--new-config SECTION KEY VALUE] [--empty-config]
>               [--domain DOMAIN] [-N] [-s SET] [-C] [--clean] [-p]
>               [--ignore-failures] [-a] [--force] [-f] [-1] [-u] [-D]
>               [--preload-vdb-state] [-i] [-B] [-O] [-n] [-k] [-K] [-S] [-e]
>               [-v] [--quiet-repo-display] [-F FORMATTER]
>               [targets [targets ...]]
> pmerge: error: Need at least one atom/set

Sorry, you do not get my point. There is no Python parts in proot installation process.
Not a single one.

phantom PRoot-4.0.0 # pwd
/var/tmp/portage/sys-apps/proot-4.0.0/work/PRoot-4.0.0
phantom PRoot-4.0.0 # grep -ir pmerge .
phantom PRoot-4.0.0 #

No pmerge => not proot issue.

Reassigning to python-exec maintainers, cause i know that previous versions(0.*) had some issues with handling of argv[0], IIRC
Comment 4 Joakim Tjernlund 2014-07-23 13:23:58 UTC
(In reply to Sergey Popov from comment #3)
> (In reply to Joakim Tjernlund from comment #2)
> > I don't think this is a pkgcore issue, its is either a proot or
> > python-exec.
> > 
> > A guess is that python-exec requires some particular argv0 handling
> > This works:
> > proot sh -c pmerge
> > usage: pmerge [-h] [--version] [--debug] [--color BOOLEAN]
> >               [--add-config SECTION KEY VALUE]
> >               [--new-config SECTION KEY VALUE] [--empty-config]
> >               [--domain DOMAIN] [-N] [-s SET] [-C] [--clean] [-p]
> >               [--ignore-failures] [-a] [--force] [-f] [-1] [-u] [-D]
> >               [--preload-vdb-state] [-i] [-B] [-O] [-n] [-k] [-K] [-S] [-e]
> >               [-v] [--quiet-repo-display] [-F FORMATTER]
> >               [targets [targets ...]]
> > pmerge: error: Need at least one atom/set
> 
> Sorry, you do not get my point. There is no Python parts in proot
> installation process.
> Not a single one.
> 
> phantom PRoot-4.0.0 # pwd
> /var/tmp/portage/sys-apps/proot-4.0.0/work/PRoot-4.0.0
> phantom PRoot-4.0.0 # grep -ir pmerge .
> phantom PRoot-4.0.0 #

pmerge is part of pkgcore, not proot.

> 
> No pmerge => not proot issue.

ehh, thast is not a valid claim.
proot is supposed to be transparant to the apps it launches but
here something gets in the way. 

> 
> Reassigning to python-exec maintainers, cause i know that previous
> versions(0.*) had some issues with handling of argv[0], IIRC
Comment 5 Cédric Vincent 2014-07-23 19:48:02 UTC
If "proot sh -c pmerge" works but "proot pmerge" doesn't, then it's a bug in PRoot.  I'll take a look at it.
Comment 6 Joakim Tjernlund 2014-07-23 20:54:21 UTC
(In reply to Cédric Vincent from comment #5)
> If "proot sh -c pmerge" works but "proot pmerge" doesn't, then it's a bug in
> PRoot.  I'll take a look at it.

Yes, I think so too.
Did some strace of proot pmerge and plain pmerge, got this far:

jocke@gentoo-jocke ~ $ proot /usr/lib/python-exec/python2.7/pmerge
usage: filter-env [-h] [--version] [--debug] [-V] [-F] [-i INPUT] [-f FUNCS]
                  [-v VARS] [--print-vars | --print-funcs]
filter-env: error: failed loading/parsing input: Refusing to read from stdin since it's a TTY
jocke@gentoo-jocke ~ $  /usr/lib/python-exec/python2.7/pmerge
usage: pmerge [-h] [--version] [--debug] [--color BOOLEAN]
              [--add-config SECTION KEY VALUE]
              [--new-config SECTION KEY VALUE] [--empty-config]
              [--domain DOMAIN] [-N] [-s SET] [-C] [--clean] [-p]
              [--ignore-failures] [-a] [--force] [-f] [-1] [-u] [-D]
              [--preload-vdb-state] [-i] [-B] [-O] [-n] [-k] [-K] [-S] [-e]
              [-v] [--quiet-repo-display] [-F FORMATTER]
              [targets [targets ...]]
pmerge: error: Need at least one atom/set

Perhaps a symlink problem(following all symlinks to the end, like realpath do)?
Comment 7 Joakim Tjernlund 2014-08-06 20:14:55 UTC
(In reply to Cédric Vincent from comment #5)
> If "proot sh -c pmerge" works but "proot pmerge" doesn't, then it's a bug in
> PRoot.  I'll take a look at it.

Any clues yet?
Comment 8 Cédric Vincent 2014-08-07 10:36:09 UTC
I'm able to reproduce this bug; it happens when launching a script through a symlink (ie. this is not specific to Python):

    $ cat -> 1.sh
    #!/bin/sh
    echo $0
    ^D

    $ ln -s 1.sh 2.sh

    $ proot 2.sh
    /usr/local/cedric/git/proot/tests/rootfs/bin/1.sh

    $ proot sh -c ./2.sh
    ./2.sh

At a first glance, this bug comes from the initialize_command() and launch_process() functions in PRoot, that's why it doesn't happen when using a shell.

I'm investigating for the right fix,
Cédric.
Comment 10 Joakim Tjernlund 2014-08-07 17:13:24 UTC
(In reply to Cédric Vincent from comment #9)
> Fix:
> https://github.com/cedric-vincent/PRoot/commit/
> 520fa3601c36dd0a3c84e310bd2a1189259000bd

Super,it was a symlink problem after all!

I do not see this commit in the master branch though. I hope you
do not plan to release proot without this fix as it causes
apps to crash and burn.

Got a question too, proot affects perforamnce too but is the penalty
constant no matter what options you use? Could you elaborate if it
depends on how one uses proot?

Wishlist, make -0 as good as fakeroot.
Comment 11 Cédric Vincent 2014-08-08 12:03:45 UTC
--- Comment #10 from Joakim Tjernlund <Joakim.Tjernlund@transmode.se> ---
> I do not see this commit in the master branch though. I hope you
> do not plan to release proot without this fix as it causes
> apps to crash and burn.

Well, the situtation is not so dramatic :) since it happens only if
all the following conditions are met:

- the program in launched by PRoot directly, ie. it is not launched by
  a shell or any other program previously launched by PRoot; and

- the program is launched through a symbolic link; and

- the program is a script (ie. it contains a shebang); and

- argv[0] impacts the behavior of the program.

This fix will be included in the next release, maybe in September.

By the way, the latest release (v4.0.1) contains a fix to a bug
exposed by Gentoo's sandbox (which is not recommended under PRoot
anyway, see below).


> Got a question too, proot affects perforamnce too but is the penalty
> constant no matter what options you use? Could you elaborate if it
> depends on how one uses proot?
>
> Wishlist, make -0 as good as fakeroot.

I put answers in a dedicated thread: https://groups.google.com/forum/?fromgroups#!topic/proot_me/GQU5s8XR_yU
Comment 12 Sergey Popov gentoo-dev 2014-08-08 12:38:01 UTC
Joakim, it was proot issue, after all. I was wrong and probably rude, sorry for that.

Cédric, big thanks for such quick fix!

I will backport it into upcoming ebuild for 4.0.1
Comment 13 Joakim Tjernlund 2014-08-09 17:31:53 UTC
(In reply to Cédric Vincent from comment #11)
> --- Comment #10 from Joakim Tjernlund <Joakim.Tjernlund@transmode.se> ---
> > I do not see this commit in the master branch though. I hope you
> > do not plan to release proot without this fix as it causes
> > apps to crash and burn.
> 
> Well, the situtation is not so dramatic :) since it happens only if
> all the following conditions are met:
> 
> - the program in launched by PRoot directly, ie. it is not launched by
>   a shell or any other program previously launched by PRoot; and
> 
> - the program is launched through a symbolic link; and
> 
> - the program is a script (ie. it contains a shebang); and
> 
> - argv[0] impacts the behavior of the program.

My case only then it seems :-)
> 
> This fix will be included in the next release, maybe in September.
> 
> By the way, the latest release (v4.0.1) contains a fix to a bug
> exposed by Gentoo's sandbox (which is not recommended under PRoot
> anyway, see below).

I looked for the ref to Gentoo sandbox and proot but I did not find any,
did you forget it or am I just blind?

> 
> 
> > Got a question too, proot affects perforamnce too but is the penalty
> > constant no matter what options you use? Could you elaborate if it
> > depends on how one uses proot?
> >
> > Wishlist, make -0 as good as fakeroot.
> 
> I put answers in a dedicated thread:
> https://groups.google.com/forum/?fromgroups#!topic/proot_me/GQU5s8XR_yU

saw your answer, looks good I must say:-)
Comment 14 Cédric Vincent 2014-08-20 10:55:16 UTC
(In reply to Joakim Tjernlund from comment #13)
> My case only then it seems :-)

Well, it seems I have underestimated the impact of this bug, it turns
out it affects not only scripts, but also dynamically linked programs
(since the ELF interpreter is used explicitly as a loader).

In other words, the patch for the bug you have reported also fixes
issues #20 and #65 (duplicate) on https://github.com/cedric-vincent/PRoot/issues/


> I looked for the ref to Gentoo sandbox and proot but I did not find any,
> did you forget it or am I just blind?

https://github.com/cedric-vincent/PRoot/releases/tag/v4.0.1
https://github.com/cedric-vincent/PRoot/commit/bf1003c246790d4631e95df485d6ba7f72c0d24a
Comment 15 Sergey Popov gentoo-dev 2014-09-02 07:07:51 UTC
+*proot-4.0.1 (02 Sep 2014)
+
+  02 Sep 2014; Sergey Popov <pinkbyte@gentoo.org> -proot-4.0.0.ebuild,
+  +proot-4.0.1.ebuild, +files/proot-4.0.1-argv.patch:
+  Version bump, wrt bug #520050 with fix for bug #517496. Thanks to Joakim
+  Tjernlund <Joakim.Tjernlund AT transmode.se> for discovering this issues.
+  Drop old version

So, i bring fix for this into unstable. Will proceed with stabilization after usual period of waiting.
Comment 16 Cédric Vincent 2014-09-05 17:33:13 UTC
Hello,

The fix for this bug was released upstream (v4.0.2): https://groups.google.com/forum/#!msg/proot_me/K_DsLNI8UlY/yaAL9isZwLQJ

Thanks!
Comment 17 Sergey Popov gentoo-dev 2014-11-28 09:47:03 UTC
3.2.2-r1 is in stable for a quite long period, closing this as fixed