From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oPAFLezGa2IfRAEAbAwnHQ (envelope-from ) for ; Fri, 29 Apr 2022 13:07:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id aFl6LezGa2L7QQAA9RJhRA (envelope-from ) for ; Fri, 29 Apr 2022 13:07:24 +0200 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 5507079F2 for ; Fri, 29 Apr 2022 13:07:24 +0200 (CEST) Received: from localhost ([::1]:39772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkOT5-0003F1-EG for larch@yhetil.org; Fri, 29 Apr 2022 07:07:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkNz3-0003a8-Kq for help-guix@gnu.org; Fri, 29 Apr 2022 06:36:22 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:46750) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkNyz-0007OA-5e for help-guix@gnu.org; Fri, 29 Apr 2022 06:36:19 -0400 Received: by mail-wr1-x436.google.com with SMTP id i5so10176934wrc.13 for ; Fri, 29 Apr 2022 03:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=KjubrpdjvkpCy4kpStQY+6irNkWxY4StQ7mqjIJ8k+E=; b=XMsi9XnRMkIKq4MVNDHva/eMfbTJ2F0+WHv28iCnZJq8BmE0RDdEyrZhIGLClrFwcz nlPElv+fszddVsoJhcWKmh3Nz5a2rMtPX3fFIBFCerzLDX5HxZRU+Zn/w0oSq1rhb8fP zfhKrI4LlyLyqzf9QCTkFSrNAL8FXIS8QGIv1j6drKFVCfPKV0Jcyf50IW9xk1nT+xio H2uvuCoiw6DhInItVY2W3VBT3GXZBwZ+cYyhJ+WYWAnvqMgv8AUGZMMf5cIzyLjFsox7 zLGax9V/rN+avjKxnFKJ6F/1ycA3ode7pFO/pRwSq0NSYIGH9fVPSGGTeVeJPBgfnqAP Eotg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=KjubrpdjvkpCy4kpStQY+6irNkWxY4StQ7mqjIJ8k+E=; b=UncSZmBILkJw9ws4P+EXDYzwbNcV782tdT+nAPJ/kYJteXHYG7Ic6Dlhpfk5Wibmb3 mYpZl1o6D48Q/d/mkD6vt8RYzd5IVb39RKXHyQSC1FUNPHbT0/azFoURlQ8RGagJ2kS4 DrFg4rMLuvj1dZrWi4Gjl432UqgDXmTl/Wj6fF6TaVUSi4tKSEPj2eI5Wjb8gaSSSMTs RoMmnr5LUnf8UB+NvdFQIlW7cu6k1Ni6WeoO4pvn44HL7q6mj/RitHji1ApLI8AHd3VF itdvT/WtXlj2sRt78AtlKOU1YtQhbKHueX93J6gC6zd7aTDRRrQQfjSxnzRQeupAWPPv Ua2A== X-Gm-Message-State: AOAM532U17nrtyjag3WRVaVakJ9KzHO7E12CZy7kLC25NHKqRQM27LNb Z5st/q6vcGXkScuH204/8BQ= X-Google-Smtp-Source: ABdhPJzcfe9/K0zARHUb71fFjZmpU9qt1nkEfRcVHaph/8Ao3ZDN86KZvdLK1fruxmYokcLLzHRduQ== X-Received: by 2002:a5d:4e92:0:b0:20a:cafc:ebf1 with SMTP id e18-20020a5d4e92000000b0020acafcebf1mr27692809wru.17.1651228575202; Fri, 29 Apr 2022 03:36:15 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id bh26-20020a05600c3d1a00b003928db85759sm2354359wmb.15.2022.04.29.03.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 03:36:14 -0700 (PDT) From: zimoun To: Olivier Dion , Maxim Cournoyer , Olivier Dion via , Ricardo Wurmus Subject: Re: Questions regarding substitutes with debug output In-Reply-To: <87mtg5qovg.fsf@laura> References: <877d7joe2w.fsf@laura> <87levx4ui1.fsf@gmail.com> <87ee1pur82.fsf@laura> <86mtg5eibr.fsf@gmail.com> <87mtg5qovg.fsf@laura> Date: Fri, 29 Apr 2022 10:49:47 +0200 Message-ID: <87ee1ge0k4.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::436; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x436.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651230444; 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=KjubrpdjvkpCy4kpStQY+6irNkWxY4StQ7mqjIJ8k+E=; b=HW2zC8wayCYCzuidX+/SiGJRnuWbRBaPLYi5K9TdctuSaxQ7JlN9TP0owHuut1m/ugH92J seiUUAtVVOsNywaRcy82PcYxeNDYUxgnblIILK2lRtlznDdFH1JUBHZIxdeD/85xwlLvUe BL/NiSqYFB1/9lcinaBNCYWgSn/VQ0bWFgc1cPidt6z2/ASrwv+bmcaeRRa8gSVNa80svx EpmUdYB38bcX+PXtxnwNyYuc+CT8ZDKesPwI1jhHM1Z6nRts6N8IcV0vFVoO7BYa6DjNoc P/bpljKxaNA1l70IoSwZeMn/E0qS0Ty/p2astVVjhNI+djq4xnODpgdcdpK17A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651230444; a=rsa-sha256; cv=none; b=VxfoXFVwPqEjImKjHVj1qdIzy1f5rx5dt4+p2MorZRWESifq7oKmVmDhuvFUIoXB5Egs/0 p1CXcGXeCbWgD2xsWrvp2KVhZ4yU1GbpQmq6R4nY4E9WrDo3klI1Lql8UWKj58UAB4/+Gr 6+ly06ekl75IVfgaCaVXkxh5NBd6CS2JYLair1/+FdKMXY0+oGLNe3omQIWI8Wo9q1Dvaz fAyfPjHkDOxkYsnSVmBhC8zInCA/Gkok72EuK2JU//3BLLYS8rzOLVydCVridQTBJCUJqY WPH2DzAKGw+dBg4pDwjLWUAjlNSmo9arlnq34u+ExK8FTUNpe4wQOBPK9IS2Iw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=XMsi9XnR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.50 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=XMsi9XnR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5507079F2 X-Spam-Score: -2.50 X-Migadu-Scanner: scn1.migadu.com X-TUID: hxnTLShFtcQC Hi Olivier, On Thu, 28 Apr 2022 at 10:11, Olivier Dion via wrote: > On Thu, 28 Apr 2022, zimoun wrote: > In my case, I prefer to avoid using package object directly. As > mentioned in GWL' manual, the version of Guix running GWL and the > version of Guix used by GWL (the inferior) might not be the same. Thus, > it is not okay for reproducibility in the long term. In my case, I use > `guix time-machine --channels` as the inferior. You wrote: I need to specify the package programmatically as a string in Guile. More specifically in the process packages field of Guix Workflow Language. so I do not understand why it would be an issue to deal with the package instead of the specification string. Because your need seems =C2=ABto specify the package programmatically=C2=BB. :-) >> Last, back to the feature you would like =E2=80=93 be able to write: >> >> (specifications->manifest (list "foo")) >> >> and select "foo" from your channel instead from upstream, right? Or a >> way to specify the channel using the symbol from the name field in >> , right? > > Correct. In fact as I mentioned above, I think having a way to select a > package variant -- e.g. if you've introduced an existing package in your > channel -- is a more generic way of describing it. Selection of channel > being only a type of metadata that can be used for selection of the > variant. More metadata could be added in the future as well. Well, I think you are =E2=80=9Coverengineering=E2=80=9C. :-) I am lacking o= f imagination about a channel containing several packages with the exact same name, version, output but applying a variation to =E2=80=99arguments=E2=80=99 or = =E2=80=99inputs=E2=80=99. About =E2=80=99arguments=E2=80=99, you need a short key as metadata, and th= e simplest is to put this key directly in the name or version or output. About =E2=80=99inputs=E2=80=99, it remembers me =C2=ABparameterized package= =C2=BB, e.g., see [1]. 1: . >> Aside the syntax of the string =E2=80=93 why not the one your are propos= ing =E2=80=93 >> and so adapt =E2=80=99package-name->name+version=E2=80=99 (or similar), = the function >> =E2=80=99find-best-packages-by-name=E2=80=99 requires some improvements. Rethinking about the feature request, what I would do: 1. channel with variants where each variant contains a =E2=80=99properties= =E2=80=99 (it is an association list describing whatever you want and kept as-is) 2. write a manifest.scm where I would filter by name and =E2=80=99properti= es=E2=80=99; probably using =E2=80=99fold-packages=E2=80=99. Well, #2 means write by hand my own version =E2=80=99find-best-packages-by-= name=E2=80=99. Maybe the API could have a function returning a list of packages from its arguments name, version, output *and* a =E2=80=99properties=E2=80=99 sp= ecification. >> What I am missing is the mapping from channel name to package. Well, >> Guix does not track this information at pull time. And I miss how to >> implement such mapping. Well, this mapping could be included as another =E2=80=99properties=E2=80= =99. When building the cache (~/.config/guix/current/lib/package.cache) with =E2=80=99generate-package-cache=E2=80=99, the cache already contains the mo= dule name=E2=80=A6 --8<---------------cut here---------------start------------->8--- (define expand-cache (match-lambda* (((module symbol variable) (result . seen)) (let ((package (variable-ref variable))) (if (or (vhash-assq package seen) (hidden-package? package)) (cons result seen) (cons (cons `#(,(package-name package) ,(package-version package) ,(module-name module) ,symbol ,(package-outputs package) ,(->bool (supported-package? package)) ,(->bool (package-superseded package)) ,@(let ((loc (package-location package))) (if loc `(,(location-file loc) ,(location-line loc) ,(location-column loc)) '(#f #f #f)))) result) (vhash-consq package #t seen))))))) --8<---------------cut here---------------end--------------->8--- =E2=80=A6but then it is not exploited by =E2=80=99specifications->manifest= =E2=80=99 and co, IIUC. All in all, maybe it is time to resume: :-) https://issues.guix.gnu.org/39258 Cheers, simon