unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* clisp executable images fail at startup
@ 2016-12-24  9:00 Ricardo Wurmus
  2016-12-30 23:37 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2016-12-24  9:00 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

Hi Guix,

for fun I just ported Yale Haskell to CLISP (it only needed a handful of
changes).  I’m using EXT:SAVEINITMEM to generate an executable image.
Building the image outside of Guix I can run the executable and I get a
Haskell prompt as expected.

When I packaged it and tried to run the packaged executable, however, I
got this error:

    module 'syscalls' requires package OS.

(This error is reported by CLISP.)

Attached is the patch I used to build the yale-haskell package.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-WIP-Add-yale-haskell.patch --]
[-- Type: text/x-patch, Size: 2667 bytes --]

From d59f25c4ee8982a56342a03bcc66fc9048113c21 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Sat, 24 Dec 2016 09:50:29 +0100
Subject: [PATCH] WIP: Add yale-haskell.

---
 gnu/packages/haskell.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 8e5927a..27ed7aa 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -29,6 +29,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
@@ -44,6 +45,7 @@
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages libedit)
+  #:use-module (gnu packages lisp)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages multiprecision)
@@ -53,6 +55,42 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
+(define-public yale-haskell
+  (let ((commit "85f94c72a16c5f70301dd8db04cde9de2d7dd270")
+        (revision "1"))
+    (package
+      (name "yale-haskell")
+      (version (string-append "2.0.5-" revision "." (string-take commit 9)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "http://git.elephly.net/software/yale-haskell.git")
+                      (commit commit)))
+                (file-name (string-append "yale-haskell-" commit "-checkout"))
+                (sha256
+                 (base32
+                  "0bal3m6ryrjamz5p93bhs9rp5msk8k7lpcqr44wd7xs9b9k8w74g"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f ; no tests
+         #:make-flags
+         (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'configure
+             (lambda _
+               (setenv "PRELUDE" "./progs/prelude")
+               (setenv "HASKELL_LIBRARY" "./progs/lib")
+               (setenv "PRELUDEBIN" "./progs/prelude/clisp")
+               (setenv "HASKELLPROG" "./bin/clisp-haskell")
+               #t)))))
+      (inputs
+       `(("clisp" ,clisp)))
+      (home-page "http://git.elephly.net/software/yale-haskell.git")
+      (synopsis "Port of the Yale Haskell system to CLISP")
+      (description "TODO")
+      (license license:bsd-4))))
+
 (define ghc-bootstrap-x86_64-7.8.4
   (origin
     (method url-fetch)
-- 
2.10.2


[-- Attachment #3: Type: text/plain, Size: 89 bytes --]


-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
http://elephly.net

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: clisp executable images fail at startup
  2016-12-24  9:00 clisp executable images fail at startup Ricardo Wurmus
@ 2016-12-30 23:37 ` Ludovic Courtès
  2016-12-31 19:41   ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2016-12-30 23:37 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix

Hi!

Ricardo Wurmus <rekado@elephly.net> skribis:

> for fun I just ported Yale Haskell to CLISP (it only needed a handful of
> changes).  I’m using EXT:SAVEINITMEM to generate an executable image.
> Building the image outside of Guix I can run the executable and I get a
> Haskell prompt as expected.

Excellent!

> When I packaged it and tried to run the packaged executable, however, I
> got this error:
>
>     module 'syscalls' requires package OS.
>
> (This error is reported by CLISP.)

Could it be a search path issue?  Did you try strace’ing clisp to see
where it’s looking for “OS”?

HTH!
Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: clisp executable images fail at startup
  2016-12-30 23:37 ` Ludovic Courtès
@ 2016-12-31 19:41   ` Ricardo Wurmus
  0 siblings, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2016-12-31 19:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix


Ludovic Courtès <ludo@gnu.org> writes:

>> When I packaged it and tried to run the packaged executable, however, I
>> got this error:
>>
>>     module 'syscalls' requires package OS.
>>
>> (This error is reported by CLISP.)
>
> Could it be a search path issue?  Did you try strace’ing clisp to see
> where it’s looking for “OS”?

I couldn’t find anything of interest by strace’ing the binary, but I
noticed that the binary I built locally is an order of magnitude larger
than the binary that ended up in the store (21MB instead of 2.6MB).

Turns out that after disabling stripping I get an executable that works
fine.  Maybe executable CLISP images should never be stripped.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
http://elephly.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-31 19:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-24  9:00 clisp executable images fail at startup Ricardo Wurmus
2016-12-30 23:37 ` Ludovic Courtès
2016-12-31 19:41   ` Ricardo Wurmus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).