all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Guillaume Le Vaillant <glv@posteo.net>
To: Pierre Neidhardt <mail@ambrevar.xyz>
Cc: 45017@debbugs.gnu.org
Subject: bug#45017: asdf-build-system packages have priority over user ones
Date: Fri, 04 Dec 2020 14:53:08 +0100	[thread overview]
Message-ID: <87y2idsmnv.fsf@yamatai> (raw)
In-Reply-To: <87blf9u4bf.fsf@ambrevar.xyz>


[-- Attachment #1.1: Type: text/plain, Size: 2568 bytes --]


Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> Guillaume Le Vaillant <glv@posteo.net> writes:
>
>> SBCL and ECL are patched to use our cl-asdf because it is necessary to
>> build the sbcl-* and ecl-* packages. Also patching ABCL, CCL, and Clisp
>> sounds like a good idea. At least all the compilers would use the same
>> version of ASDF, and hopefully behave in the same way when looking for
>> configuration files.
>
> Yup, that'd be neat :)

Patches for CCL and Clisp attached. ABCL fails to build with ASDF 3.3.4
and I have not seen an obvious error message in the logs, so this one
will need more investigation...


> Related to this, I've noticed another issue with SBCL packages: when an
> SBCL package has a dependency that's updated in ~/common-lisp,
> (asdf:load-system ...) tries to recompile it in its folder, which fails
> since /gnu/store is read-only.
>
> Example:
>
> - Apply the above patch or edit
>   ~/.config/common-lisp/source-registry.conf
>   to make sure ~/common-lisp is loaded before system packages.
>
> - Install sbcl-cl-cookie.
>
> - Check out https://github.com/fukamachi/quri:
>   git clone https://github.com/fukamachi/quri ~/common-lisp/quri
>
> - Now run
>
> --8<---------------cut here---------------start------------->8---
> $ sbcl
> * (asdf:load-system :cl-cookie)
> WARNING: System definition file #P"/gnu/store/81cwmspx3366vdjs6v20rnd8a0xyr6in-sbcl-cl-fad-0.7.6/share/common-lisp/sbcl/cl-fad/cl-fad.asd" contains definition for system "cl-fad-test". Please only define "cl-fad" and secondary systems with a name starting with "cl-fad/" (e.g. "cl-fad/test") in that file.
>
> debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread
> #<THREAD "main thread" RUNNING {100B790203}>:
>   Error opening #P"/gnu/store/22q4ydm0pagi4irz0clssgkhkyh115j8-sbcl-cl-cookie-0.9.10-1.cea55ae/lib/common-lisp/sbcl/cl-cookie/src/cl-cookie-tmpGHU3ALSV.fasl":
>
>     Read-only file system
> --8<---------------cut here---------------end--------------->8---
>
> Not sure what to do about this.
>
> I'm guessing that Common Lisp development is not practical with Guix'
> SBCL packages and I should just stick to the CL packages.
>
> Thoughts?

The Lisp systems of sbcl-* and ecl-* packages installed in a profile are
supposed to be already compiled and immutable, so recompiling them
anyway would require tweaking the ASDF configuration from inside SBCL to
remove the output translations for these systems.
When doing development, it might be more convenient to just use the
sources or source packages of every system that has to be recompiled.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0002-gnu-ccl-Use-system-ASDF-instead-of-bundled-one.patch --]
[-- Type: text/x-patch, Size: 2818 bytes --]

From 5ce14232fafef61fdd5f9412c50dbfbb90f0d03e Mon Sep 17 00:00:00 2001
From: Guillaume Le Vaillant <glv@posteo.net>
Date: Fri, 4 Dec 2020 10:29:34 +0100
Subject: [PATCH 2/4] gnu: ccl: Use system ASDF instead of bundled one.

* gnu/packages/lisp.scm (ccl)[native-inputs]: Add cl-asdf.
  [arguments]: Add 'replace-asdf' phase.
  [native-search-paths]: Add XDG_CONFIG_DIRS and XDG_DATA_DIRS.
---
 gnu/packages/lisp.scm | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 0038cb0dca..2a8c59546e 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -603,7 +603,8 @@ statistical profiler, a code coverage tool, and many other extensions.")
                 "0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
                (_ "15l7cfa4a7jkfwdzsfm4q3n22jnb57imxahpql3h77xin57v1gbz"))))))))
     (native-inputs
-     `(("m4" ,m4)))
+     `(("cl-asdf" ,cl-asdf)
+       ("m4" ,m4)))
     (arguments
      `(#:tests? #f                      ;no 'check' target
        #:modules ((ice-9 match)
@@ -615,6 +616,17 @@ statistical profiler, a code coverage tool, and many other extensions.")
          (add-after 'unpack 'unpack-image
            (lambda* (#:key inputs #:allow-other-keys)
              (invoke "tar" "xzvf" (assoc-ref inputs "ccl-bootstrap"))))
+         (add-after 'unpack 'replace-asdf
+           ;; Use system ASDF instead of bundled one.
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
+                    (guix-asdf (string-append
+                                cl-asdf
+                                "/share/common-lisp/source/asdf/asdf.lisp"))
+                    (out (string-append (assoc-ref outputs "out")))
+                    (contrib-asdf "tools/asdf.lisp"))
+               (delete-file contrib-asdf)
+               (copy-file guix-asdf contrib-asdf))))
          (delete 'configure)
          (add-before 'build 'pre-build
            ;; Enter the source directory for the current platform's lisp
@@ -678,6 +690,13 @@ statistical profiler, a code coverage tool, and many other extensions.")
                      "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
                (chmod wrapper #o755))
              #t)))))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "XDG_DATA_DIRS")
+            (files '("share")))
+           (search-path-specification
+            (variable "XDG_CONFIG_DIRS")
+            (files '("etc")))))
     (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
     (home-page "https://ccl.clozure.com/")
     (synopsis "Common Lisp implementation")
-- 
2.29.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0003-gnu-clisp-Use-system-ASDF-instead-of-bundled-one.patch --]
[-- Type: text/x-patch, Size: 2352 bytes --]

From 15c7a20030a7e7643af7948982791074e4c358be Mon Sep 17 00:00:00 2001
From: Guillaume Le Vaillant <glv@posteo.net>
Date: Fri, 4 Dec 2020 10:48:41 +0100
Subject: [PATCH 3/4] gnu: clisp: Use system ASDF instead of bundled one.

* gnu/packages/lisp.scm (clisp)[native-inputs]: Add cl-asdf.
  [arguments]: Add 'replace-asdf' phase.
  [native-search-paths]: Add XDG_CONFIG_DIRS and XDG_DATA_DIRS.
---
 gnu/packages/lisp.scm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 2a8c59546e..07d54747cb 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -322,6 +322,8 @@ supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
        (sha256
         (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))))
     (build-system gnu-build-system)
+    (native-inputs
+     `(("cl-asdf" ,cl-asdf)))
     (inputs `(("libffcall" ,libffcall)
               ("ncurses" ,ncurses)
               ("readline" ,readline)
@@ -356,7 +358,25 @@ supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
                (("/bin/sh") "sh"))
              (substitute* '("src/clisp-link.in")
                (("/bin/pwd") "pwd"))
-             #t)))))
+             #t))
+         (add-after 'unpack 'replace-asdf
+           ;; Use system ASDF instead of bundled one.
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
+                    (guix-asdf (string-append
+                                cl-asdf
+                                "/share/common-lisp/source/asdf/asdf.lisp"))
+                    (out (string-append (assoc-ref outputs "out")))
+                    (contrib-asdf "modules/asdf/asdf.lisp"))
+               (delete-file contrib-asdf)
+               (copy-file guix-asdf contrib-asdf)))))))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "XDG_DATA_DIRS")
+            (files '("share")))
+           (search-path-specification
+            (variable "XDG_CONFIG_DIRS")
+            (files '("etc")))))
     (home-page "https://clisp.sourceforge.io/")
     (synopsis "A Common Lisp implementation")
     (description
-- 
2.29.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

  reply	other threads:[~2020-12-04 13:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03  9:42 bug#45017: asdf-build-system packages have priority over user ones Pierre Neidhardt
2020-12-03 12:04 ` Guillaume Le Vaillant
2020-12-03 12:40   ` Pierre Neidhardt
2020-12-03 14:29     ` Guillaume Le Vaillant
2020-12-04  8:51       ` Pierre Neidhardt
2020-12-04  9:12         ` Guillaume Le Vaillant
2020-12-04 12:46           ` Pierre Neidhardt
2020-12-04 13:53             ` Guillaume Le Vaillant [this message]
2020-12-04 17:30               ` Guillaume Le Vaillant
2020-12-05  8:18               ` Pierre Neidhardt
2020-12-05  9:42                 ` Guillaume Le Vaillant
2020-12-05  9:17       ` Pierre Neidhardt
2020-12-05 10:03         ` Guillaume Le Vaillant
2020-12-05 10:52           ` Guillaume Le Vaillant
2020-12-05 14:42             ` Pierre Neidhardt
2020-12-05 15:17               ` Guillaume Le Vaillant
2020-12-05 15:19                 ` Pierre Neidhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2idsmnv.fsf@yamatai \
    --to=glv@posteo.net \
    --cc=45017@debbugs.gnu.org \
    --cc=mail@ambrevar.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.