diff mbox series

[bug#48014] gnu: global: fix globash

Message ID YIU/qVJk9Qhzq9NB@thinkpad-x230-luhui
State Accepted
Headers show
Series [bug#48014] gnu: global: fix globash | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

luhui April 25, 2021, 10:08 a.m. UTC
From 2ec3b22edadb1db21a006d39f9998fd552d9110d Mon Sep 17 00:00:00 2001
From: luhui <luhuins@163.com>
Date: Sun, 25 Apr 2021 16:49:05 +0800
Subject: [PATCH] gnu: global: fix globash

* gnu/packages/code.scm (global)[#phases]: Add 'fix-globash'.
---
 gnu/packages/code.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Efraim Flashner April 28, 2021, 9:26 a.m. UTC | #1
It turns out that coreutils is already an implicit input in the build
environment so I removed it from the inputs.o

(ins)efraim@3900XT ~/workspace/guix$ grep '/bin/echo' /gnu/store/q0bvlalzwm1iwdqgmyksxxcm06fhr1l2-global-6.6.5/bin/globash
# Use /gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/bin/echo, because in some systems, built-in echo of /bin/sh
ECHO='/gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/bin/echo'

Thanks! Patch pushed.
M April 28, 2021, 11:32 a.m. UTC | #2
Efraim Flashner schreef op wo 28-04-2021 om 12:26 [+0300]:
> It turns out that coreutils is already an implicit input in the build
> environment so I removed it from the inputs.

coreutils is an implicit native inputs, but is it also an implicit input?
If the latter does not hold, coreutils should still be present when cross-compiling.

On my x86-64-linux-gnu system:
$ guix pull
$ guix build --target=aarch64-linux-gnu globash
> [...]
> phase `unpack' succeeded after 0.1 seconds
> starting phase `fix-globash'
> Backtrace:
> [...]
> In unknown file:
>            1 (string-append #f "/bin/echo")
> In ice-9/boot-9.scm:
>   1669:16  0 (raise-exception _ #:continuable? _)
>
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> In procedure string-append: Wrong type (expecting string): #f
> builder for `/gnu/store/k42zib6sbrfk0w4al6lxl2z32fky0dcr-global-6.6.5.drv' failed with exit code 1
> build of /gnu/store/k42zib6sbrfk0w4al6lxl2z32fky0dcr-global-6.6.5.drv failed
> View build log at '/var/log/guix/drvs/k4/2zib6sbrfk0w4al6lxl2z32fky0dcr-global-6.6.5.drv.bz2'.
> guix build: error: build of `/gnu/store/k42zib6sbrfk0w4al6lxl2z32fky0dcr-global-6.6.5.drv' failed

So it seems coreutils should be present in inputs after all.
Could you re-add coreutils to 'inputs'?

Greetings,
Maxime.
Efraim Flashner April 28, 2021, 11:38 a.m. UTC | #3
On Wed, Apr 28, 2021 at 01:32:20PM +0200, Maxime Devos wrote:
> Efraim Flashner schreef op wo 28-04-2021 om 12:26 [+0300]:
> > It turns out that coreutils is already an implicit input in the build
> > environment so I removed it from the inputs.
> 
> coreutils is an implicit native inputs, but is it also an implicit input?
> If the latter does not hold, coreutils should still be present when cross-compiling.
> On my x86-64-linux-gnu system:
> $ guix pull
> $ guix build --target=aarch64-linux-gnu globash
> > [...]
> > phase `unpack' succeeded after 0.1 seconds
> > starting phase `fix-globash'
> > Backtrace:
> > [...]
> > In unknown file:
> >            1 (string-append #f "/bin/echo")
> > In ice-9/boot-9.scm:
> >   1669:16  0 (raise-exception _ #:continuable? _)
> >
> > ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> > In procedure string-append: Wrong type (expecting string): #f
> > builder for `/gnu/store/k42zib6sbrfk0w4al6lxl2z32fky0dcr-global-6.6.5.drv' failed with exit code 1
> > build of /gnu/store/k42zib6sbrfk0w4al6lxl2z32fky0dcr-global-6.6.5.drv failed
> > View build log at '/var/log/guix/drvs/k4/2zib6sbrfk0w4al6lxl2z32fky0dcr-global-6.6.5.drv.bz2'.
> > guix build: error: build of `/gnu/store/k42zib6sbrfk0w4al6lxl2z32fky0dcr-global-6.6.5.drv' failed
> 
> So it seems coreutils should be present in inputs after all.
> Could you re-add coreutils to 'inputs'?
> 

Indeed. I should've checked.
diff mbox series

Patch

diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
index a79d8b4a2b..342ded76ff 100644
--- a/gnu/packages/code.scm
+++ b/gnu/packages/code.scm
@@ -15,6 +15,7 @@ 
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2021 lu hui <luhuins@163.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -135,7 +136,8 @@  highlighting your own code that seemed comprehensible when you wrote it.")
               (base32
                "10vvsgx8v54whb4j9mk5qqyb5h3rdd9da0il3wir8pcpksyk0dww"))))
     (build-system gnu-build-system)
-    (inputs `(("ncurses" ,ncurses)
+    (inputs `(("coreutils" ,coreutils)
+              ("ncurses" ,ncurses)
               ("libltdl" ,libltdl)
               ("sqlite" ,sqlite)
               ("python-wrapper" ,python-wrapper)))
@@ -149,6 +151,13 @@  highlighting your own code that seemed comprehensible when you wrote it.")
 
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'fix-globash
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((echo (string-append
+                           (assoc-ref inputs "coreutils") "/bin/echo")))
+               (substitute* "globash/globash.in"
+                 (("/bin/echo")
+                  echo)))))
         (add-after 'install 'post-install
           (lambda* (#:key outputs #:allow-other-keys)
             ;; Install the plugin files in the right place.