GNU bug report logs - #28660
[PATCH] gnu: python-numpy: Give sh store location instead of setting $SHELL.

Previous Next

Package: guix-patches;

Reported by: Thomas Danckaert <post <at> thomasdanckaert.be>

Date: Sun, 1 Oct 2017 12:45:01 UTC

Severity: normal

Tags: patch

Done: Thomas Danckaert <post <at> thomasdanckaert.be>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Thomas Danckaert <post <at> thomasdanckaert.be>
Subject: bug#28660: closed (Re: [bug#28660] [PATCH] gnu: python-numpy:
 Give sh store location instead of setting $SHELL.)
Date: Wed, 04 Oct 2017 12:13:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#28660: [PATCH] gnu: python-numpy: Give sh store location instead of setting $SHELL.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 28660 <at> debbugs.gnu.org.

-- 
28660: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28660
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Thomas Danckaert <post <at> thomasdanckaert.be>
To: mail <at> cbaines.net, 28660-done <at> debbugs.gnu.org
Cc: 28660 <at> debbugs.gnu.org
Subject: Re: [bug#28660] [PATCH] gnu: python-numpy: Give sh store location
 instead of setting $SHELL.
Date: Wed, 04 Oct 2017 14:12:27 +0200 (CEST)
From: Christopher Baines <mail <at> cbaines.net>
Subject: Re: [bug#28660] [PATCH] gnu: python-numpy: Give sh store 
location instead of setting $SHELL.
Date: Wed, 4 Oct 2017 08:49:44 +0100

> Sorry Thomas, ignore what I originally said. I thought from reading 
> the
> patch that this was patching numpy to use /bin/sh . Now after 
> building
> it and looking at the resulting files, I can see that it makes the
> default use bash from the store. Which was exactly what I was
> suggesting, but you were already doing that.
>
> With this new, hopefully more correct interpretation, this patch 
> looks
> fine to me :)

Yes, that's the purpose exactly :)  I've slightly reworded the commit 
message & comment to hopefully make it less confusing, and pushed.

Thanks for taking a look!

Thomas

[Message part 3 (message/rfc822, inline)]
From: Thomas Danckaert <post <at> thomasdanckaert.be>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: python-numpy: Give sh store location instead of setting
 $SHELL.
Date: Sun, 01 Oct 2017 14:44:04 +0200 (CEST)
[Message part 4 (text/plain, inline)]
Hi Guix,

I slightly botched the last numpy update: setting $SHELL works, but 
then we have to set $SHELL for every package which uses numpy's 
distutils.  I don't know how many packages there are, but it includes 
scipy and python-hdf (and therefore those builds are currently broken 
on master...).

The attached patch should fix the issue for all packages, by setting 
the default shell to the “/bin/sh” of the build environment's bash 
package (i.e. bash-minimal).

Thomas
[0001-gnu-python-numpy-Give-sh-store-location-instead-of-s.patch (text/x-patch, inline)]
From cfaebf1b09c71585b5513629005e7cf3c5d17508 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert <at> gmail.com>
Date: Sun, 1 Oct 2017 14:32:04 +0200
Subject: [PATCH] gnu: python-numpy: Give sh store location instead of setting
 $SHELL.

* gnu/packages/python.scm (python-numpy): [arguments] Don't set $SHELL in the
  environment, but embed the location of bash as a default shell.  Otherwise,
  we have to set $SHELL for every package which uses numpy's distutils.
---
 gnu/packages/python.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index e95c22de1..267715b0f 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -3742,8 +3742,6 @@ between language specification and implementation aspects.")
        (modify-phases %standard-phases
         (add-before 'build 'set-environment-variables
          (lambda* (#:key inputs #:allow-other-keys)
-           ;; numpy's distutils uses $SHELL to run external commands.
-          (setenv "SHELL" "bash")
           (call-with-output-file "site.cfg"
             (lambda (port)
               (format port
@@ -3762,6 +3760,10 @@ include_dirs = ~a/include
                       (assoc-ref inputs "openblas")
                       (assoc-ref inputs "lapack")
                       (assoc-ref inputs "lapack"))))
+          ;; Insert bash store location for default shell /bin/sh.
+          (substitute* "numpy/distutils/exec_command.py"
+            (("(os.environ.get\\('SHELL', ')(/bin/sh'\\))" match match-start match-end)
+            (string-append match-start (assoc-ref inputs "bash") match-end)))
           ;; Use "gcc" executable, not "cc".
           (substitute* "numpy/distutils/system_info.py"
             (("c = distutils\\.ccompiler\\.new_compiler\\(\\)")
-- 
2.14.1


This bug report was last modified 7 years and 225 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.