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 4DnEIZ9KUmBmIQAA0tVLHw (envelope-from ) for ; Wed, 17 Mar 2021 18:29:51 +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 MKKDHZ9KUmC9QAAAB5/wlQ (envelope-from ) for ; Wed, 17 Mar 2021 18:29:51 +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 B3B3827E60 for ; Wed, 17 Mar 2021 19:29:50 +0100 (CET) Received: from localhost ([::1]:51770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMavV-0003Fq-C7 for larch@yhetil.org; Wed, 17 Mar 2021 14:29:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMavH-0003Cb-9G for guix-devel@gnu.org; Wed, 17 Mar 2021 14:29:35 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:42640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMavF-00076h-JG for guix-devel@gnu.org; Wed, 17 Mar 2021 14:29:35 -0400 Received: by mail-wm1-x32b.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so1905788wmj.1 for ; Wed, 17 Mar 2021 11:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=8y1/rn6EluuZyGJmn8XOWT3yLoMOz2Cd4+Hg4BoXt4w=; b=p0w/IC5AYnOXEr6G85UpFxIYG3+lccHLsx8OborlEKaD4JnuxTljufOFRel014NwX0 UU/l+f24W1J77ACUXe/D3bmXfPmja1W/D/I/ZGoP9V75velvyHPk6chMsvXK1qdLL6g0 aEQzEBvB1ELuMifpkI1YZsfxm6Dnu1waRwhOhhXezYZszjJNatQq1/qjn1p9fClZQGrB qj5OJ9oj+Tjem98goUUg7dqP/1CVwVgsOm9XVfFV63lVWpa9AeMKa/TFqzXsV49jOTsO h5ES+7R77Zf1lG0ET9r0o6FWj4JLJVEbn6V3ZPVhHQMi5ukccHeg+NC3cuufBelzcLhv glTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=8y1/rn6EluuZyGJmn8XOWT3yLoMOz2Cd4+Hg4BoXt4w=; b=kt9uk/gj5W1krPVRIP3/c46+hUUThfOEDTvDYZHsXjZqFtEFrWvbzDPVCK1nsHiOem J6HtVLdLFgaUt3rZ5uwkA9t55lHZx4AdRf5ITcWFd1UwnBmG44pLLsaL6E8NPfuFNRdv wnxBWY/5+V34Mydrrqj8dLZZxyIYrBZJNOdjH5IN2g/CwzNpZ42f1u4SksZr7kwXSlc0 9fNc1yQ5BMi4un58BG7/GJRuNZMcDUnxSJHHn/c1uqsrI83cPgIBYFjJFd91cCmcqRbf aUL8st85Z55Qdui7POW7kLKMUZzTGLyiwhs+/M7IkU4IvwROCaAv5VwvGh+nOh9C5mlQ +7nQ== X-Gm-Message-State: AOAM530d6o5QoAXfcgxwVXcjkaUdDcG0DUb4CzgVkoEQxI99050HfatF AF1HgbuSfN0K/Ssi2bOkiv8QxQXqSKg= X-Google-Smtp-Source: ABdhPJwYZRTcgQIix0cug77N15Q+os2E7nKjR9Kodkzh8xor04+bU5XoVO+iXAbAlJJ81Cr0mO1lJg== X-Received: by 2002:a7b:c410:: with SMTP id k16mr117170wmi.121.1616005771787; Wed, 17 Mar 2021 11:29:31 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id 18sm3117303wmj.21.2021.03.17.11.29.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 11:29:31 -0700 (PDT) From: zimoun To: Konrad Hinsen , Guix Devel Subject: Re: Finding the store path of a package In-Reply-To: References: Date: Wed, 17 Mar 2021 19:27:44 +0100 Message-ID: <864kh9ws7z.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , 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=1616005791; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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:dkim-signature; bh=8y1/rn6EluuZyGJmn8XOWT3yLoMOz2Cd4+Hg4BoXt4w=; b=NBYJgvBG/9/dBOzvhyKoLMOk+IsZ26o4iB61D/xWEokXHadIAADZ5qfccoQ1goXeq4srKI 8YGFcE0qDvydjeaX6tgM66CnaNBDzVPFtEOPUVVZPtRRgVK3DxUEG2xoPR26nMTh6D4VTC FaBd7v7Qhr2HZXAr5hyRuOpqnypgfMqSuRAqKGUF5ULQlJnG1d3Gc4hC4fCXf5/vqIKwAT vaG9/gooax9CeoWVPK2q0JNQvuzsINv1J5+OJOd1hSSOwicIKWr4EtZkoJxFkppZjbXp0Z /VqY+Mc0Ju4wJArUGqvaANGeolP4a7+P+gGF/tGO1rQPTht1rfUAd8lNrz+6kw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616005791; a=rsa-sha256; cv=none; b=hNH+aORn2GRg0ZZFO4Tk/IF1bkIL/7xwD3QhMJUfckEFE26+JPrptv50k9rVn5W0ScBDzX 0UWjcv4FX8UaOsyn/Jt6i4/C0GQq63D3D77lhRgc71qx1pSkQQ2G8YHbSFIROCam3lEKCK 4Y9JX5OcAQ1/HBNi1SnBklgu96Q1kXJVaJCJTaj5mZqk769txiiZ+n/zlQcMzPbyKuupTg BzDIrkUVau85nYQdcrPulV1rtoz9Nz2PYOm+baujNk8vn3cyYDFzrRA1Yp/jHBnuiJevH7 7+E/h7tschtszqdJ0+7cwOMt7KgZzbemM67e6Brr2q6miZ+tDBxON1ogyjDDsw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="p0w/IC5A"; dmarc=pass (policy=none) header.from=gmail.com; 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: -3.10 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="p0w/IC5A"; dmarc=pass (policy=none) header.from=gmail.com; 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: B3B3827E60 X-Spam-Score: -3.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: zMVtAm3uPsHA Hi Konrad, On Wed, 17 Mar 2021 at 18:55, Konrad Hinsen wr= ote: > I wonder if there is a straightforward way to find the store path > corresponding to a package, assuming that the package actually is in the > store. I don't care if it's done via the CLI or via Guile code. does =E2=80=9Cguix build -n=E2=80=9D fit your use-case? > but it also downloads/builds the package if it's not yet in the store, > which is not what I want. In fact, I don't care what happens then the > package is not in the store. Returning a non-existing path is fine, > as is raising an error or returning #f. Well, =E2=80=99package-output=E2=80=99 in (guix packages) is what you need,= I guess. --8<---------------cut here---------------start------------->8--- $ guix gc -D $(guix build hello) 0.1 MB will be downloaded: /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10 substituting /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10... downloading from https://ci.guix.gnu.org/nar/lzip/a462kby1q51ndvxdv3b6p0rsi= xxrgx1h-hello-2.10 ... hello-2.10 51KiB = 454KiB/s 00:00 [##################] 100.0% finding garbage collector roots... [0 MiB] deleting '/gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10' deleting `/gnu/store/trash' deleting unused links... note: currently hard linking saves 20885.94 MiB $ guix repl GNU Guile 3.0.5 Copyright (C) 1995-2021 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guix-user)> ,use(gnu packages base) ; hello scheme@(guix-user)> ,use(guix packages) ; package-output scheme@(guix-user)> ,use(guix store) ; with-store scheme@(guix-user)> (with-store store (package-output store hello)) $1 =3D "/gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10" scheme@(guix-user)> ,q $ ls /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10 ls: cannot access '/gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10':= No such file or directory --8<---------------cut here---------------end--------------->8--- Hope that helps, simon