From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Allan Webber Subject: Re: Fixing non-reproducibility in some guile packages Date: Mon, 13 Feb 2017 10:42:34 -0600 Message-ID: <874lzy59fp.fsf@dustycloud.org> References: <87fujly0pu.fsf@dustycloud.org> <87bmu8y7sx.fsf@dustycloud.org> <87tw80pgpl.fsf@gnu.org> <87efz35ncm.fsf@dustycloud.org> <87fujicfy2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdJi6-0000TF-5u for guix-devel@gnu.org; Mon, 13 Feb 2017 11:42:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdJi2-0001jO-A9 for guix-devel@gnu.org; Mon, 13 Feb 2017 11:42:42 -0500 In-reply-to: <87fujicfy2.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Christopher Allan Webber 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=E2=80=99s being used, = on the > =E2=80=9Cbuild side=E2=80=9D (thus, no need to do the unquote thing above= ). > > The =E2=80=98guile-minikanren=E2=80=99 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)) =E2=80=A6) > =E2=80=A6) > > We should probably factorize this somewhere (a new (guix build guile) > module?), but for now that=E2=80=99s 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. :) --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-guile-gdbm-ffi-Write-to-correct-guile-output-directo.patch Content-Transfer-Encoding: quoted-printable From=20369582d7c8b5ce1249761337319e79cc117f161e Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber 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. =2D-- 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 =2D-- 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 =2D (use-modules (guix build utils) =2D (system base compile)) + (use-modules (guix build utils)) + + (setenv "GUILE_AUTO_COMPILE" "0") =20 (let* ((out (assoc-ref %outputs "out")) =2D (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 =2D (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")))) =20 ;; compile to the destination =2D (compile-file gdbm.scm-dest =2D #:output-file gdbm.go-dest))))) + (compile-file gdbm.scm-dest gdbm.go-dest))))) (inputs `(("guile" ,guile-2.0))) (propagated-inputs =2D-=20 2.11.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEUQqGKOKndniPjHCcS8Alkl/49NMFAlih4foACgkQS8Alkl/4 9NPUIw//dg8qkWHEO88JM5RrTP1Gr8HBbDpGfCLNEHGCfjLgUVUBjGKSltc+8y/g KaRAbxs0f8VG+eXe/L0a6uWPdIOsmvVG/23rdgVTZTVJQs28HUMZHlBuxxKnRzJG kjvDUxpy9j+k/Ec9YwTNnaWiFV0Gi027iZiEquv+OB7Xv3AB6lo4R+6cenXbMfK+ 64SQuUEsayfzRBUo35WoQUKWiy/tjgkEp09k0geDge5sOFWgAyCvfgQWvpB0hCPE yEqkzH53YauvRFy1005/HMTuFpTtxTqnV4y/JsUGYJAmO46w3ksoTXGiRCWLTmmM kM0KRS7EQrlrD8W5+Zv/COCqy9MoEg5WLBdcM6VqYhO/kzrbYH7m/rVccLODQQuf 1cbk1tF4/eCho6Str8hS/PlQalLqbSJCEDAnwHZBWBQuyMUkn+Ynnzl5LaU+8oOp oxmxl8iKSMNsdMBjkSpBXs5EMs4zlOib+Yg5cBpAOKLtIW2KpnL9uKs4xmEN2GEU 8MVREL4aKmMAxmtbiyqkziF6o4knGCFD7WEJ+kglNq9HwDBxuM4SnNWMsvobgVrT rjgNmKzBup342tguiAu69c6TEc1+tNYy/PjG6wglfhQww6/myovrs9ToFKYxJKkc TxwcpI7lINtQWPVhzz69AKgw/35BJ1qtd2CnxTcj/bUoUpLTErY= =spKC -----END PGP SIGNATURE----- --==-=-=--