From patchwork Mon Feb 17 23:43:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 38803 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3A06E27BBEA; Mon, 17 Feb 2025 23:50:01 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B9F1827BBE9 for ; Mon, 17 Feb 2025 23:50:00 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tkArK-0004ml-Bl; Mon, 17 Feb 2025 18:49:06 -0500 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 1tkArH-0004mE-Pi for guix-patches@gnu.org; Mon, 17 Feb 2025 18:49:03 -0500 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 1tkArH-0005EF-H1 for guix-patches@gnu.org; Mon, 17 Feb 2025 18:49:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=NtuTg8z9zba1Fd3x0v+TaQpa8SkpppNgaX0wQ4/eBLo=; b=HoPA4maYcz29Ze9JXx4EHGF3xi0nuPcCvUZIbD405CqKm/yoYit3N+2Cs/CXVHJBtR1klqbGwOVJeuBTOI7y8I2D83iBqwE4oyNM42JI58SsLIM5sdj7dtHQCFV2a3Zm2n0HcFRRd/WIXJ0j22p+Aga9HkHVqgffTVgE5xlfa29DHUMTJarOKqbw5EjahO3mbDBsRAdBRCmj7D33Pw66BqUtBURWCEUz3UrHI85LRKV3bZifXndspBneNBUtrRwKuOGKo+bCyHO4bgd+3GjlVlUuidHAZoRf/lhhTL8wMug9OOr2f8fpi831rIHrI8t1fw0DYsFq7aR0c4k80LSX2Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tkArH-0007PJ-Ax for guix-patches@gnu.org; Mon, 17 Feb 2025 18:49:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74900] [PATCH v2 3/6] build-system/node: Add guile-json extension. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Feb 2025 23:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74900 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74900@debbugs.gnu.org Cc: Nicolas Graves , jlicht@fsfe.org, d.khodabakhsh@gmail.com Received: via spool by 74900-submit@debbugs.gnu.org id=B74900.173983612528355 (code B ref 74900); Mon, 17 Feb 2025 23:49:03 +0000 Received: (at 74900) by debbugs.gnu.org; 17 Feb 2025 23:48:45 +0000 Received: from localhost ([127.0.0.1]:51170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tkAqy-0007NB-PB for submit@debbugs.gnu.org; Mon, 17 Feb 2025 18:48:45 -0500 Received: from 20.mo584.mail-out.ovh.net ([46.105.33.73]:58667) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tkAqm-0007LR-CA for 74900@debbugs.gnu.org; Mon, 17 Feb 2025 18:48:34 -0500 Received: from director3.ghost.mail-out.ovh.net (unknown [10.108.9.204]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 4YxfVk2vm2z1T7y for <74900@debbugs.gnu.org>; Mon, 17 Feb 2025 23:48:30 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-xm5dm (unknown [10.108.54.144]) by director3.ghost.mail-out.ovh.net (Postfix) with ESMTPS id CDAAF1FD86; Mon, 17 Feb 2025 23:48:29 +0000 (UTC) Received: from ngraves.fr ([37.59.142.113]) by ghost-submission-5b5ff79f4f-xm5dm with ESMTPSA id e9u0Ic3Ks2fpQQAA4Ix7sg (envelope-from ); Mon, 17 Feb 2025 23:48:29 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-113S00773bd109f-12d9-4f01-8be9-130c038e1307, C3652AECFC9F6A3CBC46B0867312B59102225E78) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Tue, 18 Feb 2025 00:43:54 +0100 Message-ID: <20250217234823.10533-4-ngraves@ngraves.fr> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250217234823.10533-1-ngraves@ngraves.fr> References: <20250217234823.10533-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 14613617842806317794 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdehleejjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeelffejteeutefhfeekfffffedvudekjeekgfeludeitdfhkeevhfeivdfhffeggeenucfkphepuddvjedrtddrtddruddpledtrdelvddruddujedrudeggedpfeejrdehledrudegvddruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjeegledttdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekgegmpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=NtuTg8z9zba1Fd3x0v+TaQpa8SkpppNgaX0wQ4/eBLo=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1739836110; v=1; b=usQvUBOpuEqvCFXlpjqOP3C7VXZXJkVVAsnv6DUG9MXxT9jEuQDyFWpf0cVbCY6fGH2rdsaI ujQS9XACj8GDK39WezzxiEuFGpcmWrdLhMe6Tjet5hImFSQ4iWq9JC+jgSNlPQYz4rebYo7vvFv 9VQOwI77H/KKUCMzdfiSJCGXTZFx0sess6xFrvDOIa7oAk6NhP2qPc2kc6l/0x82Y4b21+RZbT7 pjOeJXkTMl4VPYfj3qHLk0vDE9x9Jrg96/fsKyCnRCuz1MLwM2EetBpBy2yF8iupeNEjDRa7ghO zUo+4wtIC0ADcweTchGUcficHj/w/HN4d5D1gDYIsb/1Q== 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/build-system/node.scm (default-guile-json): New variable. (node-build): Use guile-json extension. --- guix/build-system/node.scm | 39 ++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/guix/build-system/node.scm b/guix/build-system/node.scm index 425b8cd9b3..240336ea35 100644 --- a/guix/build-system/node.scm +++ b/guix/build-system/node.scm @@ -80,6 +80,12 @@ (define private-keywords (build node-build) (arguments (strip-keyword-arguments private-keywords arguments))))) +(define (default-guile-json) + "Return the default guile-json package." + ;; Lazily resolve the binding to avoid a circular dependency. + (let ((mod (resolve-interface '(gnu packages guile)))) + (module-ref mod 'guile-json-4))) + (define* (node-build name inputs #:key source @@ -90,27 +96,28 @@ (define* (node-build name inputs (outputs '("out")) (search-paths '()) (system (%current-system)) - (guile #f) + (guile-json (default-guile-json)) (imported-modules %node-build-system-modules) (modules '((guix build node-build-system) (guix build utils)))) "Build SOURCE using NODE and INPUTS." (define builder - (with-imported-modules imported-modules - #~(begin - (use-modules #$@(sexp->gexp modules)) - (node-build #:name #$name - #:source #+source - #:system #$system - #:npm-flags #$npm-flags - #:test-target #$test-target - #:tests? #$tests? - #:phases #$phases - #:outputs #$(outputs->gexp outputs) - #:search-paths '#$(sexp->gexp - (map search-path-specification->sexp - search-paths)) - #:inputs #$(input-tuples->gexp inputs))))) + (with-extensions (list guile-json) + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) + (node-build #:name #$name + #:source #+source + #:system #$system + #:npm-flags #$npm-flags + #:test-target #$test-target + #:tests? #$tests? + #:phases #$phases + #:outputs #$(outputs->gexp outputs) + #:search-paths '#$(sexp->gexp + (map search-path-specification->sexp + search-paths)) + #:inputs #$(input-tuples->gexp inputs)))))) (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) system #:graft? #f)))