GNU bug report logs - #27628
Fix compilation features of GCL and Maxima

Previous Next

Package: guix-patches;

Reported by: Kei Kebreau <kei <at> openmailbox.org>

Date: Sun, 9 Jul 2017 01:14:01 UTC

Severity: normal

Done: Kei Kebreau <kei <at> openmailbox.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27628 in the body.
You can then email your comments to 27628 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Sun, 09 Jul 2017 01:14:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kei Kebreau <kei <at> openmailbox.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 09 Jul 2017 01:14:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: guix-patches <at> gnu.org
Subject: Fix compilation features of GCL and Maxima
Date: Sat, 08 Jul 2017 21:12:26 -0400
[Message part 1 (text/plain, inline)]
These patches are the best solution I've come upon so far to enable GCL
and Maxima to compile functions. The current issue is that GCL (and, by
proxy, Maxima) requires GCC to compile functions, but GCC and binutils
are not available to GCL at runtime. This issue in GCL causes issues in
Maxima (e.g. the graphing package "draw" does not function).
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Sun, 09 Jul 2017 01:18:02 GMT) Full text and rfc822 format available.

Message #8 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: 27628 <at> debbugs.gnu.org
Cc: Kei Kebreau <kei <at> openmailbox.org>
Subject: [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are available at
 runtime.
Date: Sat,  8 Jul 2017 21:16:32 -0400
* gnu/packages/lisp.scm (gcl)[arguments]: Add -fgnu89-inline to CFLAGS.
Add GCC path to make-flags. Modify 'pre-conf' phase. Add 'wrap' phase.
---
 gnu/packages/lisp.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index e92ae2ebf..6bd9e94a7 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -88,6 +88,10 @@
      `(#:parallel-build? #f  ; The build system seems not to be thread safe.
        #:tests? #f  ; There does not seem to be make check or anything similar.
        #:configure-flags '("--enable-ansi") ; required for use by the maxima package
+       #:make-flags (list
+                     "CFLAGS=-fgnu89-inline" ; removes inline function warnings
+                     (string-append "GCC=" (assoc-ref %build-inputs "gcc")
+                                    "/bin/gcc"))
        #:phases (modify-phases %standard-phases
                   (add-before 'configure 'pre-conf
                     (lambda _
@@ -104,6 +108,24 @@
                          (string-append "SHELL=" (which "bash")))
                         (("SHELL=/bin/sh")
                          (string-append "SHELL=" (which "sh"))))
+                      (substitute* "h/linux.defs"
+                        (("#CC") "CC")
+                        (("-fwritable-strings") "")
+                        (("-Werror") ""))
+                      #t))
+                  (add-after 'install 'wrap
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let* ((gcl (assoc-ref outputs "out"))
+                             (input-path (lambda (lib path)
+                                           (string-append
+                                            (assoc-ref inputs lib) path)))
+                             (binaries  '("gcc" "ld-wrapper" "binutils")))
+
+                        (wrap-program (string-append gcl "/bin/gcl")
+                          `("PATH" prefix
+                            ,(map (lambda (binary)
+                                    (input-path binary "/bin"))
+                                  binaries))))
                       #t))
                   ;; drop strip phase to make maxima build, see
                   ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
-- 
2.13.2





Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Sun, 09 Jul 2017 01:18:02 GMT) Full text and rfc822 format available.

Message #11 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: 27628 <at> debbugs.gnu.org
Cc: Kei Kebreau <kei <at> openmailbox.org>
Subject: [PATCH 2/3] Revert "gnu: maxima: Ensure gcc is available at runtime."
Date: Sat,  8 Jul 2017 21:16:33 -0400
This reverts commit f2fa86cc82b5941bde63b666337eea59aa609e55.
---
 gnu/packages/maths.scm | 71 ++++++++++++++++++++++----------------------------
 1 file changed, 31 insertions(+), 40 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 1bf049fc4..0b738e6a2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2075,8 +2075,7 @@ to BMP, JPEG or PNG image formats.")
        (patches (search-patches "maxima-defsystem-mkdir.patch"))))
     (build-system gnu-build-system)
     (inputs
-     `(("gcc" ,gcc)
-       ("gcl" ,gcl)
+     `(("gcl" ,gcl)
        ("gnuplot" ,gnuplot)                       ;for plots
        ("tk" ,tk)))                               ;Tcl/Tk is used by 'xmaxima'
     (native-inputs
@@ -2098,44 +2097,36 @@ to BMP, JPEG or PNG image formats.")
        ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
        ;; Work around that.
        #:make-flags (list "TMPDIR=/tmp")
-       #:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'set-gcc-path
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "lisp-utils/defsystem.lisp"
-               (("\\(defparameter \\*c-compiler\\* \"gcc\"\\)")
-                (string-append "(defparameter *c-compiler* \""
-                               (assoc-ref inputs "gcc") "/bin/gcc\")")))
-             #t))
-         (add-before 'check 'pre-check
-           (lambda _
-             (chmod "src/maxima" #o555)
-             #t))
-         ;; Make sure the doc and emacs files are found in the
-         ;; standard location.  Also configure maxima to find gnuplot
-         ;; without having it on the PATH.
-         (add-after 'install 'post-install
-           (lambda* (#:key outputs inputs #:allow-other-keys)
-             (let* ((gnuplot (assoc-ref inputs "gnuplot"))
-                    (out (assoc-ref outputs "out"))
-                    (datadir (string-append out "/share/maxima/" ,version)))
-               (with-directory-excursion out
-                 (mkdir-p "share/emacs")
-                 (mkdir-p "share/doc")
-                 (symlink
-                  (string-append datadir "/emacs/")
-                  (string-append out "/share/emacs/site-lisp"))
-                 (symlink
-                  (string-append datadir "/doc/")
-                  (string-append out "/share/doc/maxima"))
-                 (with-atomic-file-replacement
-                  (string-append datadir "/share/maxima-init.lisp")
-                  (lambda (in out)
-                    (format out "~a ~s~a~%"
-                            "(setf $gnuplot_command "
-                            (string-append gnuplot "/bin/gnuplot") ")")
-                    (dump-port in out)))))
-             #t)))))
+       #:phases (alist-cons-before
+                 'check 'pre-check
+                 (lambda _
+                   (chmod "src/maxima" #o555))
+                 ;; Make sure the doc and emacs files are found in the
+                 ;; standard location.  Also configure maxima to find gnuplot
+                 ;; without having it on the PATH.
+                 (alist-cons-after
+                  'install 'post-install
+                  (lambda* (#:key outputs inputs #:allow-other-keys)
+                    (let* ((gnuplot (assoc-ref inputs "gnuplot"))
+                          (out (assoc-ref outputs "out"))
+                          (datadir (string-append out "/share/maxima/" ,version)))
+                      (with-directory-excursion out
+                        (mkdir-p "share/emacs")
+                        (mkdir-p "share/doc")
+                        (symlink
+                         (string-append datadir "/emacs/")
+                         (string-append out "/share/emacs/site-lisp"))
+                        (symlink
+                         (string-append datadir "/doc/")
+                         (string-append out "/share/doc/maxima"))
+                        (with-atomic-file-replacement
+                         (string-append datadir "/share/maxima-init.lisp")
+                         (lambda (in out)
+                           (format out "~a ~s~a~%"
+                                   "(setf $gnuplot_command "
+                                   (string-append gnuplot "/bin/gnuplot") ")")
+                           (dump-port in out))))))
+                  %standard-phases))))
     (home-page "http://maxima.sourceforge.net")
     (synopsis "Numeric and symbolic expression manipulation")
     (description "Maxima is a system for the manipulation of symbolic and
-- 
2.13.2





Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Sun, 09 Jul 2017 01:18:03 GMT) Full text and rfc822 format available.

Message #14 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: 27628 <at> debbugs.gnu.org
Cc: Kei Kebreau <kei <at> openmailbox.org>
Subject: [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
Date: Sat,  8 Jul 2017 21:16:34 -0400
* gnu/packages/maths.scm (maxima)[arguments]: Use modify-phases syntax.
Modify 'post-install' phase.
---
 gnu/packages/maths.scm | 72 +++++++++++++++++++++++++++++---------------------
 1 file changed, 42 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 0b738e6a2..cfc4cafd2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2097,36 +2097,48 @@ to BMP, JPEG or PNG image formats.")
        ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
        ;; Work around that.
        #:make-flags (list "TMPDIR=/tmp")
-       #:phases (alist-cons-before
-                 'check 'pre-check
-                 (lambda _
-                   (chmod "src/maxima" #o555))
-                 ;; Make sure the doc and emacs files are found in the
-                 ;; standard location.  Also configure maxima to find gnuplot
-                 ;; without having it on the PATH.
-                 (alist-cons-after
-                  'install 'post-install
-                  (lambda* (#:key outputs inputs #:allow-other-keys)
-                    (let* ((gnuplot (assoc-ref inputs "gnuplot"))
-                          (out (assoc-ref outputs "out"))
-                          (datadir (string-append out "/share/maxima/" ,version)))
-                      (with-directory-excursion out
-                        (mkdir-p "share/emacs")
-                        (mkdir-p "share/doc")
-                        (symlink
-                         (string-append datadir "/emacs/")
-                         (string-append out "/share/emacs/site-lisp"))
-                        (symlink
-                         (string-append datadir "/doc/")
-                         (string-append out "/share/doc/maxima"))
-                        (with-atomic-file-replacement
-                         (string-append datadir "/share/maxima-init.lisp")
-                         (lambda (in out)
-                           (format out "~a ~s~a~%"
-                                   "(setf $gnuplot_command "
-                                   (string-append gnuplot "/bin/gnuplot") ")")
-                           (dump-port in out))))))
-                  %standard-phases))))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'pre-check
+           (lambda _
+             (chmod "src/maxima" #o555)
+             #t))
+         ;; Make sure the doc and emacs files are found in the
+         ;; standard location.  Also configure maxima to find gnuplot
+         ;; without having it on the PATH.
+         (add-after 'install 'post-install
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let* ((gnuplot (assoc-ref inputs "gnuplot"))
+                    (out (assoc-ref outputs "out"))
+                    (datadir (string-append out "/share/maxima/" ,version))
+                    (input-path (lambda (lib path)
+                                  (string-append
+                                   (assoc-ref inputs lib) path)))
+                    (binaries '("gcc" "ld-wrapper" "binutils")))
+               (with-directory-excursion out
+                 (mkdir-p "share/emacs")
+                 (mkdir-p "share/doc")
+                 (symlink
+                  (string-append datadir "/emacs/")
+                  (string-append out "/share/emacs/site-lisp"))
+                 (symlink
+                  (string-append datadir "/doc/")
+                  (string-append out "/share/doc/maxima"))
+                 (with-atomic-file-replacement
+                  (string-append datadir "/share/maxima-init.lisp")
+                  (lambda (in out)
+                    (format out "~a ~s~a~%"
+                            "(setf $gnuplot_command "
+                            (string-append gnuplot "/bin/gnuplot") ")")
+                    (dump-port in out))))
+               ;; Ensure that Maxima will have access to GCC and its required
+               ;; components at runtime.
+               (wrap-program (string-append out "/bin/maxima")
+                 `("PATH" prefix
+                   ,(map (lambda (binary)
+                           (input-path binary "/bin"))
+                         binaries))))
+             #t)))))
     (home-page "http://maxima.sourceforge.net")
     (synopsis "Numeric and symbolic expression manipulation")
     (description "Maxima is a system for the manipulation of symbolic and
-- 
2.13.2





Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Wed, 12 Jul 2017 12:05:01 GMT) Full text and rfc822 format available.

Message #17 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are
 available at runtime.
Date: Wed, 12 Jul 2017 14:04:35 +0200
Kei Kebreau <kei <at> openmailbox.org> skribis:

> * gnu/packages/lisp.scm (gcl)[arguments]: Add -fgnu89-inline to CFLAGS.
> Add GCC path to make-flags. Modify 'pre-conf' phase. Add 'wrap' phase.
> ---
>  gnu/packages/lisp.scm | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
> index e92ae2ebf..6bd9e94a7 100644
> --- a/gnu/packages/lisp.scm
> +++ b/gnu/packages/lisp.scm
> @@ -88,6 +88,10 @@
>       `(#:parallel-build? #f  ; The build system seems not to be thread safe.
>         #:tests? #f  ; There does not seem to be make check or anything similar.
>         #:configure-flags '("--enable-ansi") ; required for use by the maxima package
> +       #:make-flags (list
> +                     "CFLAGS=-fgnu89-inline" ; removes inline function warnings
> +                     (string-append "GCC=" (assoc-ref %build-inputs "gcc")
> +                                    "/bin/gcc"))
>         #:phases (modify-phases %standard-phases
>                    (add-before 'configure 'pre-conf
>                      (lambda _
> @@ -104,6 +108,24 @@
>                           (string-append "SHELL=" (which "bash")))
>                          (("SHELL=/bin/sh")
>                           (string-append "SHELL=" (which "sh"))))
> +                      (substitute* "h/linux.defs"
> +                        (("#CC") "CC")
> +                        (("-fwritable-strings") "")
> +                        (("-Werror") ""))
> +                      #t))
> +                  (add-after 'install 'wrap
> +                    (lambda* (#:key inputs outputs #:allow-other-keys)
> +                      (let* ((gcl (assoc-ref outputs "out"))
> +                             (input-path (lambda (lib path)
> +                                           (string-append
> +                                            (assoc-ref inputs lib) path)))
> +                             (binaries  '("gcc" "ld-wrapper" "binutils")))
> +
> +                        (wrap-program (string-append gcl "/bin/gcl")
> +                          `("PATH" prefix
> +                            ,(map (lambda (binary)
> +                                    (input-path binary "/bin"))
> +                                  binaries))))

Please add comments explaining why GCC and Binutils need to be available
at run time (and also libc and ld-wrapper?).  In the absence of an
explanation, my natural reaction would be to think this is a bug.  :-)

OK with this change, thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Wed, 12 Jul 2017 12:06:02 GMT) Full text and rfc822 format available.

Message #20 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 2/3] Revert "gnu: maxima: Ensure gcc is
 available at runtime."
Date: Wed, 12 Jul 2017 14:05:16 +0200
Kei Kebreau <kei <at> openmailbox.org> skribis:

> This reverts commit f2fa86cc82b5941bde63b666337eea59aa609e55.

Please briefly explain why in the commit log (I assume that’s because
this is now done at the gcl level, right?).

OK with this change.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Wed, 12 Jul 2017 12:07:01 GMT) Full text and rfc822 format available.

Message #23 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils
 available at runtime.
Date: Wed, 12 Jul 2017 14:06:17 +0200
Kei Kebreau <kei <at> openmailbox.org> skribis:

> * gnu/packages/maths.scm (maxima)[arguments]: Use modify-phases syntax.
> Modify 'post-install' phase.

[...]

> +               ;; Ensure that Maxima will have access to GCC and its required
> +               ;; components at runtime.

Please explain why it’s necessary, and why the fact that gcl does the
same is insufficient.

Otherwise LGTM, thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Wed, 12 Jul 2017 12:08:01 GMT) Full text and rfc822 format available.

Message #26 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils
 available at runtime.
Date: Wed, 12 Jul 2017 14:07:15 +0200
Kei Kebreau <kei <at> openmailbox.org> skribis:

> +               ;; Ensure that Maxima will have access to GCC and its required
> +               ;; components at runtime.

In fact, if it’s an optional feature, it would be better to take GCC &
co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
change.)

Thoughts?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Thu, 13 Jul 2017 01:02:02 GMT) Full text and rfc822 format available.

Message #29 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils
 available at runtime.
Date: Wed, 12 Jul 2017 19:31:31 -0400
[Message part 1 (text/plain, inline)]
ludo <at> gnu.org (Ludovic Courtès) writes:

> Kei Kebreau <kei <at> openmailbox.org> skribis:
>
>> +               ;; Ensure that Maxima will have access to GCC and its required
>> +               ;; components at runtime.
>
> In fact, if it’s an optional feature, it would be better to take GCC &
> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
> change.)
>
> Thoughts?
>

I started on this patchset because Guix's Maxima cannot graph functions.
This feature relies on GCL's 'compile' function. The 'compile' function
seems to be a Common Lisp standard since at least the publication of the
CLtL2 standard. Maxima assumes (correctly) that this function is present
and relies on it for various base functionalities (compiling Maxima math
functions to compiled Lisp functions, graphing, etc.).

I turns out that fixing the underlying issue with GCL removes the need
for GCC's presence at runtime, but binutils is still necessary due to
Maxima using the 'compile' function from GCL directly. This stems from
the GCC package not finding the binutils at runtime, i.e.

    guix environment --pure --ad-hoc gcc -- gcc hello-world.c

returns

    gcc: error trying to exec 'as': execvp: No such file or directory

but

    guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c

compiles hello-world.c to its assembly language equivalent. Whether or
not this is intended is unclear to me. FWIW, if the GCC package itself
has access to the binutils at runtime, wrapping GCL and Maxima is unnecessary.

> Ludo’.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Mon, 17 Jul 2017 08:20:02 GMT) Full text and rfc822 format available.

Message #32 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils
 available at runtime.
Date: Mon, 17 Jul 2017 10:19:34 +0200
Hi Kei,

Kei Kebreau <kei <at> openmailbox.org> skribis:

> ludo <at> gnu.org (Ludovic Courtès) writes:
>
>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>
>>> +               ;; Ensure that Maxima will have access to GCC and its required
>>> +               ;; components at runtime.
>>
>> In fact, if it’s an optional feature, it would be better to take GCC &
>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>> change.)
>>
>> Thoughts?
>>
>
> I started on this patchset because Guix's Maxima cannot graph functions.
> This feature relies on GCL's 'compile' function. The 'compile' function
> seems to be a Common Lisp standard since at least the publication of the
> CLtL2 standard. Maxima assumes (correctly) that this function is present
> and relies on it for various base functionalities (compiling Maxima math
> functions to compiled Lisp functions, graphing, etc.).

Good point, ‘compile’ is standard CL.

So yes, that alone is probably a good reason to keep references to GCC
and Binutils (maybe add a comment explaining this.)  Sorry for holding
it back!

> I turns out that fixing the underlying issue with GCL removes the need
> for GCC's presence at runtime, but binutils is still necessary due to
> Maxima using the 'compile' function from GCL directly. This stems from
> the GCC package not finding the binutils at runtime, i.e.
>
>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>
> returns
>
>     gcc: error trying to exec 'as': execvp: No such file or directory
>
> but
>
>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c

You would need ‘gcc-toolchain’ rather than ‘gcc’ here.

Thank you,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Tue, 18 Jul 2017 14:13:01 GMT) Full text and rfc822 format available.

Message #35 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils
 available at runtime.
Date: Tue, 18 Jul 2017 10:11:00 -0400
[Message part 1 (text/plain, inline)]
ludo <at> gnu.org (Ludovic Courtès) writes:

> Hi Kei,
>
> Kei Kebreau <kei <at> openmailbox.org> skribis:
>
>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>
>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>
>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>> +               ;; components at runtime.
>>>
>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>> change.)
>>>
>>> Thoughts?
>>>
>>
>> I started on this patchset because Guix's Maxima cannot graph functions.
>> This feature relies on GCL's 'compile' function. The 'compile' function
>> seems to be a Common Lisp standard since at least the publication of the
>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>> and relies on it for various base functionalities (compiling Maxima math
>> functions to compiled Lisp functions, graphing, etc.).
>
> Good point, ‘compile’ is standard CL.
>
> So yes, that alone is probably a good reason to keep references to GCC
> and Binutils (maybe add a comment explaining this.)  Sorry for holding
> it back!
>
>> I turns out that fixing the underlying issue with GCL removes the need
>> for GCC's presence at runtime, but binutils is still necessary due to
>> Maxima using the 'compile' function from GCL directly. This stems from
>> the GCC package not finding the binutils at runtime, i.e.
>>
>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>
>> returns
>>
>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>
>> but
>>
>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>
> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>
> Thank you,
> Ludo’.

Is gcc-toolchain a package one can use as an input? lisp.scm fails to
load properly when I use the commencement.scm module. Could this be due
to the circular dependency problem mentioned in the "Commentary" section
of commencement.scm?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Tue, 18 Jul 2017 14:54:02 GMT) Full text and rfc822 format available.

Message #38 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils
 available at runtime.
Date: Tue, 18 Jul 2017 16:53:11 +0200
Kei Kebreau <kei <at> openmailbox.org> skribis:

> ludo <at> gnu.org (Ludovic Courtès) writes:
>
>> Hi Kei,
>>
>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>
>>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>>
>>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>>
>>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>>> +               ;; components at runtime.
>>>>
>>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>>> change.)
>>>>
>>>> Thoughts?
>>>>
>>>
>>> I started on this patchset because Guix's Maxima cannot graph functions.
>>> This feature relies on GCL's 'compile' function. The 'compile' function
>>> seems to be a Common Lisp standard since at least the publication of the
>>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>>> and relies on it for various base functionalities (compiling Maxima math
>>> functions to compiled Lisp functions, graphing, etc.).
>>
>> Good point, ‘compile’ is standard CL.
>>
>> So yes, that alone is probably a good reason to keep references to GCC
>> and Binutils (maybe add a comment explaining this.)  Sorry for holding
>> it back!
>>
>>> I turns out that fixing the underlying issue with GCL removes the need
>>> for GCC's presence at runtime, but binutils is still necessary due to
>>> Maxima using the 'compile' function from GCL directly. This stems from
>>> the GCC package not finding the binutils at runtime, i.e.
>>>
>>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>>
>>> returns
>>>
>>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>>
>>> but
>>>
>>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>>
>> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>>
>> Thank you,
>> Ludo’.
>
> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
> load properly when I use the commencement.scm module. Could this be due
> to the circular dependency problem mentioned in the "Commentary" section
> of commencement.scm?

Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
‘gcc-toolchain’ is rather for users.

Thanks,
LUdo’.




Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Tue, 18 Jul 2017 22:12:02 GMT) Full text and rfc822 format available.

Message #41 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils
 available at runtime.
Date: Tue, 18 Jul 2017 18:10:40 -0400
[Message part 1 (text/plain, inline)]
ludo <at> gnu.org (Ludovic Courtès) writes:

> Kei Kebreau <kei <at> openmailbox.org> skribis:
>
>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>
>>> Hi Kei,
>>>
>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>
>>>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>>>
>>>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>>>
>>>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>>>> +               ;; components at runtime.
>>>>>
>>>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>>>> change.)
>>>>>
>>>>> Thoughts?
>>>>>
>>>>
>>>> I started on this patchset because Guix's Maxima cannot graph functions.
>>>> This feature relies on GCL's 'compile' function. The 'compile' function
>>>> seems to be a Common Lisp standard since at least the publication of the
>>>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>>>> and relies on it for various base functionalities (compiling Maxima math
>>>> functions to compiled Lisp functions, graphing, etc.).
>>>
>>> Good point, ‘compile’ is standard CL.
>>>
>>> So yes, that alone is probably a good reason to keep references to GCC
>>> and Binutils (maybe add a comment explaining this.)  Sorry for holding
>>> it back!
>>>
>>>> I turns out that fixing the underlying issue with GCL removes the need
>>>> for GCC's presence at runtime, but binutils is still necessary due to
>>>> Maxima using the 'compile' function from GCL directly. This stems from
>>>> the GCC package not finding the binutils at runtime, i.e.
>>>>
>>>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>>>
>>>> returns
>>>>
>>>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>>>
>>>> but
>>>>
>>>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>>>
>>> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>>>
>>> Thank you,
>>> Ludo’.
>>
>> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
>> load properly when I use the commencement.scm module. Could this be due
>> to the circular dependency problem mentioned in the "Commentary" section
>> of commencement.scm?
>
> Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
> ‘gcc-toolchain’ is rather for users.

When I do this, GCL still gives me the

  "gcc: error trying to exec 'as': execvp: No such file or directory"

error if I don't wrap the binary with the binutils $PATH. The same has to
be done for Maxima. I'm trying to find a way to package GCL in such a
way that either (1) wrapping the GCL binary is unnecessary or (2)
wrapping the GCL binary and *only* the GCL binary is necessary for the
'compile' function to work.

>
> Thanks,
> LUdo’.

P.S. Sorry for dragging this out for so long. I'm just trying to
understand how I can minimize the package size of GCL-dependent packages.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Tue, 18 Jul 2017 23:35:02 GMT) Full text and rfc822 format available.

Message #44 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Kei Kebreau <kei <at> openmailbox.org>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and
 binutils	available at runtime.
Date: Wed, 19 Jul 2017 01:34:37 +0200
[Message part 1 (text/plain, inline)]
Kei Kebreau <kei <at> openmailbox.org> writes:

> ludo <at> gnu.org (Ludovic Courtès) writes:
>
>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>
>>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>>
>>>> Hi Kei,
>>>>
>>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>>
>>>>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>>>>
>>>>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>>>>
>>>>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>>>>> +               ;; components at runtime.
>>>>>>
>>>>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>>>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>>>>> change.)
>>>>>>
>>>>>> Thoughts?
>>>>>>
>>>>>
>>>>> I started on this patchset because Guix's Maxima cannot graph functions.
>>>>> This feature relies on GCL's 'compile' function. The 'compile' function
>>>>> seems to be a Common Lisp standard since at least the publication of the
>>>>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>>>>> and relies on it for various base functionalities (compiling Maxima math
>>>>> functions to compiled Lisp functions, graphing, etc.).
>>>>
>>>> Good point, ‘compile’ is standard CL.
>>>>
>>>> So yes, that alone is probably a good reason to keep references to GCC
>>>> and Binutils (maybe add a comment explaining this.)  Sorry for holding
>>>> it back!
>>>>
>>>>> I turns out that fixing the underlying issue with GCL removes the need
>>>>> for GCC's presence at runtime, but binutils is still necessary due to
>>>>> Maxima using the 'compile' function from GCL directly. This stems from
>>>>> the GCC package not finding the binutils at runtime, i.e.
>>>>>
>>>>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>>>>
>>>>> returns
>>>>>
>>>>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>>>>
>>>>> but
>>>>>
>>>>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>>>>
>>>> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>>>>
>>>> Thank you,
>>>> Ludo’.
>>>
>>> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
>>> load properly when I use the commencement.scm module. Could this be due
>>> to the circular dependency problem mentioned in the "Commentary" section
>>> of commencement.scm?
>>
>> Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
>> ‘gcc-toolchain’ is rather for users.
>
> When I do this, GCL still gives me the
>
>   "gcc: error trying to exec 'as': execvp: No such file or directory"
>
> error if I don't wrap the binary with the binutils $PATH. The same has to
> be done for Maxima. I'm trying to find a way to package GCL in such a
> way that either (1) wrapping the GCL binary is unnecessary or (2)
> wrapping the GCL binary and *only* the GCL binary is necessary for the
> 'compile' function to work.

This is because GCC does not retain an absolute reference to binutils'
'as'. I came across this too in:

https://lists.gnu.org/archive/html/guix-devel/2016-11/msg01104.html

If you have some cycles to spare, it could be interesting to try and
use a GCC built with '--with-as=<absolute binutils path>'. E.g.

(define-public gcc-with-as
  (package
    (inherit gcc)
    (arguments
      `(,@(substitute-keyword-arguments (package-arguments grub)
            ((#:configure-flags flags ''())
            `(cons (string-append "--with-as="
                                  (assoc-ref %build-inputs "binutils")
                                  "/bin/as")
                   ,flags)))))))

(define-public gcl
  (package ...
    (native-inputs `(("gcc" ,gcc-with-as)))))

I've been meaning to try this a while, but you know... ;)
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Wed, 19 Jul 2017 08:56:02 GMT) Full text and rfc822 format available.

Message #47 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: 27628 <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils
 available at runtime.
Date: Wed, 19 Jul 2017 10:55:27 +0200
Hi Kei,

Kei Kebreau <kei <at> openmailbox.org> skribis:

> ludo <at> gnu.org (Ludovic Courtès) writes:

[...]

>>> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
>>> load properly when I use the commencement.scm module. Could this be due
>>> to the circular dependency problem mentioned in the "Commentary" section
>>> of commencement.scm?
>>
>> Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
>> ‘gcc-toolchain’ is rather for users.
>
> When I do this, GCL still gives me the
>
>   "gcc: error trying to exec 'as': execvp: No such file or directory"
>
> error if I don't wrap the binary with the binutils $PATH. The same has to
> be done for Maxima.

Right, sorry for the confusion: you also need Binutils in $PATH.

> I'm trying to find a way to package GCL in such a way that either (1)
> wrapping the GCL binary is unnecessary or (2) wrapping the GCL binary
> and *only* the GCL binary is necessary for the 'compile' function to
> work.

Wrapping the ‘gcl’ binary alone is probably not enough, because a
program like Maxima compiled with ‘gcl’ does not invoke the ‘gcl’
binary.

Perhaps instead of wrapping we should patch references to “gcc” in the
source with their absolute file name or something along these lines?

Ludo’.

PS: Apologies for making hand-wavy comments and letting you do the
    actual work.  :-)




Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Thu, 20 Jul 2017 02:06:01 GMT) Full text and rfc822 format available.

Message #50 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 27628 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and
 binutils	available at runtime.
Date: Wed, 19 Jul 2017 22:03:22 -0400
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> Kei Kebreau <kei <at> openmailbox.org> writes:
>
>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>
>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>
>>>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>>>
>>>>> Hi Kei,
>>>>>
>>>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>>>
>>>>>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>>>>>
>>>>>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>>>>>
>>>>>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>>>>>> +               ;; components at runtime.
>>>>>>>
>>>>>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>>>>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>>>>>> change.)
>>>>>>>
>>>>>>> Thoughts?
>>>>>>>
>>>>>>
>>>>>> I started on this patchset because Guix's Maxima cannot graph functions.
>>>>>> This feature relies on GCL's 'compile' function. The 'compile' function
>>>>>> seems to be a Common Lisp standard since at least the publication of the
>>>>>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>>>>>> and relies on it for various base functionalities (compiling Maxima math
>>>>>> functions to compiled Lisp functions, graphing, etc.).
>>>>>
>>>>> Good point, ‘compile’ is standard CL.
>>>>>
>>>>> So yes, that alone is probably a good reason to keep references to GCC
>>>>> and Binutils (maybe add a comment explaining this.)  Sorry for holding
>>>>> it back!
>>>>>
>>>>>> I turns out that fixing the underlying issue with GCL removes the need
>>>>>> for GCC's presence at runtime, but binutils is still necessary due to
>>>>>> Maxima using the 'compile' function from GCL directly. This stems from
>>>>>> the GCC package not finding the binutils at runtime, i.e.
>>>>>>
>>>>>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>>>>>
>>>>>> returns
>>>>>>
>>>>>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>>>>>
>>>>>> but
>>>>>>
>>>>>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>>>>>
>>>>> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>>>>>
>>>>> Thank you,
>>>>> Ludo’.
>>>>
>>>> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
>>>> load properly when I use the commencement.scm module. Could this be due
>>>> to the circular dependency problem mentioned in the "Commentary" section
>>>> of commencement.scm?
>>>
>>> Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
>>> ‘gcc-toolchain’ is rather for users.
>>
>> When I do this, GCL still gives me the
>>
>>   "gcc: error trying to exec 'as': execvp: No such file or directory"
>>
>> error if I don't wrap the binary with the binutils $PATH. The same has to
>> be done for Maxima. I'm trying to find a way to package GCL in such a
>> way that either (1) wrapping the GCL binary is unnecessary or (2)
>> wrapping the GCL binary and *only* the GCL binary is necessary for the
>> 'compile' function to work.
>
> This is because GCC does not retain an absolute reference to binutils'
> 'as'. I came across this too in:
>
> https://lists.gnu.org/archive/html/guix-devel/2016-11/msg01104.html
>
> If you have some cycles to spare, it could be interesting to try and
> use a GCC built with '--with-as=<absolute binutils path>'. E.g.
>
> (define-public gcc-with-as
>   (package
>     (inherit gcc)
>     (arguments
>       `(,@(substitute-keyword-arguments (package-arguments grub)
>             ((#:configure-flags flags ''())
>             `(cons (string-append "--with-as="
>                                   (assoc-ref %build-inputs "binutils")
>                                   "/bin/as")
>                    ,flags)))))))
>
> (define-public gcl
>   (package ...
>     (native-inputs `(("gcc" ,gcc-with-as)))))
>
> I've been meaning to try this a while, but you know... ;)

I had the oppurtunity to try this earlier and gcc finds its assembler,
but not the linker! The package size increase is about 25% (255.9 MiB up
from 206.6 MiB). I'm going to look into this further.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#27628; Package guix-patches. (Mon, 24 Jul 2017 18:01:02 GMT) Full text and rfc822 format available.

Message #53 received at 27628 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 27628 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and
 binutils	available at runtime.
Date: Mon, 24 Jul 2017 12:08:37 -0400
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> Kei Kebreau <kei <at> openmailbox.org> writes:
>
>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>
>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>
>>>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>>>
>>>>> Hi Kei,
>>>>>
>>>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>>>
>>>>>> ludo <at> gnu.org (Ludovic Courtès) writes:
>>>>>>
>>>>>>> Kei Kebreau <kei <at> openmailbox.org> skribis:
>>>>>>>
>>>>>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>>>>>> +               ;; components at runtime.
>>>>>>>
>>>>>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>>>>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>>>>>> change.)
>>>>>>>
>>>>>>> Thoughts?
>>>>>>>
>>>>>>
>>>>>> I started on this patchset because Guix's Maxima cannot graph functions.
>>>>>> This feature relies on GCL's 'compile' function. The 'compile' function
>>>>>> seems to be a Common Lisp standard since at least the publication of the
>>>>>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>>>>>> and relies on it for various base functionalities (compiling Maxima math
>>>>>> functions to compiled Lisp functions, graphing, etc.).
>>>>>
>>>>> Good point, ‘compile’ is standard CL.
>>>>>
>>>>> So yes, that alone is probably a good reason to keep references to GCC
>>>>> and Binutils (maybe add a comment explaining this.)  Sorry for holding
>>>>> it back!
>>>>>
>>>>>> I turns out that fixing the underlying issue with GCL removes the need
>>>>>> for GCC's presence at runtime, but binutils is still necessary due to
>>>>>> Maxima using the 'compile' function from GCL directly. This stems from
>>>>>> the GCC package not finding the binutils at runtime, i.e.
>>>>>>
>>>>>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>>>>>
>>>>>> returns
>>>>>>
>>>>>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>>>>>
>>>>>> but
>>>>>>
>>>>>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>>>>>
>>>>> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>>>>>
>>>>> Thank you,
>>>>> Ludo’.
>>>>
>>>> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
>>>> load properly when I use the commencement.scm module. Could this be due
>>>> to the circular dependency problem mentioned in the "Commentary" section
>>>> of commencement.scm?
>>>
>>> Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
>>> ‘gcc-toolchain’ is rather for users.
>>
>> When I do this, GCL still gives me the
>>
>>   "gcc: error trying to exec 'as': execvp: No such file or directory"
>>
>> error if I don't wrap the binary with the binutils $PATH. The same has to
>> be done for Maxima. I'm trying to find a way to package GCL in such a
>> way that either (1) wrapping the GCL binary is unnecessary or (2)
>> wrapping the GCL binary and *only* the GCL binary is necessary for the
>> 'compile' function to work.
>
> This is because GCC does not retain an absolute reference to binutils'
> 'as'. I came across this too in:
>
> https://lists.gnu.org/archive/html/guix-devel/2016-11/msg01104.html
>
> If you have some cycles to spare, it could be interesting to try and
> use a GCC built with '--with-as=<absolute binutils path>'. E.g.
>
> (define-public gcc-with-as
>   (package
>     (inherit gcc)
>     (arguments
>       `(,@(substitute-keyword-arguments (package-arguments grub)
>             ((#:configure-flags flags ''())
>             `(cons (string-append "--with-as="
>                                   (assoc-ref %build-inputs "binutils")
>                                   "/bin/as")
>                    ,flags)))))))
>
> (define-public gcl
>   (package ...
>     (native-inputs `(("gcc" ,gcc-with-as)))))
>
> I've been meaning to try this a while, but you know... ;)

Based on playing around with this for a while, I'm concluding that the
core issue here is that the GCC binary from our GCC package for whatever
reason doesn't retain an absolute path to the GNU binutils binaries.

I have a hunch that Marius' solution could work, but I haven't been able
to get GCC to build with the necessary "--with-as" and "--with-ld" flags
yet. If no one has a better idea, I will push the 'binary-wrapping'
patches that at least get GCL and Maxima to compile things successfully.

Thanks to all involved,
Kei
[signature.asc (application/pgp-signature, inline)]

Reply sent to Kei Kebreau <kei <at> openmailbox.org>:
You have taken responsibility. (Tue, 25 Jul 2017 13:14:02 GMT) Full text and rfc822 format available.

Notification sent to Kei Kebreau <kei <at> openmailbox.org>:
bug acknowledged by developer. (Tue, 25 Jul 2017 13:14:02 GMT) Full text and rfc822 format available.

Message #58 received at 27628-done <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: 27628-done <at> debbugs.gnu.org
Subject: Re: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils
 available at runtime.
Date: Tue, 25 Jul 2017 09:13:47 -0400
[Message part 1 (text/plain, inline)]
Changes pushed.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 23 Aug 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 248 days ago.

Previous Next


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