From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id oAoPD34SDGY2lwAA62LTzQ:P1 (envelope-from ) for ; Tue, 02 Apr 2024 16:13:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id oAoPD34SDGY2lwAA62LTzQ (envelope-from ) for ; Tue, 02 Apr 2024 16:13:18 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fsfe.org header.s=2021100501 header.b=rTx2i14S; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fsfe.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712067198; 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=KpVz2XsfaT2Unpb54ux8MnLUUnHAkH17qk2c8YDvvC4=; b=EpooApRDdT5n0IYUyVC22oPnqLBOXGjpUQA71GVZKHckaTQH2nBcp0i3aM+HLm82SMQ5n4 6wHvE7Dwf79q/AYFrlD5tUoMDHIrmcRuohy79mQRFzEO4YvKyo3xiC1GsjitHoRaLxo8IO S2yKRvHxaFF7m69RQzRGMGVjTD0ltNX4b6pC+tj4ogllM2PeiXoeCecIaPYaMGFTPCwb8S hoUCn9+4MwWp2Xg1Hhvv4A4YwUbDBY/1kPG35Nll+K131+SI4nzf8c4YOIGVuenDhZZjJS AuFb2iF2jdF3R7KX/IofoTu8yaMOtwXfO8CwVlNDuWkzgMyelDF3ibypnV4pXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fsfe.org header.s=2021100501 header.b=rTx2i14S; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fsfe.org (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712067198; a=rsa-sha256; cv=none; b=OdpcH6p0fdINIp0eoU1IJcXJUN4Hbr40WUPBu8+sYSRMs1/xP2ivsPIdk74Yi8NyRMk2n0 3kudw7T3XE+t3/ObMccoQYetNIdJDTY2P/g5GPHzt4NhJikGUhjJ686rxxq26fWpe6MSTY WyhdoYjY9lNH7DND/11ct1rh7X4Z1LdE5sItsJ7MAhKXT4R+RSZ5W/7i/rusqYKuE0r5Rt NYMhtfyiopUdCnTdRXHpQo0kx+0Nshkep2Ac3R9V7ekeFGnUw3DoYGxtmLwJjT9G00UfG6 EBu7eK5DpYTRBid7fjoT7TxU9sNf+94ZUipJ1lzwPQyxGV410FTSVtd+RmYmCA== 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 ECDD16E02A for ; Tue, 2 Apr 2024 16:13:17 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rresn-00054W-Ab; Tue, 02 Apr 2024 10:13:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rresl-000545-A9 for guix-patches@gnu.org; Tue, 02 Apr 2024 10:12:59 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rresl-00071D-0c for guix-patches@gnu.org; Tue, 02 Apr 2024 10:12:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rreso-0007BZ-Hk for guix-patches@gnu.org; Tue, 02 Apr 2024 10:13:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62375] [PATCH v3] import: Add binary npm importer. Resent-From: Jelle Licht Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 02 Apr 2024 14:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62375 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch moreinfo To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Timothy Sample , Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Lars-Dominik Braun , 62375@debbugs.gnu.org, Christopher Baines , Ricardo Wurmus Received: via spool by 62375-submit@debbugs.gnu.org id=B62375.171206713827184 (code B ref 62375); Tue, 02 Apr 2024 14:13:02 +0000 Received: (at 62375) by debbugs.gnu.org; 2 Apr 2024 14:12:18 +0000 Received: from localhost ([127.0.0.1]:54840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rres4-000744-9J for submit@debbugs.gnu.org; Tue, 02 Apr 2024 10:12:17 -0400 Received: from mail1.fsfe.org ([2001:aa8:ffed:f5f3::151]:43980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rres0-00073h-Q2 for 62375@debbugs.gnu.org; Tue, 02 Apr 2024 10:12:14 -0400 From: Jelle Licht DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fsfe.org; s=2021100501; t=1712067125; h=from:from: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; bh=KpVz2XsfaT2Unpb54ux8MnLUUnHAkH17qk2c8YDvvC4=; b=rTx2i14SYn/dVXSzx99o0DNjGRR+OXYGe+Jlbu3a4QW8slxlN6X6HgHAjAVc4DHA2lEuxj xYMBausFEBh7QgTid9tY5I86jEm336lSlhUhrl+gQL6622qHO+ZL+W14kmUwqcVxT9nKfe b0yAet8qoQDpe2ThdfuA4nu/qPApaEo= In-Reply-To: <871q7odde1.fsf@gnu.org> References: <7148a74f04e1598a18b58fbd0b1b27a2397312b2.1711917305.git.jlicht@fsfe.org> <871q7odde1.fsf@gnu.org> Date: Tue, 02 Apr 2024 16:12:01 +0200 Message-ID: <87r0fng8ge.fsf@fsfe.org> 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: ECDD16E02A X-Spam-Score: -4.25 X-Migadu-Spam-Score: -4.25 X-Migadu-Scanner: mx10.migadu.com X-TUID: bhG20yCJYQm9 Hi Ludo', Thanks for the speedy review! Ludovic Court=C3=A8s writes: > Hi! > > jlicht@fsfe.org skribis: > >> From: Jelle Licht >> >> * guix/scripts/import.scm: (importers): Add "npm-binary". >> * guix/import/npm-binary.scm: New file. >> * guix/scripts/import/npm-binary.scm: New file. >> * Makefile.am: Add them. >> >> Co-authored-by: Timothy Sample >> Co-authored-by: Lars-Dominik Braun >> >> Change-Id: I98a45068cf5b9c42790664cc743feaa7ac76f807 > > Yay! > >> +The npm-binary importer also allows you to specify a version string: >> + >> +@example >> +guix import npm-binary buffer-crc32 1.0.0 >> +@end example > > For consistency with other importers (pypi, gem, cran), could you change > the syntax to: > > guix import npm-binary buffer-crc32@1.0.0 > > ? > > That=E2=80=99s the last remaining issue for me. > I needed some custom logic to support the npm scoped packages ("@linthtml/linthtml@1.2.3"), but it should now work. >> +;; TODO: Support other registries >> +(define %registry "https://registry.npmjs.org") > > For the purposes of tests, you could make it: > > (define %npm-registry > (make-parameter "https://registry.npmjs.org")) Easy! > That would allow you to write tests using =E2=80=98with-http-server=E2=80= =99 and > =E2=80=98parameterize=E2=80=99 as done in =E2=80=98tests/pypi.scm=E2=80= =99 and others, which I find > nicer and more robust than =E2=80=98mock=E2=80=99. The `with-http-server' construct does not play well with an interactive REPL workflow due to not cleaning up the used port in all situations, making that port unavailable for running the test again[1]. `mock', brittle as it may be, does not to suffer from this drawback, so I'd vastly prefer using that for now. > Not a blocker though. > > Thanks! > > Ludo=E2=80=99. I'll send a v4, let it simmer for some days and then merge it if no big blockers or requested changes show up. - Jelle