From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] profiles: Generate GHC's package database cache. Date: Sun, 05 Apr 2015 22:06:04 +0200 Message-ID: <87mw2mcpcj.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yeqo7-00035s-II for guix-devel@gnu.org; Sun, 05 Apr 2015 16:06:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yeqo3-0006AO-GO for guix-devel@gnu.org; Sun, 05 Apr 2015 16:06:11 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yeqo3-0006AK-Cl for guix-devel@gnu.org; Sun, 05 Apr 2015 16:06:07 -0400 In-Reply-To: (Federico Beffa's message of "Sat, 4 Apr 2015 23:10:57 +0200") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Federico Beffa Cc: Guix-devel Federico Beffa skribis: > From dfe3b875267731006512b8a9803aaa56f07db12e Mon Sep 17 00:00:00 2001 > From: Federico Beffa > Date: Sat, 4 Apr 2015 22:51:13 +0200 > Subject: [PATCH] profiles: Generate GHC's package database cache. > > * guix/profiles.scm (ghc-package-cache-file): New procedure. > (profile-derivation): Add 'ghc-package-cache?' keyword argument. If tr= ue > (the default), add the result of 'ghc-package-cache-file' to 'inputs'. > * guix/scripts/package.scm (guix-package)[process-actions]: Pass > #:ghc-package-cache? to 'profile-generation'. > * tests/packages.scm ("--search-paths with pattern"): Likewise. > * tests/profiles.scm ("profile-derivation"): Likewise. LG, but... > On Sun, Apr 5, 2015 at 7:21 AM, Mark H Weaver wrote: >> I believe this will require GHC to build *any* non-empty profile. Since >> GHC is only available on Intel platforms, this will break profile >> building on MIPS and ARM. >> >> Even on Intel platforms, I don't want to have to install GHC to build >> profiles that don't contain any Haskell packages, especially since it >> involves trusting the upstream binaries from GHC. All good points. > Good point. Would this check be satisfactory for you? > > ;; Don't depend on GHC when there's nothing to do. > (if (any (cut string-prefix? "ghc" <>) > (map manifest-entry-name (manifest-entries manifest))) > (gexp->derivation "ghc-package-cache" build > #:modules '((guix build utils)) > #:local-build? #t) > (gexp->derivation "ghc-package-cache" #~(mkdir #$output)))) I think that would do. Eventually we could think of more sophisticated way to determine whether to trigger a given =E2=80=9Chook=E2=80=9D (info-dir, ca-certificates, ghc.)= Perhaps this =E2=80=98ghc-package-cache-file=E2=80=99 procedure could be added as an =E2=80=98environment-hook=E2=80=99 field of the ghc package and it would be= triggered iff GHC is installed. (This approach would work well for GHC, but not for info-dir or ca-certificates, though.) >> What if I want to use Hugs instead, or some other Haskell implementation >> that is capable of being bootstrapped from source code. Is GHC the only >> tool that can do this job? > > As far as I know, the library database is compiler specific. Here we > are handling GHC only. I think this is fine. A similar hook could be added for Hugs if/when we see fit and presumably they would not interfere. Thoughts? Thanks, Ludo=E2=80=99.