From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qHmOO+bFWGCdGAAA0tVLHw (envelope-from ) for ; Mon, 22 Mar 2021 16:29:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id cCBqN+bFWGBMNAAAB5/wlQ (envelope-from ) for ; Mon, 22 Mar 2021 16:29:26 +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 A57071DEC1 for ; Mon, 22 Mar 2021 17:29:26 +0100 (CET) Received: from localhost ([::1]:56096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lONQj-0001J2-Qr for larch@yhetil.org; Mon, 22 Mar 2021 12:29:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lONJj-0002iQ-6G for guix-devel@gnu.org; Mon, 22 Mar 2021 12:22:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33739) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lONJh-0002bQ-Ve; Mon, 22 Mar 2021 12:22:10 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43050 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lONJd-0000vS-Lo; Mon, 22 Mar 2021 12:22:09 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Konrad Hinsen Subject: Re: Finding the store path of a package References: <864kh9ws7z.fsf@gmail.com> <8735wq7xb4.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 Germinal an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 22 Mar 2021 17:22:03 +0100 In-Reply-To: (Konrad Hinsen's message of "Mon, 22 Mar 2021 08:39:13 +0100") Message-ID: <8735wnxiok.fsf@gnu.org> 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 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guix Devel Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616430566; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=b0rP+V8tps9aNtBjbflFL2nhFrZ1p6FqqHATmth4R+M=; b=T6pK/oSMfRPl3KpAbw2kHGOC1rW1XP6+DwZ+iuZ2e1BA85+szWN8iahvsLQIoHEPAlKsbP i8GJzPMIRvj15p8tnXOUJMTj9GMf9ZdTtZCpdw+anmh/QynFpFHqIf2jJNexm96GX8L/vN pt3ZGnBdht/O3eIZXqb6Jic5WlXa7H03BwXOV0LPBq04Aj02tBp/V8+7XPIerRYT3StOO/ NmxTzcZV41bSiqbv7COggwWlzhx6/BgAt5cT3pjpLYHmBl+/zVP2gj7VsXxw3Gi6vIBI4O omty236KodGugyz+d8qi0VuRyOIdNzeVsFUVREszhZSlJpUmwaCiYhsOjlIZ9A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616430566; a=rsa-sha256; cv=none; b=FoUA6YfP67iUSIgfQWdFxuhQl6AfeAi5fEV6z8oS7+Rkv2us4hviBQGxlx5UaPADdvXrwJ HoZmGy65AE9Lbw7SyjjT/6+VNSnETF7oFKEwXCAyaiR9ZF7UJ6DL/ou2LQaqi09cidtdi9 qTOx82LXXqkh8b9JO6JKRDJ4dc+Lgihv2PimjXxfs38xbl7gQORYl8WiFdPJ2HnNb99hrS 0rWKbyv6c/j3XAyGXmOybD3/oGm/E7/BCHBAXzeIipA6GiX1h+9EJRgKA04xIXJOr8Wych mDh38lOzWVKB76DKLHFNwk7u1IxY8t5sGXqHJ7+9/wDBIu1zr+MGaVqNe5lLxw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: A57071DEC1 X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3nssrUC1UAFj Hi Konrad, Konrad Hinsen skribis: >> Yes. In the presence of grafts, run =E2=80=9Cguix build PKG=E2=80=9D. = That always >> gives you the store file name of PKG, 100% reliable! > > At the cost of a few hours of CPU time, in the worst case. > >> I regularly do things like: >> >> ls $(guix build PKG)/bin >> find $(guix build PKG) -name =E2=80=A6 > > What I am looking for is the equivalent of > > ls $(guix build PKG) > > that fails in whatever way for packages that are not in the store, but > guarantees (1) not adding anything to the store and (2) response times > short enough for interactive user interfaces. > >> If you want a variant that does that without building/downloading it, >> it=E2=80=99s also possible, though not as easily from the command line. > > Guile is fine, no problem. But so far, I haven't found anything even at > the Guile level that respects my two conditions. Here=E2=80=99s an example of how to do that: --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> ,use(guix) scheme@(guix-user)> (define s (open-connection )) scheme@(guix-user)> ,use(gnu packages base) scheme@(guix-user)> (package-derivation s coreutils #:graft? #f) $1 =3D # /gnu/store/yvsd53rkbvy9q8ak6681hai62nm6rf31-coreutils-8.32-deb= ug /gnu/store/n8awazyldv9hbzb7pjcw76hiifmvrpvd-coreutils-8.32 7fc814f2e1e0> scheme@(guix-user)> (derivation-outputs $1) $2 =3D (("debug" . #< path: "/gnu/store/yvsd53rkbvy9q8ak= 6681hai62nm6rf31-coreutils-8.32-debug" hash-algo: #f hash: #f recursive?: #= f>) ("out" . #< path: "/gnu/store/n8awazyldv9hbzb7pjcw76= hiifmvrpvd-coreutils-8.32" hash-algo: #f hash: #f recursive?: #f>)) scheme@(guix-user)> (derivation->output-path $1 "out") $3 =3D "/gnu/store/n8awazyldv9hbzb7pjcw76hiifmvrpvd-coreutils-8.32" --8<---------------cut here---------------end--------------->8--- Why #:graft? #f? Because if you enable graft, you=E2=80=99ll potentially h= ave to build/download the thing, and that wouldn=E2=80=99t buy you anything bec= ause the set of file names is the same in the grafted package. Does that make sense? > Background: I am working on a interactive UI for running reproducible > computations via Guix: > > https://github.com/khinsen/guix-gtoolkit/ Nice! > I'd like to implement (1) browsing package contents ("what exactly do I > get by adding "core-utils" to my environment?") and (2) searching > packages by the files they contain ("which package do I have to add to > my environment to get the ls command?"). There will be a button for > explicitly building a package, but I don't want it to happen as a side > effect when doing operations that need to be fast. For #2, there have been discussions about building a service that would create such a database=E2=80=94a mapping from file names to packages. It= =E2=80=99s not possible to do with purely local knowledge because, by definition, you=E2= =80=99d have to build/download every package. I don=E2=80=99t think it has materia= lized yet, though. Thanks, Ludo=E2=80=99.