Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 418093 - Python build failure due to missing libbz2.so
Summary: Python build failure due to missing libbz2.so
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-29 06:51 UTC by Nima
Modified: 2012-06-05 08:18 UTC (History)
1 user (show)

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


Attachments
Complete log of the error detailed in the bug. (log.txt,122.92 KB, text/plain)
2012-05-29 06:54 UTC, Nima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nima 2012-05-29 06:51:09 UTC
Following the procedure as per http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-solaris.xml, when I get to this step:

% ../bin/bootstrap-prefix.sh $EPREFIX/tmp python

I get a failure (log attached, and details below).



Reproducible: Always

Steps to Reproduce:
1. As per http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-solaris.xml, follow steps from code listings 1.1, 1.2, and 1.3
2. Failure occurs in 1.3 when compiling Python:

% ../bin/bootstrap-prefix.sh $EPREFIX/tmp python
Actual Results:  
Compilation failure:


Python build finished, but the necessary bits to build these modules were not found:
_bsddb             _sqlite3           _ssl
_tkinter           bsddb185           dl
imageop            sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.


Failed to build these modules:
bz2

running build_scripts
creating build/scripts-2.7
copying and adjusting /home/talebi/gentoo/tmp/var/tmp/python-2.7.2/Python-2.7.2/Tools/scripts/pydoc -> build/scripts-2.7
copying and adjusting /home/talebi/gentoo/tmp/var/tmp/python-2.7.2/Python-2.7.2/Tools/scripts/idle -> build/scripts-2.7
copying and adjusting /home/talebi/gentoo/tmp/var/tmp/python-2.7.2/Python-2.7.2/Tools/scripts/2to3 -> build/scripts-2.7
copying and adjusting /home/talebi/gentoo/tmp/var/tmp/python-2.7.2/Python-2.7.2/Lib/smtpd.py -> build/scripts-2.7
changing mode of build/scripts-2.7/pydoc from 644 to 755
changing mode of build/scripts-2.7/idle from 644 to 755
changing mode of build/scripts-2.7/2to3 from 644 to 755
changing mode of build/scripts-2.7/smtpd.py from 644 to 755
make: *** [sharedmods] Error 1


System information:

~/gentoo> cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 1

~/gentoo> cat /etc/SuSE-brand
SLES
VERSION = 11
CO-BRANDS = SLE openSUSE

~/gentoo> uname -a
Linux devsyd899 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 GNU/Linux
Comment 1 Nima 2012-05-29 06:54:00 UTC
Created attachment 313485 [details]
Complete log of the error detailed in the bug.

Please note that this bug is a follow up from comment 32 on an existing bug:

https://bugs.gentoo.org/show_bug.cgi?id=381163#c32

Also note that I have not used the LDFLAGS mentioned on that page to produce this log file.
Comment 2 Nima 2012-05-29 07:04:00 UTC
WRT Justin's comment 33 on https://bugs.gentoo.org/show_bug.cgi?id=381163#c32 (as we've now established this bug is not related to that one)

A couple of things I've noticed:

First of all, there is no lib64:

% ls tmp/usr/
bin  include  lib  libexec  man  portage  sbin  share

Secondly, while the following is okay:

% uname -a
Linux devsyd899 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 GNU/Linux

% uname -m
x86_64

This is not going to be helping:

% uname -i
unknown

% uname -p
unknown
Comment 3 Justin Lecher (RETIRED) gentoo-dev 2012-05-29 07:10:01 UTC
okay, then it is unrelated.
Comment 4 Fabian Groffen gentoo-dev 2012-05-29 07:13:32 UTC
do you have a /home/talebi/gentoo/tmp/usr/lib/libbz2.so?

what is the output of
 $ file /home/talebi/gentoo/tmp/usr/lib/libbz2.*
Comment 5 Nima 2012-05-29 23:26:15 UTC
Very good question; and no there is no shared object file for it, only an archive:

% ls -l tmp/usr/lib
total 500
-rw-r--r-- 1 talebi users 248426 2012-05-29 13:22 libbz2.a
-rw-r--r-- 1 talebi users 134978 2012-05-29 14:04 libz.a
lrwxrwxrwx 1 talebi users     13 2012-05-29 14:04 libz.so -> libz.so.1.2.5
lrwxrwxrwx 1 talebi users     13 2012-05-29 14:04 libz.so.1 -> libz.so.1.2.5
-rwxr-xr-x 1 talebi users 109107 2012-05-29 14:04 libz.so.1.2.5
drwxr-xr-x 2 talebi users   4096 2012-05-29 13:22 pkgconfig

...which is a problem.  What provides libbz2.so?
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2012-05-30 06:18:01 UTC
(In reply to comment #5)
> 
> ...which is a problem.  What provides libbz2.so?

app-arch/bzip2 from portage, but it is missing from the bootstrapping step. try to boostrap bzip2 again.
Comment 7 Nima 2012-05-30 06:42:05 UTC
I have tried that too; unfortunately it doesn't resolve the issue:

% ../bin/bootstrap-prefix.sh $EPREFIX/tmp bzip2
* Bootstrapping Gentoo prefixed portage installation using
* host:   x86_64-pc-linux-gnu
* prefix: /home/talebi/gentoo/tmp
* ready to bootstrap bzip2
* Bootstrapping bzip2
* Unpacking bzip2
* Compiling bzip2

If compilation produces errors, or a large number of warnings,
please read README.COMPILATION.PROBLEMS -- you might be able to
adjust the flags in this Makefile to improve matters.

Also in README.COMPILATION.PROBLEMS are some hints that may help
if your build produces an executable which is unable to correctly
handle so-called 'large files' -- files of size 2GB or more.

gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c blocksort.c
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c huffman.c
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c crctable.c
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c randtable.c
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c compress.c
compress.c: In function âBZ2_compressBlockâ:
compress.c:74: warning: inlining failed in call to âbsWâ: call is unlikely and code size would grow
compress.c:519: warning: called from here
compress.c:74: warning: inlining failed in call to âbsWâ: call is unlikely and code size would grow
compress.c:520: warning: called from here
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c decompress.c
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzlib.c
rm -f libbz2.a
ar cq libbz2.a blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o
ranlib libbz2.a
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzip2.c
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64  -o bzip2 bzip2.o -L. -lbz2
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c bzip2recover.c
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64  -o bzip2recover bzip2recover.o

Doing 6 tests (3 compress, 3 uncompress) ...
If there's a problem, things might stop at this point.

./bzip2 -1  < sample1.ref > sample1.rb2
./bzip2 -2  < sample2.ref > sample2.rb2
./bzip2 -3  < sample3.ref > sample3.rb2
./bzip2 -d  < sample1.bz2 > sample1.tst
./bzip2 -d  < sample2.bz2 > sample2.tst
./bzip2 -ds < sample3.bz2 > sample3.tst
cmp sample1.bz2 sample1.rb2
cmp sample2.bz2 sample2.rb2
cmp sample3.bz2 sample3.rb2
cmp sample1.tst sample1.ref
cmp sample2.tst sample2.ref
cmp sample3.tst sample3.ref

If you got this far and the 'cmp's didn't complain, it looks
like you're in business.

To install in /usr/local/bin, /usr/local/lib, /usr/local/man and
/usr/local/include, type

   make install

To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type

   make install PREFIX=/xxx/yyy

If you are (justifiably) paranoid and want to see what 'make install'
is going to do, you can first do

   make -n install                      or
   make -n install PREFIX=/xxx/yyy      respectively.

The -n instructs make to show the commands it would execute, but
not actually execute them.

Instructions for use are in the preformatted manual page, in the file
bzip2.txt.  For more detailed documentation, read the full manual.
It is available in Postscript form (manual.ps), PDF form (manual.pdf),
and HTML form (manual.html).

You can also do "bzip2 --help" to see some helpful information.
"bzip2 -L" displays the software license.

* Installing bzip2
if ( test ! -d /home/talebi/gentoo/tmp/usr/bin ) ; then mkdir -p /home/talebi/gentoo/tmp/usr/bin ; fi
if ( test ! -d /home/talebi/gentoo/tmp/usr/lib ) ; then mkdir -p /home/talebi/gentoo/tmp/usr/lib ; fi
if ( test ! -d /home/talebi/gentoo/tmp/usr/man ) ; then mkdir -p /home/talebi/gentoo/tmp/usr/man ; fi
if ( test ! -d /home/talebi/gentoo/tmp/usr/man/man1 ) ; then mkdir -p /home/talebi/gentoo/tmp/usr/man/man1 ; fi
if ( test ! -d /home/talebi/gentoo/tmp/usr/include ) ; then mkdir -p /home/talebi/gentoo/tmp/usr/include ; fi
cp -f bzip2 /home/talebi/gentoo/tmp/usr/bin/bzip2
cp -f bzip2 /home/talebi/gentoo/tmp/usr/bin/bunzip2
cp -f bzip2 /home/talebi/gentoo/tmp/usr/bin/bzcat
cp -f bzip2recover /home/talebi/gentoo/tmp/usr/bin/bzip2recover
chmod a+x /home/talebi/gentoo/tmp/usr/bin/bzip2
chmod a+x /home/talebi/gentoo/tmp/usr/bin/bunzip2
chmod a+x /home/talebi/gentoo/tmp/usr/bin/bzcat
chmod a+x /home/talebi/gentoo/tmp/usr/bin/bzip2recover
cp -f bzip2.1 /home/talebi/gentoo/tmp/usr/man/man1
chmod a+r /home/talebi/gentoo/tmp/usr/man/man1/bzip2.1
cp -f bzlib.h /home/talebi/gentoo/tmp/usr/include
chmod a+r /home/talebi/gentoo/tmp/usr/include/bzlib.h
cp -f libbz2.a /home/talebi/gentoo/tmp/usr/lib
chmod a+r /home/talebi/gentoo/tmp/usr/lib/libbz2.a
cp -f bzgrep /home/talebi/gentoo/tmp/usr/bin/bzgrep
ln -s -f /home/talebi/gentoo/tmp/usr/bin/bzgrep /home/talebi/gentoo/tmp/usr/bin/bzegrep
ln -s -f /home/talebi/gentoo/tmp/usr/bin/bzgrep /home/talebi/gentoo/tmp/usr/bin/bzfgrep
chmod a+x /home/talebi/gentoo/tmp/usr/bin/bzgrep
cp -f bzmore /home/talebi/gentoo/tmp/usr/bin/bzmore
ln -s -f /home/talebi/gentoo/tmp/usr/bin/bzmore /home/talebi/gentoo/tmp/usr/bin/bzless
chmod a+x /home/talebi/gentoo/tmp/usr/bin/bzmore
cp -f bzdiff /home/talebi/gentoo/tmp/usr/bin/bzdiff
ln -s -f /home/talebi/gentoo/tmp/usr/bin/bzdiff /home/talebi/gentoo/tmp/usr/bin/bzcmp
chmod a+x /home/talebi/gentoo/tmp/usr/bin/bzdiff
cp -f bzgrep.1 bzmore.1 bzdiff.1 /home/talebi/gentoo/tmp/usr/man/man1
chmod a+r /home/talebi/gentoo/tmp/usr/man/man1/bzgrep.1
chmod a+r /home/talebi/gentoo/tmp/usr/man/man1/bzmore.1
chmod a+r /home/talebi/gentoo/tmp/usr/man/man1/bzdiff.1
echo ".so man1/bzgrep.1" > /home/talebi/gentoo/tmp/usr/man/man1/bzegrep.1
echo ".so man1/bzgrep.1" > /home/talebi/gentoo/tmp/usr/man/man1/bzfgrep.1
echo ".so man1/bzmore.1" > /home/talebi/gentoo/tmp/usr/man/man1/bzless.1
echo ".so man1/bzdiff.1" > /home/talebi/gentoo/tmp/usr/man/man1/bzcmp.1
* bzip2 successfully bootstrapped
%
% ls -l tmp/usr/lib
total 500
-rw-r--r-- 1 talebi users 248426 May 30 16:39 libbz2.a
-rw-r--r-- 1 talebi users 134978 May 29 14:04 libz.a
lrwxrwxrwx 1 talebi users     13 May 29 14:04 libz.so -> libz.so.1.2.5
lrwxrwxrwx 1 talebi users     13 May 29 14:04 libz.so.1 -> libz.so.1.2.5
-rwxr-xr-x 1 talebi users 109107 May 29 14:04 libz.so.1.2.5
drwxr-xr-x 2 talebi users   4096 May 29 13:22 pkgconfig
%
Comment 8 Nima 2012-06-01 00:58:30 UTC
Scripted Replication via a Makefile to aid debugging; using this makefile, simply run `make':


export EPREFIX := ${HOME}/gentoo
export PATH    := ${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/tmp/bin:${EPREFIX}/tmp/usr/bin:${PATH}

#export PROXY       := proxy:8080
#export http_proxy  := ${PROXY}
#export https_proxy := ${PROXY}

START   := tree
BINS    := make wget sed tar patch grep gawk bash bzip2 gzip python m4 bison
NONBINS := coreutils findutils zlib
FINISH  := portage

TARGETS := ${START} ${BINS} ${NONBINS} ${FINISH}
.PHONY: ${TARGETS}

all: ${TARGETS}

which = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH)))))

${BINS}:
        @hash -r && echo $(call which,$@)|grep -qE ^${EPREFIX} || bootstrap-prefix.sh ${EPREFIX}/tmp $@

TREE := $(wildcard usr/portage/distfiles/prefix-overlay-*.tar.bz2)
${START} ${FINISH}: % : .made0.%
.made0.%:
        @echo 'Bootstrapping $@...'
        @bootstrap-prefix.sh ${EPREFIX} $(@:.made0.%=%)
        @touch $@

${NONBINS}: % : .made1.%
.made1.%:
        @echo 'Bootstrapping $@...'
        @bootstrap-prefix.sh ${EPREFIX}/tmp $(@:.made1.%=%)
        @touch $@
Comment 9 Fabian Groffen gentoo-dev 2012-06-04 18:32:10 UTC
Nima, sorry for the wait.  Does this help you to bootstrap python?

Index: bootstrap-prefix.sh
===================================================================
--- bootstrap-prefix.sh (revision 60901)
+++ bootstrap-prefix.sh (working copy)
@@ -717,7 +717,7 @@
        # just make sure Python won't find it
        export HOME="${S}"
 
-       export PYTHON_DISABLE_MODULES="_ctypes_test readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _elementtree _locale _sqlite3 bsddb185"
+       export PYTHON_DISABLE_MODULES="_ctypes_test readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _elementtree _locale _sqlite3 bsddb185 bz2"
        export PYTHON_DISABLE_SSL=1
        export OPT="${CFLAGS}"
Comment 10 Nima 2012-06-04 23:32:07 UTC
Hi Fabien!

No problem at all for the wait... I'm trying this out right now as I type; and the verdict is...

Fixed! Thank you :)
Comment 11 Fabian Groffen gentoo-dev 2012-06-05 08:18:54 UTC
Thanks for trying, will commit the fix then!