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 mBStANDeiWKnfQAAbAwnHQ (envelope-from ) for ; Sun, 22 May 2022 08:57:20 +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 8COvANDeiWIjUgEA9RJhRA (envelope-from ) for ; Sun, 22 May 2022 08:57:20 +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 28A658981 for ; Sun, 22 May 2022 08:57:19 +0200 (CEST) Received: from localhost ([::1]:35292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsfWe-0002yt-Qr for larch@yhetil.org; Sun, 22 May 2022 02:57:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsfWa-0002xz-No for gwl-devel@gnu.org; Sun, 22 May 2022 02:57:12 -0400 Received: from sender4-of-o50.zoho.com ([136.143.188.50]:21053) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsfWY-0006zw-KM for gwl-devel@gnu.org; Sun, 22 May 2022 02:57:12 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1653202625; cv=none; d=zohomail.com; s=zohoarc; b=jHfslWnMwD1EdqOLWbFPDmlRchmYOMVE5grg3NonBhh1TDk6R+7Degv4QYU2Xo4KfDQLgT25QTl3YG9q5jAO7I6hW5obtMbe6xmJaN6Iy78QHqjBQ9hbo0/jrC4fifZUgFgH+HMGOhiHrmrsKbM2p8NSCszLQcbCb1CuN8t9JWM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653202625; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=1bDIK77v9ddFgVmZYMAM0Vn6VMTdkVS/g+U0yHQejnQ=; b=cPGa+lamGHzjEzIjSUY8o3IqxXmevt76y96LvaqfuSF4Z/U6hvpHGqfEDAFtUfUrZiDXzXKPDzh7GgMTiDDhoy2oqwdqTb1aNzsJYulqJtSCbfNZYkofShbgT2kv0NiIFVwM+DzvGKeZCz5pzAa1cRqhjmiNzenDUMEXC1oqtb0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1653202625; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:In-reply-to:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=1bDIK77v9ddFgVmZYMAM0Vn6VMTdkVS/g+U0yHQejnQ=; b=I5nQnCNJcz7BvAXd/ljIBWYjnZym/0d578xVubwsCbad94qJiMbRyRcQSN1Op0q5 VNRZtOIz494M0BDjmqGANRyDYYyxuB0+ykHACNrVavv0/WC7xaO1VNciMoQG+YFufgU jl9kz4c8n6oakaYDKE4ab17EKS6vtlMNjPCTQ/sY= Received: from localhost (i5E862DA1.versanet.de [94.134.45.161]) by mx.zohomail.com with SMTPS id 1653202623362360.72863959331187; Sat, 21 May 2022 23:57:03 -0700 (PDT) References: <20220422184359.7929-1-olivier.dion@polymtl.ca> <20220429180247.17830-1-olivier.dion@polymtl.ca> <20220429180247.17830-2-olivier.dion@polymtl.ca> User-agent: mu4e 1.6.10; emacs 28.0.50 From: Ricardo Wurmus To: Olivier Dion Cc: gwl-devel@gnu.org Subject: Re: [PATCH v3 1/1] packages: Support for full Guix specification Date: Sun, 22 May 2022 08:43:03 +0200 In-reply-to: <20220429180247.17830-2-olivier.dion@polymtl.ca> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Message-ID: <87h75ijbr7.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.50; envelope-from=rekado@elephly.net; helo=sender4-of-o50.zoho.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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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: gwl-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gwl-devel-bounces+larch=yhetil.org@gnu.org Sender: "gwl-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653202639; 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:dkim-signature; bh=1bDIK77v9ddFgVmZYMAM0Vn6VMTdkVS/g+U0yHQejnQ=; b=piOH+JL0RryTPkTDRV+OePdgAtH489C2PM4oAuDpdf6r+KmcydZsPMVCcClFdBAM9tnNEu S/lYtlmQHjApMeE/KgPuXgrZkINzC+3iCEQcwQSCR0fQOdri9ArbkEdE9qeE3zyjUWYwE4 pFt2p7GBt2KPnQxX63DClzy4h2Pb+Q8qmKGdnbD1EepsAZAAFHdaLhKINl+hSIS8EyNjQ4 7aBhIQK5GUE4JpSylzSIy5EVQKqdyKkdd9gM76Pn7Cfn9eQJdAmfkLto7BodJ3Jrp4VdZJ ACRJcFfO6iWsjsRbmFvkJDMmL6OcySiw+bHDznWcnFT5sepYBl3rxMKOftY2ZQ== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1653202639; a=rsa-sha256; cv=pass; b=Y/vSp2GWpkJGaA1O8Jp0YqNgVgyNWnUR5gsboX5oT6jAq8oXoi4fD/6BwfsCC4sWEskWnR RXnyz6Kzo+pqKOwp/r4PyPOVvplnl9YEs6mAWe/DahYY06vGPq2tsNcFP6X156GbsL7A0M I9Q+k4lYud0oAkGLzYlG5R7lT0UONAp7iMJk6NaBYj4eNXdcSF0a+EYTD21Z623ulEfn0Q jb2Ze9KKy0qC2uOKrxjPxU3sVce+goV8Z75ywkmhp/cR2DVJNfRz4d1xROMRb4T1/wwTjm Aax4RieS6TBLtTXBsbN5UZ1eI7Jp7P6bVFOx9vD27/29/kjdJWtOnaMbesK7Xg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=elephly.net header.s=zoho header.b=I5nQnCNJ; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.55 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=elephly.net header.s=zoho header.b=I5nQnCNJ; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 28A658981 X-Spam-Score: -6.55 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9OcIAm5Frkfq Hi Olivier, thanks for the new patch and my apologies for the delay! It looks fine, but I can=E2=80=99t help but feel a little confused about wh= at variables are actual package values and what are wrappers. Sometimes we have a variable called =E2=80=9Cpackages=E2=80=9D, but it=E2=80=99s seeming= ly always going to be package wrappers, so we map =E2=80=9Cpackage-unwrap=E2=80=9D. I wonder if there=E2=80=99s a way to hide this machinery somewhat. On the = other hand, =E2=80=9Cpackage-unwrap=E2=80=9D is a no-op for actual packages, so i= t doesn=E2=80=99t really matter. > +(define package-native-inputs > + (match-lambda > + ((? package? pkg) > + (package-native-inputs pkg)) > + ((? inferior-package? pkg) > + (inferior-package-native-inputs pkg)) > + ((? package-wrapper? pkg) > + (package-native-inputs (package-wrapper-package pkg))))) I=E2=80=99m confused about the naming. Is this a recursive application of PACKAGE-NATIVE-INPUTS? Or are these two different implementations of PACKAGE-NATIVE-INPUTS, one from GWL and the other from Guix? > (define (lookup-package specification) > (log-event 'guix (G_ "Looking up package `~a'~%") specification) > - (match (lookup-inferior-packages (current-guix) specification) > - ((first . rest) first) > - (_ (raise (condition > - (&gwl-package-error > - (package-spec specification))))))) > + (let-values (((name version output) > + (package-specification->name+version+output > + specification))) > + (let* ((inferior-package > + (lookup-inferior-packages (current-guix) > + name version)) > + (package (match inferior-package > + ((first . rest) first) > + (_ (raise (condition > + (&gwl-package-error > + (package-spec specification)))))))) > + (make-package-wrapper package output)))) I think this would be slightly improved by using SRFI-71 instead of LET-VALUES. SRFI-71 replaces LET and LET* so that you can assign multiple values without needing to be explicit about it. Since this procedure is now a bit more complicated I think it would be good to have a docstring that mentions the input and output values. > (define default-guile > (mlambda () > "Return the variant of Guile that was used to build the \"guix\" > package, which provides all library features used by the GWL. We use > this Guile to run scripts." > - (and=3D> (assoc-ref (inferior-package-native-inputs (build-time-guix= )) > + (and=3D> (assoc-ref (package-native-inputs (build-time-guix)) > "guile") first))) Is this correct? BUILD-TIME-GUIX has been changed so that the return value is an unwrapped wrapper =E2=80=94 so it really is an inferior package. Does PACKAGE-NATIVE-INPUTS refer to the implementation here or that in Guix? I think it would be best if we can make all this unambiguous. --=20 Ricardo