Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 608312 - Problems upgrading python 3.4.3-r1 to 3.4.5 on uclibc-ng
Summary: Problems upgrading python 3.4.3-r1 to 3.4.5 on uclibc-ng
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL: https://archives.gentoo.org/gentoo-em...
Whiteboard:
Keywords:
Depends on:
Blocks: uclibc-porting
  Show dependency tree
 
Reported: 2017-02-05 12:23 UTC by René Rhéaume
Modified: 2017-10-31 17:37 UTC (History)
3 users (show)

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


Attachments
build log from Walter Dnes (buildlog.txt,901.19 KB, text/plain)
2017-02-05 12:24 UTC, René Rhéaume
Details
emerge --info of Walter Dnes' system (emergeinfo.txt,4.76 KB, text/plain)
2017-02-05 12:25 UTC, René Rhéaume
Details
environment of Walter Dnes system (environment.txt,152.71 KB, text/plain)
2017-02-05 12:25 UTC, René Rhéaume
Details
Update for Python 3.5.2 ebuild to fix Gentoo bug 608312 (Python_3.5.2_GENTOO_Bug_608312.diff,476 bytes, patch)
2017-04-20 20:14 UTC, James Edington
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description René Rhéaume 2017-02-05 12:23:35 UTC
Originally reported on the gentoo-embedded mailing list:
"I'm currently trying to test uclibc-ng 32-bit inside a VM in QEMU.
The upgrade from python 3.4.3-r1 to 3.4.5 dies at the install stage.
The attached file logs.tar.bz2 has the buildlog, environment, and output
from "emerge --info".  Any ideas what's going wrong?"

It also happens hardened amd64 (Lilblue) with uclibc-ng 1.0.17

Reproducible: Always

Steps to Reproduce:
1. emerge -u1 python:3.4
2.
3.
Actual Results:  
emerge failed (install phase)

Expected Results:  
Python updated

I will attach each file inside the tarball mentionned in mailing list message, not the tarball itself.
Comment 1 René Rhéaume 2017-02-05 12:24:30 UTC
Created attachment 462520 [details]
build log from Walter Dnes
Comment 2 René Rhéaume 2017-02-05 12:25:01 UTC
Created attachment 462522 [details]
emerge --info of Walter Dnes' system
Comment 3 René Rhéaume 2017-02-05 12:25:41 UTC
Created attachment 462524 [details]
environment of Walter Dnes system
Comment 4 Anthony Basile gentoo-dev 2017-02-05 12:35:51 UTC
Yes, I know.  I'm trying to skip 3.4.5 and go straight to 3.5.x.  I've done so on the stages.
Comment 5 Anthony Basile gentoo-dev 2017-02-08 14:54:35 UTC
(In reply to Anthony Basile from comment #4)
> Yes, I know.  I'm trying to skip 3.4.5 and go straight to 3.5.x.  I've done
> so on the stages.

Maybe I should add how to deal with this.  To your make.conf add:

    PYTHON_TARGETS="python2_7 python3_5"

and to your package.accept_keywords add

    =dev-lang/python-3.5.2 ~amd64

and to your package.mask add

    =dev-lang/python-3.4.5
Comment 6 René Rhéaume 2017-02-11 00:06:43 UTC
I found the line in the ebuild where it fails. it's line 293, with python_export "python${PYVER}" "${vars[@]}"

Preceding lines are:
        # for python-exec
        local vars=( EPYTHON PYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )

        # if not using a cross-compiler, use the fresh binary
        if ! tc-is-cross-compiler; then
                local -x PYTHON=./python
                local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
        else
                vars=( PYTHON "${vars[@]}" )
        fi

        python_export "python${PYVER}" "${vars[@]}
Comment 7 René Rhéaume 2017-02-11 00:08:24 UTC
(In reply to René Rhéaume from comment #6)
> I found the line in the ebuild where it fails. it's line 293, with
> python_export "python${PYVER}" "${vars[@]}"
> 
> Preceding lines are:
>         # for python-exec
>         local vars=( EPYTHON PYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
should be
local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )

Bad copy and paste. Sorry.
Comment 8 René Rhéaume 2017-02-11 01:56:12 UTC
(In reply to René Rhéaume from comment #6)
>                 local -x
> LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.

What does this line do to the LD_LIBRARY_PATH environment variable? There is an issue with relative paths set to LD_LIBRARY_PATH in bug #591586. I wonder if it's a similar bug.
Comment 9 Anthony Basile gentoo-dev 2017-02-11 14:19:57 UTC
(In reply to René Rhéaume from comment #8)
> (In reply to René Rhéaume from comment #6)
> >                 local -x
> > LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
> 
> What does this line do to the LD_LIBRARY_PATH environment variable? There is
> an issue with relative paths set to LD_LIBRARY_PATH in bug #591586. I wonder
> if it's a similar bug.

To see what that line of bash does, try this:

# unset A
# A=${A+3}
# echo $A

# A=5
# A=${A+3}
# echo $A
3
Comment 10 René Rhéaume 2017-02-11 14:48:06 UTC
(In reply to Anthony Basile from comment #9)
> (In reply to René Rhéaume from comment #8)
> > (In reply to René Rhéaume from comment #6)
> > >                 local -x
> > > LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
> > 
> > What does this line do to the LD_LIBRARY_PATH environment variable? There is
> > an issue with relative paths set to LD_LIBRARY_PATH in bug #591586. I wonder
> > if it's a similar bug.

So this line does this:
1- Append : to LD_LIBRARY_PATH unless it already end with :
2- Append . (a relative path!) to LD_LIBRARY_PATH

It looks like the same issue as for icu on uclibc-ng: uclibc-ng does not cope with relative paths in LD_LIBRARY_PATH.
Comment 11 René Rhéaume 2017-02-11 21:57:50 UTC
In the ebuild, I replaced line 288

local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.

with

local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}$PWD 

and I was able to emerge python 3.4.5. I no longer have a vulnerable python on my system.
Comment 12 Anthony Basile gentoo-dev 2017-02-12 13:12:38 UTC
(In reply to René Rhéaume from comment #11)
> In the ebuild, I replaced line 288
> 
> local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
> 
> with
> 
> local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}$PWD 
> 
> and I was able to emerge python 3.4.5. I no longer have a vulnerable python
> on my system.

Okay I'm cc-ing the python team.  If they fix this, I'll drop back to 3.4.5 for the stages.
Comment 13 James Edington 2017-04-20 20:14:21 UTC
Created attachment 470526 [details, diff]
Update for Python 3.5.2 ebuild to fix Gentoo bug 608312

This bug also affects Python 3.5.2…
Comment 14 Mike Gilbert gentoo-dev 2017-07-25 23:48:09 UTC
(In reply to Anthony Basile from comment #12)

Copying python@g.o is generally insufficient for getting anyone's attention. An IRC ping would be much more effective.
Comment 15 Larry the Git Cow gentoo-dev 2017-10-31 17:35:11 UTC
The bug has been closed via the following commit(s):

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

commit e47a2221253a05b34be839a49cdd670632c6cfd5
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2017-10-31 17:31:45 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2017-10-31 17:35:06 +0000

    dev-lang/python: use absolute path in LD_LIBRARY_PATH
    
    Closes: https://bugs.gentoo.org/608312
    Package-Manager: Portage-2.3.12_p5, Repoman-2.3.3_p75

 dev-lang/python/python-2.7.14.ebuild | 2 +-
 dev-lang/python/python-3.4.5.ebuild  | 2 +-
 dev-lang/python/python-3.4.6.ebuild  | 2 +-
 dev-lang/python/python-3.6.3.ebuild  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Comment 16 Larry the Git Cow gentoo-dev 2017-10-31 17:37:35 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f33ab5f94d42021f57824e97f59cf9d6eedff01

commit 3f33ab5f94d42021f57824e97f59cf9d6eedff01
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2017-10-31 17:36:55 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2017-10-31 17:37:25 +0000

    dev-lang/python: use absolute path in LD_LIBRARY_PATH
    
    Closes: https://bugs.gentoo.org/608312
    Package-Manager: Portage-2.3.12_p5, Repoman-2.3.3_p75

 dev-lang/python/python-3.5.4.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)