[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/7] guix build: Add 'build-package'.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH 6/7] guix build: Add 'build-package'. |
Date: |
Wed, 26 Aug 2015 13:12:54 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Alex Kost <address@hidden> skribis:
> Ludovic Courtès (2015-08-18 17:15 +0300) wrote:
>
>> Alex Kost <address@hidden> skribis:
>>
>>> * guix/scripts/build.scm (build-package): New procedure.
>>
>> [...]
>>
>>> +(define (build-package package . build-options)
>>> + "Build PACKAGE using BUILD-OPTIONS."
>>> + (with-store store
>>> + (let* ((drv (run-with-store store
>>> + (package->derivation package)))
>>> + (drvs (list drv)))
>>> + (apply set-build-options store build-options)
>>> + (show-what-to-build store drvs)
>>> + (build-derivations store drvs)
>>> + (show-derivation-outputs drv))))
>>
>> I think this doesn’t fit here because it isn’t actually used by ‘guix
>> build’. Maybe keep it in emacs/ for now?
>
> If you mean "guix-main.scm", I don't think it's the right place either,
> as all this guix-devel stuff does not depend on Guix REPL (or on any
> code from "guix-main.scm" in general). Besides, "guix-main.scm" doesn't
> provide a module.
>
> What about making some additional module?: (guix devel) or something.
> Other similar code may be put there in future. For example, you are
> editing a package definition and you may want to download the current
> origin source. It will probably also require some specific scheme code,
> which may be added to that module.
Maybe ‘build-package’ could go to (guix packages)?
>> Bonus points for making it all monadic-style:
>>
>> (mbegin %store-monad
>> (set-build-options* opts)
>> (mlet* %store-monad ((drv (package->derivation))
>> (drvs (list drv)))
>> (mbegin %store-monad
>> (show-what-to-build* drvs)
>> (built-derivations drvs)
>> (return (show-derivation-outputs drv)))))
>>
>> and (define set-build-options* (store-lift set-build-options)) in
>> (guix store).
>>
>> WDYT?
>
> OK, I'll look at it. I suppose adding 'set-build-options*' to (guix
> store) should be done in a separate commit, right?
Yes please.
Thank you,
Ludo’.