On Sun, Apr 5, 2015 at 10:33 PM, Federico Beffa <be...@ieee.org> wrote: > On Sun, Apr 5, 2015 at 10:24 PM, Mark H Weaver <m...@netris.org> wrote: >>> >>> ;; 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)))) >> >> Sure, this would be fine, although I wonder if we could replace the >> 'string-prefix?' with 'string=?'. If so, the conditional could be > > I used 'string-prefix?' to catch any GHC library (that we are > prefixing with 'ghc-...'). However, to compile such a library we need > GHC, so I think that 'string=?' should do.
Thinking again about this: In principle a user can install a 'ghc-...' library without having GHC in his profile. I'm not sure how practical this would be, but I don't see a good reason to not support this by not creating the cache. For this reason I would prefer to keep the '(any ...)' variant. Regards, Fede