all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Allan Webber <cwebber@dustycloud.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Fixing non-reproducibility in some guile packages
Date: Mon, 13 Feb 2017 10:42:34 -0600	[thread overview]
Message-ID: <874lzy59fp.fsf@dustycloud.org> (raw)
In-Reply-To: <87fujicfy2.fsf@gnu.org>


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

Ludovic Courtès writes:

> Christopher Allan Webber <cwebber@dustycloud.org> skribis:
>
>>           (let* ((out (assoc-ref %outputs "out"))
>> -                (module-dir (string-append out "/share/guile/site/2.0"))
>> +                (module-dir (string-append out "/share/guile/site/"
>> +                                           ,(if guile-2.2?
>> +                                                "2.2" "2.0")))
>>                  (source (assoc-ref %build-inputs "source"))
>
> Another approach, which is more future-proof but also more verbose, is
> to evaluate (effective-version) for the Guile that’s being used, on the
> “build side” (thus, no need to do the unquote thing above).
>
> The ‘guile-minikanren’ package does exactly that:
>
>          (let* ((out (assoc-ref %outputs "out"))
>                 (guile (assoc-ref %build-inputs "guile"))
>                 (effective (read-line
>                             (open-pipe* OPEN_READ
>                                         (string-append guile "/bin/guile")
>                                         "-c" "(display (effective-version))")))
>                 (module-dir (string-append out "/share/guile/site/"
>                                            effective)) …)
>             …)
>
> We should probably factorize this somewhere (a new (guix build guile)
> module?), but for now that’s what we have.
>
> How does that sound?

It looks much better!  I've updated my patch to use this method.

Re: the new module, I agree it's a good idea.  We had some talks at
FOSDEM about maybe supporting more declarative guild'y type
configuration again, and maybe that's the right approach, I don't really
know.  It feels like "what should we do about easy to package guile
packages that don't necessarily use autotools" is still a conversation
to be had.  Not sure if that's a prerequisite for the module.

Anyway, okay to push?  I'd love to have the buggy package not be buggy
in master. :)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-guile-gdbm-ffi-Write-to-correct-guile-output-directo.patch --]
[-- Type: text/x-patch, Size: 3082 bytes --]

From 369582d7c8b5ce1249761337319e79cc117f161e Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Fri, 10 Feb 2017 19:24:57 -0600
Subject: [PATCH] guile-gdbm-ffi: Write to correct guile output directory and
 use guild.

* gnu/packages/guile.scm (guile-gdbm-ffi): Check guile for effective version
before writing to output path.  Also fixes a bug where the guild command was
not getting called, and instead was calling the internal guile compile-file
procedure.  This meant that the package produced was dependent on whatever
version of guile was powering Guix at the time.  Also set GUILE_AUTO_COMPILE
to 0 to avoid gnarly looking warnings during build.
---
 gnu/packages/guile.scm | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 3e8ab007b..75f561c03 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -844,11 +844,20 @@ inspired by the SCSH regular expression system.")
        ((guix build utils))
        #:builder
        (begin
-         (use-modules (guix build utils)
-                      (system base compile))
+         (use-modules (guix build utils))
+
+         (setenv "GUILE_AUTO_COMPILE" "0")
 
          (let* ((out (assoc-ref %outputs "out"))
-                (module-dir (string-append out "/share/guile/site/2.0"))
+                (effective-version
+                 (read-line
+                  (open-pipe* OPEN_READ
+                              (string-append
+                               (assoc-ref %build-inputs "guile")
+                               "/bin/guile")
+                              "-c" "(display (effective-version))")))
+                (module-dir (string-append out "/share/guile/site/"
+                                           effective-version))
                 (source (assoc-ref %build-inputs "source"))
                 (doc (string-append out "/share/doc"))
                 (guild (string-append (assoc-ref %build-inputs "guile")
@@ -856,7 +865,10 @@ inspired by the SCSH regular expression system.")
                 (gdbm.scm-dest
                  (string-append module-dir "/gdbm.scm"))
                 (gdbm.go-dest
-                 (string-append module-dir "/gdbm.go")))
+                 (string-append module-dir "/gdbm.go"))
+                (compile-file
+                 (lambda (in-file out-file)
+                   (system* guild "compile" "-o" out-file in-file))))
            ;; Make installation directories.
            (mkdir-p module-dir)
            (mkdir-p doc)
@@ -874,8 +886,7 @@ inspired by the SCSH regular expression system.")
                       (assoc-ref %build-inputs "gdbm"))))
 
            ;; compile to the destination
-           (compile-file gdbm.scm-dest
-                         #:output-file gdbm.go-dest)))))
+           (compile-file gdbm.scm-dest gdbm.go-dest)))))
     (inputs
      `(("guile" ,guile-2.0)))
     (propagated-inputs
-- 
2.11.0


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

      reply	other threads:[~2017-02-13 16:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11  1:29 guile2.2-gdbm-ffi issue Christopher Allan Webber
2017-02-11 17:08 ` Fixing non-reproducibility in some guile packages (was: guile2.2-gdbm-ffi issue) Christopher Allan Webber
2017-02-11 21:20   ` Fixing non-reproducibility in some guile packages Jan Nieuwenhuizen
2017-02-12 17:29     ` Christopher Allan Webber
2017-02-13  6:18       ` Maxim Cournoyer
2017-02-13  7:13         ` Andy Wingo
2017-02-13 16:25           ` Christopher Allan Webber
2017-02-13 17:39           ` Maxim Cournoyer
2017-02-13 14:40       ` Ludovic Courtès
2017-02-13 16:42         ` Christopher Allan Webber [this message]

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=874lzy59fp.fsf@dustycloud.org \
    --to=cwebber@dustycloud.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /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.