From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 6/7] guix build: Add 'build-package'. Date: Tue, 18 Aug 2015 16:15:03 +0200 Message-ID: <87zj1ou1i0.fsf@gnu.org> References: <1437814197-6321-1-git-send-email-alezost@gmail.com> <1437814197-6321-7-git-send-email-alezost@gmail.com> 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]:58067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRhfR-0000B0-OR for guix-devel@gnu.org; Tue, 18 Aug 2015 10:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRhfO-000857-Ax for guix-devel@gnu.org; Tue, 18 Aug 2015 10:15:09 -0400 In-Reply-To: <1437814197-6321-7-git-send-email-alezost@gmail.com> (Alex Kost's message of "Sat, 25 Jul 2015 11:49:56 +0300") 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: Alex Kost Cc: guix-devel@gnu.org Alex Kost 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=E2=80=99t fit here because it isn=E2=80=99t actually use= d by =E2=80=98guix build=E2=80=99. Maybe keep it in emacs/ for now? Also, it=E2=80=99s best to call =E2=80=98set-build-options=E2=80=99 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=E2=80=99.