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 4EYfD4pMVF/aJAAA0tVLHw (envelope-from ) for ; Sun, 06 Sep 2020 02:42:18 +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 0FEFC4pMVF/0OQAA1q6Kng (envelope-from ) for ; Sun, 06 Sep 2020 02:42:18 +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 645659403CB for ; Sun, 6 Sep 2020 02:42:17 +0000 (UTC) Received: from localhost ([::1]:53672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEkdE-0006Ur-5i for larch@yhetil.org; Sat, 05 Sep 2020 22:42:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEkcy-0006UZ-47 for help-guix@gnu.org; Sat, 05 Sep 2020 22:42:00 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:51875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEkcw-0005ut-7W for help-guix@gnu.org; Sat, 05 Sep 2020 22:41:59 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D136B5C0110; Sat, 5 Sep 2020 22:41:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 05 Sep 2020 22:41:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=vf7zEtPICPIzqrzdZ5WCYPl3wLuecXfRGaHFOGXxE Bs=; b=S+xndpVLEs985ThJePHqx6RJ16eWbHpE+fHYtuIXop+yBfAYlnwJat7kg LBoyojKeAPmOLNyBri6OuUSSyS5rRnmhF5kOSezQrCBIFXNL5PixCCtz1zCJkcNN 1pKln5B4JxzJM/YCgJNd/2yIkOBWEnLBYC0/XOuY1owW9grAswfQ65QUf1YLbVRL zv+IRBkC/Ew3a//q2nCYNK3YOVwwFgiDk1us7d1eoeJ3zEcLmxk0+Kipw0fQIZhV YsLP3dau5CmsuBKhFkVRFU/uk9AX2/PuSO5HwJLzkkzBVAyhrP2xk3F02J5wpRed LI853fWXxGhZPFi39dTcW0yjys8dA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudegiedgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufhffjgfkfgggtgfgsehtqh ertddtreejnecuhfhrohhmpefvihhmohhthhihucfurghmphhlvgcuoehsrghmphhlvght sehnghihrhhordgtohhmqeenucggtffrrghtthgvrhhnpeeiudeuhfeggeelleevheegud fguefhieekffdtveeilefglefhvddtgfeiheetgfenucfkphepjeegrdduudeirddukeei rdeggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsrghmphhlvghtsehnghihrhhordgtohhm X-ME-Proxy: Received: from mrblack (74-116-186-44.qc.dsl.ebox.net [74.116.186.44]) by mail.messagingengine.com (Postfix) with ESMTPA id 28042328005D; Sat, 5 Sep 2020 22:41:55 -0400 (EDT) From: Timothy Sample To: divoplade Subject: Re: How do I build a derivation with guix build? References: <908fa63077ee6cfe3174596099da22699d432e77.camel@divoplade.fr> Date: Sat, 05 Sep 2020 22:40:56 -0400 In-Reply-To: <908fa63077ee6cfe3174596099da22699d432e77.camel@divoplade.fr> (divoplade's message of "Sat, 05 Sep 2020 22:15:57 +0200") Message-ID: <877dt7aapz.fsf@ngyro.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=66.111.4.27; envelope-from=samplet@ngyro.com; helo=out3-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/05 22:41:55 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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=pass header.d=messagingengine.com header.s=fm3 header.b=S+xndpVL; 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.21 X-TUID: Gle3YRvPecY6 Hi divoplade, As I understand it, =E2=80=98gexp->derivation=E2=80=99 returns a value in t= he store monad. I=E2=80=99m not sure why =E2=80=98guix build=E2=80=99 doesn=E2=80= =99t know how to use it directly, but you can get at the derivation by wrapping it with =E2=80=98run-with-store=E2=80=99: (run-with-store (open-connection) (gexp->derivation "the-thing" build-exp)) Don=E2=80=99t forget to use the =E2=80=98(guix store)=E2=80=99 module for t= his. But! There=E2=80=99s a better way!! :) You can use the =E2=80=9Cdeclarative interface=E2=80=9D. Just replace =E2=80=98gexp->derivation=E2=80=99 with =E2=80=98computed-file=E2=80=99: (computed-file "the-thing" build-exp) Now there=E2=80=99s no need for =E2=80=98(guix store)=E2=80=99. HTH! -- Tim divoplade writes: > Hello, > > I am still learning how to use gexps, and I thought that running this > would work: > > guix build -f example.scm > > with example.scm containing: > > (use-modules (gnu packages base)) > (use-modules (guix gexp)) > > (define build-exp > #~(begin > (mkdir #$output) > (chdir #$output) > (symlink (string-append #$coreutils "/bin/ls") > "list-files"))) > > (gexp->derivation "the-thing" build-exp) > > This is a copy of what's on the manual for explaining G-expressions. > > The guix build -f command should, according to the --help output: > "build the package or derivation that the code within FILE evaluates > to" > > However, I get an exception, "Wrong number of arguments to # 7f775f854f00 at guix/gexp.scm:1064:2 (state)>", after a backtrace that > does not even contains example.scm. > > What is going on? How do you build the derivation? > > Best regards, > > divoplade