guix-devel
[Top][All Lists]
Advanced

[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: Tue, 18 Aug 2015 16:15:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

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?

Also, it’s best to call ‘set-build-options’ before anything else, to
make sure all the options are taken into account.

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?

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]