From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sFIfAdqlVF+AegAA0tVLHw (envelope-from ) for ; Sun, 06 Sep 2020 09:03:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YBSeONmlVF8HWAAA1q6Kng (envelope-from ) for ; Sun, 06 Sep 2020 09:03:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5D0929404CB for ; Sun, 6 Sep 2020 09:03:21 +0000 (UTC) Received: from localhost ([::1]:41650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEqa0-0006NZ-Cj for larch@yhetil.org; Sun, 06 Sep 2020 05:03:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEqZt-0006ND-Bg for help-guix@gnu.org; Sun, 06 Sep 2020 05:03:13 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:29029) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEqZr-0001oT-Ay for help-guix@gnu.org; Sun, 06 Sep 2020 05:03:13 -0400 X-Originating-IP: 86.194.83.229 Received: from gnou.home (lfbn-lyo-1-1007-229.w86-194.abo.wanadoo.fr [86.194.83.229]) (Authenticated sender: d@divoplade.fr) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 2BCC4240003; Sun, 6 Sep 2020 09:03:06 +0000 (UTC) Message-ID: Subject: Re: How do I build a derivation with guix build? From: divoplade To: Timothy Sample Date: Sun, 06 Sep 2020 11:02:57 +0200 In-Reply-To: <877dt7aapz.fsf@ngyro.com> References: <908fa63077ee6cfe3174596099da22699d432e77.camel@divoplade.fr> <877dt7aapz.fsf@ngyro.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=217.70.183.193; envelope-from=d@divoplade.fr; helo=relay1-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/06 05:03:07 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: B0WXlR+eMlkI Hello, Le samedi 05 septembre 2020 à 22:40 -0400, Timothy Sample a écrit : > As I understand it, ‘gexp->derivation’ returns a value in the store > monad. I’m not sure why ‘guix build’ doesn’t know how to use it > directly, but you can get at the derivation by wrapping it with > ‘run-with-store’: > > (run-with-store (open-connection) > (gexp->derivation "the-thing" build-exp)) > > Don’t forget to use the ‘(guix store)’ module for this. OK, I think I understand: "you exit a monad like you exit a building on fire: by running" So, I cannot simply return a monadic value to guix build. It needs a real value. > > But! There’s a better way!! :) > > You can use the “declarative interface”. Just replace > ‘gexp->derivation’ with ‘computed-file’: > > (computed-file "the-thing" build-exp) > > Now there’s no need for ‘(guix store)’. Thank you, that was exactly what I was looking for! divoplade