From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8FBKGoTYo2F+2wAAgWs5BA (envelope-from ) for ; Sun, 28 Nov 2021 20:29:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id mL34FYTYo2GaZAAA1q6Kng (envelope-from ) for ; Sun, 28 Nov 2021 19:29:08 +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 1AD222A351 for ; Sun, 28 Nov 2021 20:29:08 +0100 (CET) Received: from localhost ([::1]:37924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mrPrH-0005BG-6t for larch@yhetil.org; Sun, 28 Nov 2021 14:29:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrPrC-0005B7-Sy for guix-patches@gnu.org; Sun, 28 Nov 2021 14:29:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mrPrC-00033f-KQ for guix-patches@gnu.org; Sun, 28 Nov 2021 14:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mrPrC-0001tm-9b for guix-patches@gnu.org; Sun, 28 Nov 2021 14:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH 00/11] guix: node-build-system: Support compiling add-ons with node-gyp. Resent-From: Timothy Sample Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 28 Nov 2021 19:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51838 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Philip McGrath Cc: 51838@debbugs.gnu.org, Liliana Marie Prikler Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.16381276877233 (code B ref 51838); Sun, 28 Nov 2021 19:29:02 +0000 Received: (at 51838) by debbugs.gnu.org; 28 Nov 2021 19:28:07 +0000 Received: from localhost ([127.0.0.1]:36373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrPqJ-0001sb-Jk for submit@debbugs.gnu.org; Sun, 28 Nov 2021 14:28:07 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:37179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrPqG-0001rr-Gx for 51838@debbugs.gnu.org; Sun, 28 Nov 2021 14:28:05 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0159B5C013E; Sun, 28 Nov 2021 14:27:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 28 Nov 2021 14:27:58 -0500 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=fm1; bh=gbMgWU/TQTRjWYFIWByj2K5buZGSp9UB9RihvXRJ5 9M=; b=S28OYgey13Wu80/dQXVyzfHD/fdrPmrYMKTph6Nwowjd88wq8cPjdnW10 XqUW8pP1OyGJ7+9H3lssC3GqpSLoYDFjdS29vLCquicYWKrM0S6nePALyjST6MXj NR8Gk4em0UaWCO+Pvm41Lq8n8sHRZZPcaaN8J3dCrlDPfUuaUy/6fYqeb6JBMmx8 diTb+mWgwt9EcDozCjsukHS6sQXrF2/qaEqjXnQvzumuMRggjTxlcImxh6SJIBe7 vVQEB6Kvtwo0do6Fa8rsjmeFvTbiQjUqDNOI6y+FWAwgVYsteW5r3Ch0T/p4QrVq p3DQd9rO4CS7NH1R2ZHWWYC+/sCGQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrheeigdduvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufhfffgjkfgfgggtgfesthhqredttderjeenucfhrhhomhepvfhimhho thhhhicuufgrmhhplhgvuceoshgrmhhplhgvthesnhhghihrohdrtghomheqnecuggftrf grthhtvghrnhepieduuefhgeegleelveehgedugfeuhfeikefftdevieelgfelhfdvtdfg ieehtefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgrmhhplhgvthesnhhghihrohdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 28 Nov 2021 14:27:57 -0500 (EST) From: Timothy Sample References: <5a04aa92-e80d-e11b-235c-b7f5e3a92d00@philipmcgrath.com> <20211120043406.952350-1-philip@philipmcgrath.com> <20211120043406.952350-5-philip@philipmcgrath.com> Date: Sun, 28 Nov 2021 14:27:56 -0500 In-Reply-To: <20211120043406.952350-5-philip@philipmcgrath.com> (Philip McGrath's message of "Fri, 19 Nov 2021 23:33:45 -0500") Message-ID: <87tufwm66b.fsf_-_@ngyro.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638127748; 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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=gbMgWU/TQTRjWYFIWByj2K5buZGSp9UB9RihvXRJ59M=; b=Zak69iV0CJ5cQm0iABwQLWkplkUuzFfhvABBBEcRGPA57P3PU373irbjkvoQOpW/GbrSXg CeoTAKBP8SB12o63PqwcwhiYCtqKGvmY/It0u9TEXvXhCERYlM98vShD1axEyiCjJmSL2M 3oequS3g4LFE5dFZ8MTVdYy6SQPQedkwkYLY6wjNyZXljizIOU0Ns4A63AFUxN5oW2stqZ HRI41G4o3iXFWq32LQ1jPBod8S9YynqHtPaVhtqcG4avVYVFeV5EQHhN2MaXB0le88NfQF 8pycX2M/cIUFQqtXsqASuQbM1oeEIiTNoDq0W/8CyxIFsN2GvM0FbQ0tczm8WQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638127748; a=rsa-sha256; cv=none; b=PqWRKPEc7diPodai9aOLrV5NnRTVen90gKShsIVibB+IbRkCtjMBsR3EOn5RrDOI6VaHtn OhjggsBQ/56/sJAAeBnZ3k/47TJN2dGdsmNhA8tdlCPCHiveEvBJ8msvBMzzuJJnfnsHQ4 /vfh+L+6FZOf2ngdVxzFEW9CqvdlFn7PASc6K+SPlPCybYICgNCNy85a9ddThzozY/ptiG 1Ih1QpuqRyQtrIVW1DsmFzyN3AKqwCg+xW9PhQFsKBAqdke5LyzJD/5226NvknTCsvPcYB KicROdAQ1dlGoLhMMxk4ikhCY1W8gJ14LYwYKjFEtwS1KKy9Ck01mcOHXzkkUQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=S28OYgey; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.01 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=S28OYgey; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 1AD222A351 X-Spam-Score: -2.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: eiY2/QhVNbR2 Hi Philip, Philip McGrath writes: > - (define (resolve-dependencies package-meta meta-key) > - (fold (lambda (key+value acc) > - (match key+value > - ('@ acc) > - ((key . value) (acons key (hash-ref index key value) acc))= )) > + (define (resolve-dependencies meta-alist meta-key) > + (match (assoc-ref meta-alist meta-key) > + (#f > + '()) > + (('@ . orig-deps) > + (fold (match-lambda* > + (('@ acc) > + acc) > + (((key . value) acc) > + (if (member key absent-dependencies) > + acc > + (acons key (hash-ref index key value) acc)))) > '() > - (or (assoc-ref package-meta meta-key) '()))) > + orig-deps)))) There=E2=80=99s a lot of refactoring going here in addition to change at ha= nd. To me, it needlessly obscures the actual change (which is just the check for membership in 'absent-dependencies', AFAICS). > (with-atomic-file-replacement "package.json" > (lambda (in out) > - (let ((package-meta (read-json in))) > - (assoc-set! package-meta "dependencies" > - (append > - '(@) > - (resolve-dependencies package-meta "dependencies") > - (resolve-dependencies package-meta "peerDependencie= s"))) > - (assoc-set! package-meta "devDependencies" > - (append > - '(@) > - (resolve-dependencies package-meta "devDependencies= "))) > + ;; It is unsafe to rely on 'assoc-set!' to update an > + ;; existing assosciation list variable: > + ;; see 'info "(guile)Adding or Setting Alist Entries"'. Good catch! > + (let* ((package-meta (read-json in)) > + (alist (match package-meta > + ((@ . alist) alist))) Why do we have to unwrap (and then re-wrap later on) the alist? It would be nice to explain that in the changelog. Maybe it=E2=80=99s just me= , but I can=E2=80=99t figure it out! :) Thanks! -- Tim