When I try to emerge (or update) portage or others packages, the compilation is interrupted with the following message: TypeError: unsupported operand types for +: 'NoneType' and 'str' !!! ERROR: sys-apps/portage-2.0.49-r21 failed. !!! Function src_install, Line 95, Exitcode 1 !!! Failed to install missingos module Reproducible: Always Steps to Reproduce: 1. emerge -v portage 2. 3. Actual Results: The package (in this example portage) doesn't compile, and prints the following error: File "/usr/lib/python2.2/distutils/sysconfig.py", line 138, in customize_compiler cc_cmd = cc + ' ' + opt TypeError: unsupported operand types for +: 'NoneType' and 'str' !!! ERROR: sys-apps/portage-2.0.49-r21 failed. !!! Function src_install, Line 95, Exitcode 1 !!! Failed to install missingos module Expected Results: The package should be compiled. Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r3, 2.4.22-gentoo-r4) ================================================================= System uname: 2.4.22-gentoo-r4 i686 Pentium Pro Gentoo Base System version 1.4.3.10 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentiumpro -O3 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=pentiumpro -O3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="sandbox ccache autoaddcvs" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 oss apm arts avi crypt cups encode foomaticdb gif gtk2 jpeg libg++ mad mikmod motif mpeg ncurses nls pdflib png quicktime sdl spell svga truetype xml2 xmms xv zlib gdbm berkdb slang readline tcltk java mysql gpm tcpd pam libwww ssl perl python esd imlib oggvorbis opengl mozilla cdr X gtk gnome alsa -kde -qt apache2"
Created attachment 23774 [details] emerge -v portage log This is the output of the emerge -v portage command
distutils can't find your c compiler, try setting the CC environment var and make sure there's nothing wrong with /usr/lib/python2.2/config/Makefile .
Created attachment 23779 [details] example reproduction of error I think the file /usr/lib/python2.2/config/Makefile is either missing or corrupt.
root@aquanta config # echo $CC gcc root@aquanta config # gcc -dumpversion 3.2.3 root@aquanta config # file /usr/lib/python2.2/config/Makefile /usr/lib/python2.2/config/Makefile: empty root@aquanta config # CC variable is well defined, but as it seems the Makefile is empty
which version/revision of python are you using? the Makefile seems to exist on all my python2.2 installations, this is the first time i've heard of it being missing.
I suggest re-emerging python to fix this problem.
I've already tried to re-emerge python, but the problem persists. I've also removed /usr/lib/python2.2/config/Makefile, but after re-emerging python, the Makefile continues to be an empty file.
I'm using Python 2.2.3: root@aquanta config # python -V Python 2.2.3
Grab a tarball of python 2.2.3 from python.org, configure it with ./configure --prefix=/tmp then do the usual "make && make install", then see if you can grab the Makefile from the copy of python installed in /tmp .
i'm talking about the portage revision, are you using 2.2.3-r5 ? do: emerge python 2>&1 | tee /tmp/python.log and then attach that log file here.
solved by copying /tmp/lib/python2.2/config/Makefile to /usr/lib/python2.2/config/Makefile Thank you for all your help.
I'm using python-2.2.3: root@aquanta tmp # emerge -pv python These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] dev-lang/python-2.2.3-r5 +ncurses +gdbm +readline +tcltk +berkdb -build -doc +ssl
i'm not really sure it is fixed or if it is a local problem, without more information, i can't tell at all. but i believe this is a one off thing, i can't reproduce this behaviour on my side.
Created attachment 23840 [details] python emerge log as requested (emerge python 2>&1 | tee /tmp/python.log) As requested, I've created a log for re-emerging portage (emerge python 2>&1 | tee /tmp/python.log). And due to that, the original problem had returned. Probably the Makefile isn't being correctly created.
ok, portage guys, i think i've found a problem with /usr/lib/portage/bin/dosed that's causing this error: notice that in the log : ... /var/tmp/portage/python-2.2.3-r5/image//usr/share/man/man1/python.1 /usr/lib/portage/bin/dosed: line 1: /usr/bin/basename: No such file or directory ... in /usr/lib/portage/dosed it looks for /usr/bin/basename, if that doesn't exist, it'll wipe out the file it is sed'ing, can we have a check there before it does the sed to make sure /usr/bin/basename does exist? as for the bug reporter, there is a problem with your installation, coreutils is missing /usr/bin/basename which seems to be a symlink present on all my gentoo boxes. you need to re-merge coreutils to see what is going on.
You were right, the /usr/bin/basename was missing, but after re-emerging both coreutils and python, the Makefile continues to be created as an empty file.
Created attachment 23849 [details] python emerge log after re-emerging coreutils
My dosed looks for basename in /bin, using portage 2.0.49-r21 and coreutils 5.0-r5. Also note that I nuked basename in /bin and Python failed to compile for me (python_build_dir/Modules/makesetup needs basename to create the Makefile), so I assume there's a basename somewhere on your computer (probably in /bin) just dosed is looking in the wrong place for it for some reason.
Created attachment 23853 [details] Log of removing basename then trying to compile Python
Created attachment 23856 [details, diff] Replaces basename with shell globbing in dosed.
for reference: i'm using portage-2.0.50_pre12 or above, but on another machine, portage-2.0.49-r18 also has /usr/bin/basename in dosed.
Created attachment 23857 [details, diff] Replace basename with shell globbing in dosed. sorry, previous patch was bogus
I lied, my dosed looks for basename in /usr/bin too, just my /usr/bin has a symlink to /bin/basename, like liquidx said.
supposed to be fixed in 2.0.50 which is stable now. If this bug is not fixed please reopen.