From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: 'python-build-system' Date: Sun, 07 Apr 2013 12:34:15 +0200 Message-ID: <87hajiwrx4.fsf@gnu.org> References: <87sj34zvn1.fsf@karetnikov.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOmvh-0007V4-9Y for bug-guix@gnu.org; Sun, 07 Apr 2013 06:34:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOmva-000847-Dy for bug-guix@gnu.org; Sun, 07 Apr 2013 06:34:33 -0400 Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=40537 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOmva-0007yU-3x for bug-guix@gnu.org; Sun, 07 Apr 2013 06:34:26 -0400 In-Reply-To: <87sj34zvn1.fsf@karetnikov.org> (Nikita Karetnikov's message of "Fri, 05 Apr 2013 22:21:06 +0400") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: bug-guix@gnu.org Nikita Karetnikov skribis: > The main problem is that 'set-path-environment-variable' doesn't seem > to work. Could you be more precise? :-) At the beginning of the build log, there should be a line saying =E2=80=98PYTHONPATH set to ...=E2=80=99. What does= this say? > I used Bazaar (don't forget to apply this patch [1] first) to test the > build system: So you did build it successfully, right? > # /nix/var/nix/profiles/per-user/root/guix-profile/bin/bzr --help > bzr: warning: unsupported locale setting > bzr could not set the application locale. > Although this should be no problem for bzr itself, it might > cause problems with some plugins. To investigate the issue, > look at the output of the locale(1p) tool. > bzr: ERROR: Couldn't import bzrlib and dependencies. > Please check the directory containing bzrlib is on your PYTHONPATH. The =E2=80=98bzr=E2=80=99 binary should be wrapped (with =E2=80=98wrap-prog= ram=E2=80=99) in a wrapper that sets PYTHONPATH to point to $out/lib/python2.7/site-packages (which you did manually.) I think it=E2=80=99s something that should be done automatically by =E2=80=98python-build-system=E2=80=99. That is, after the =E2=80=98install= =E2=80=99 phase, it should traverse all the binaries in $out/{bin,sbin} and wrap them. The wrappers should set PYTHONPATH to $out/lib/python2.7/site-packages:$PYTHONPATH, where $PYTHONPATH is the build-time $PYTHONPATH. > More questions: > > 1. How can I get the version of Python in 'python-build-system.scm'? > (I hardcoded it for now.) In python.scm (the host-side module), you can do (package-version python) You could pass that to the builder, say via #:python-version, so python-build-system.scm can use it. But note that in general the interesting bit is =E2=80=9C2.7=E2=80=9D, not = =E2=80=9C2.7.1=E2=80=9D. > 2. Can I remove the 'strip' phase? Is it useful for Python packages? There could be .so files, so you can leave it (it doesn=E2=80=99t hurt anyw= ay.) > There is a problem with Bazaar too. Actually, it's a 'gnutls' problem. > I packaged Bazaar 2.3.1 because I can't get the hashes of the latest > versions. For example: > > # ./pre-inst-env guix download https://launchpad.net/bzr/2.5/2.5.1/+downl= oad/bzr-2.5.1.tar.gz > > [...] > > ERROR: missing interface for module (gnutls) That=E2=80=99s because GnuTLS is not available on your system. You must in= stall it if you want to be able to use =E2=80=98guix download=E2=80=99 with https. Fortunately, you just have to type =E2=80=98guix package -i gnutls=E2=80=99= . :-) > (define* (python-build #:key inputs (phases %standard-phases) > #:allow-other-keys #:rest args) > "Build the given Python package, applying all of PHASES in order." > (set-path-environment-variable "PYTHONPATH" > '("lib/python2.7/site-packages") > (match inputs > (((_ . location) ...) > location))) > > (apply gnu:gnu-build #:inputs inputs #:phases phases args)) In =E2=80=98core-updates=E2=80=99 there=E2=80=99s a better mechanism for se= arch paths. You can do the above in =E2=80=98master=E2=80=99, but for =E2=80=98core-updates=E2= =80=99 please see in commit a18eda2747fa2eb962e3288066d2b1a679589ed3 how =E2=80=98perl-build-system=E2= =80=99 handles its search path. Other than that, looks great! Thanks, Ludo=E2=80=99.