From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David De La Harpe Golden Newsgroups: gmane.emacs.devel Subject: Re: 'bzr init-repo .' crashes for lack of module bz2. Help, please! Date: Thu, 31 Dec 2009 17:04:41 +0000 Message-ID: <4B3CD9A9.9030705@harpegolden.net> References: <20091228170401.GA4553@muc.de> <4B3939AB.7070501@harpegolden.net> <20091229200832.GA5097@muc.de> <20091229205734.GB5097@muc.de> <4B3A957B.9050106@harpegolden.net> <20091231120648.GA2801@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1262279288 23446 80.91.229.12 (31 Dec 2009 17:08:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Dec 2009 17:08:08 +0000 (UTC) Cc: Andreas Schwab , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 31 18:08:01 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NQOVE-0003tt-Ae for ged-emacs-devel@m.gmane.org; Thu, 31 Dec 2009 18:08:00 +0100 Original-Received: from localhost ([127.0.0.1]:57614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQOVD-0006TT-LV for ged-emacs-devel@m.gmane.org; Thu, 31 Dec 2009 12:07:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NQOSC-0004pe-1k for emacs-devel@gnu.org; Thu, 31 Dec 2009 12:04:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NQOS6-0004lY-Er for emacs-devel@gnu.org; Thu, 31 Dec 2009 12:04:51 -0500 Original-Received: from [199.232.76.173] (port=36482 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQOS6-0004lD-0Z for emacs-devel@gnu.org; Thu, 31 Dec 2009 12:04:46 -0500 Original-Received: from harpegolden.net ([65.99.215.13]:46781) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NQOS6-0000vR-Az for emacs-devel@gnu.org; Thu, 31 Dec 2009 12:04:46 -0500 Original-Received: from [87.198.54.207] (87-198-54-207.ptr.magnet.ie [87.198.54.207]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 3" (verified OK)) by harpegolden.net (Postfix) with ESMTP id DBC688439; Thu, 31 Dec 2009 17:04:43 +0000 (GMT) User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) In-Reply-To: <20091231120648.GA2801@muc.de> X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:119159 Archived-At: Alan Mackenzie wrote: > Hi, David, > > On Tue, Dec 29, 2009 at 11:49:15PM +0000, David De La Harpe Golden wrote: >> Alan Mackenzie wrote: >>> On Tue, Dec 29, 2009 at 09:19:06PM +0100, Andreas Schwab wrote: >>>> Alan Mackenzie writes: > >>>>> The sole "necessary bit" for bz2 appears to be bz2module.c, which >>>>> exists in the Python source tree. It appears not to have been >>>>> compiled (there is no bz2module.o). There is nothing else helpful >>>>> in the build procedure's stdout or stderr. Any ideas? > >>>> Most likely you lack bzip2. > >>> No, I have bzip2 (used it this morning on the Python tarball), >>> including, in particular, /usr/lib/libbz2.so.1.0.2 (with an >>> appropriate symlink with a truncated name). > >> Just in case: and the relevant bz2 header /usr/include/bzlib.h ? >> Would probably be in package libbz2-dev in debian. > > I was lacking this file, so I downloaded and built the latest version of > bzip2. And rebuild python against this version, right, with "bz2" absent from the list of modules that failed to build this time due to failure to "find the necessary bits"? Does the "python" to get a python repl then "import bz2" test succeed now? Maybe there's a way to turn on more verbosity during python building. I can see the relevant bundled extension module building during python "make" output as follows: ... building 'bz2' extension gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I/usr/local/src/Python-2.6.4/./Include -I. -IInclude -I./Include -I/usr/local/include -I/usr/local/src/Python-2.6.4/Include -I/usr/local/src/Python-2.6.4 -c /usr/local/src/Python-2.6.4/Modules/bz2module.c -o build/temp.linux-x86_64-2.6/usr/local/src/Python-2.6.4/Modules/bz2module.o gcc -pthread -shared build/temp.linux-x86_64-2.6/usr/local/src/Python-2.6.4/Modules/bz2module.o -L/usr/local/lib -lbz2 -o build/lib.linux-x86_64-2.6/bz2.so building 'pyexpat' extension ... > I still get the same error message, which I don't understand, > namely: > > bzr: ERROR: exceptions.ImportError: failed to load bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a: No module named bz2 > > Presumably "bzrlib.repofmt.groupcompress_repo" means the file > .../bzrlib/repofmt/groupcompress_repo.py, but what, exactly, is a "module > named bz2"? In this case, it means a python extension "module" being a python binding to libbz2 (*). Such extensions are atypical python modules implemented as C libs rather than python. The C code uses the python C implementation's ("cpython") C API to act like a python module to python code running under that implementation, providing additional python-callable functions and python-usable data types. It's actually a pretty typical way of extending scripting languages implemented in C, though python has now also introduced the more Lisp-conventional "FFI" approach for such things in module "ctypes" (just mentioning for completeness). http://docs.python.org/extending/index.html http://docs.python.org/library/ctypes.html (*) bzr is presumably using bzip2 compression internally. > What is its filename, where is bzr (or Python?) looking for > it? > python is looking for it, in the python module search path probably, since it's not finding the extension module bz2. But it's IMO pretty definitely the normal python-bundled extension module bz2 you need. On a successful python installation, it'll probably be somewhere like /usr/local/lib/python2.6/lib-dynload/bz2.so