From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EKm+N1SH6GONIwAAbAwnHQ (envelope-from ) for ; Sun, 12 Feb 2023 07:29:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id BJfGNlSH6GM8agEAG6o9tA (envelope-from ) for ; Sun, 12 Feb 2023 07:29:40 +0100 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 A9C97F644 for ; Sun, 12 Feb 2023 07:29:40 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pR5rQ-0002LW-IW; Sun, 12 Feb 2023 01:29:20 -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 1pR5rC-0002LC-Pc for guix-patches@gnu.org; Sun, 12 Feb 2023 01:29:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pR5rC-0000Zm-GJ for guix-patches@gnu.org; Sun, 12 Feb 2023 01:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pR5rC-0004Dt-98 for guix-patches@gnu.org; Sun, 12 Feb 2023 01:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v7 01/32] gnu: tree-sitter: Move to its own module. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 12 Feb 2023 06:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49946 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Pierre Langlois Cc: "\(" , Pierre Langlois , 49946@debbugs.gnu.org, Luis Henrique Gomes Higino , zimoun Received: via spool by 49946-submit@debbugs.gnu.org id=B49946.167618331416193 (code B ref 49946); Sun, 12 Feb 2023 06:29:02 +0000 Received: (at 49946) by debbugs.gnu.org; 12 Feb 2023 06:28:34 +0000 Received: from localhost ([127.0.0.1]:43883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR5qj-0004D6-HA for submit@debbugs.gnu.org; Sun, 12 Feb 2023 01:28:34 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:54811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR5qf-0004Cq-TV for 49946@debbugs.gnu.org; Sun, 12 Feb 2023 01:28:31 -0500 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 1DAAE1BF207; Sun, 12 Feb 2023 06:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1676183303; 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: in-reply-to:in-reply-to:references:references; bh=eKSaulW4ECeG34p8b0lIjZSldFXQjWTsBCaeaGkhnOE=; b=DH2kUdLyRLpirSLR5dtDUibri3DYtRKXomdxUpKvPgvZmf42Emh29wio7JsJhA1dr8oI6M c1Ym0eJKKKlzBeyDST1uw3MBLLYKjMwgEIbQFDgR22pNlL/FX0IhvPurNx63/Ah3p1uCnC bxkQPgYKnIH1nH4ub+aQBCwdItKJxWpaXesDMKnCtojMsd6vywPzvu/u00bX/an3MIkvCR Mxzy3eP7X5AVmLfp75WWZuL7QCWOASme8Go7eFH7g5yXmxWGQH7otBBDahJRTVA+oumDU0 FqW/SGsuswzOHSicsR/nRhB3OuGmh6zomywrSpvMCLNb51hqmt/X/mNU5e1G0Q== From: Andrew Tropin In-Reply-To: <87fsbdo34v.fsf@gmx.com> References: <87mtfi63ut.fsf@gmx.com> <20221125012142.22579-1-pierre.langlois@gmx.com> <20221125012142.22579-2-pierre.langlois@gmx.com> <87bkovcp1d.fsf@gmx.com> <87h6vvgnd6.fsf@trop.in> <86pmaj3td2.fsf@gmail.com> <87cz6jgcku.fsf@trop.in> <87fsbdo34v.fsf@gmx.com> Date: Sun, 12 Feb 2023 10:28:17 +0400 Message-ID: <87h6vrfldq.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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-TUID: XjOPPKD+lSvu --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2023-02-10 17:04, Pierre Langlois wrote: > Hi, > > Andrew Tropin writes: > >> [[PGP Signed Part:Undecided]] >> On 2023-02-09 13:39, zimoun wrote: >> >>> Hi, >>> >>> On Thu, 09 Feb 2023 at 14:11, Andrew Tropin wrote: >>> >>>> I applied tree-sitter and tree-sitter-cli patches, >>> >>> Just to be sure to understand, you have only applied 02/32 and 05/32, >>> right? >>> >>> >>> [bug#49946] [PATCH v7 02/32] gnu: tree-sitter: Update to 0.20.7. >>> id:20221125012142.22579-3-pierre.langlois@gmx.com >>> http://issues.guix.gnu.org/msgid/20221125012142.22579-3-pierre.langlois= @gmx.com >>> >>> [bug#49946] [PATCH v7 05/32] gnu: Add tree-sitter-cli. >>> id:20221125012142.22579-6-pierre.langlois@gmx.com >>> http://issues.guix.gnu.org/msgid/20221125012142.22579-6-pierre.langlois= @gmx.com >>> >>> Leaving out all the others, right? >> >> Merged first 5 patches from 01 to 05, also added one more commit, which >> addresses some things from reviews and one commit, which adds html >> grammar. > > I had also started rebasing addressing comments on the tree-sitter-cli > package, and had a few extra changes left that haven't been pushed. > > I realised we could remove a now redundant comment, and while enabling > *some* tests, I realized we should directly depend on node and dot, so > that people may use the `tree-sitter' command, without needing them in > the same profile. Sounds very valid! :) > > What do you think of the following two patches? > I applied them locally and tested, LGTM. Will push them a little later with the rest of tree-sitter related changes. > From b24b04015261cfea2143be63671877c9c2c8d458 Mon Sep 17 00:00:00 2001 > From: Pierre Langlois Date: Fri, 10 Feb 2023 > 16:10:25 +0000 Subject: [PATCH 1/2] gnu: Remove tree-sitter comment > from emacs.scm imports. > > * gnu/packages/emacs.scm: Remove tree-sitter comment. > --- > gnu/packages/emacs.scm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm > index 4ce41deb88..4791570d12 100644 > --- a/gnu/packages/emacs.scm > +++ b/gnu/packages/emacs.scm > @@ -76,7 +76,7 @@ (define-module (gnu packages emacs) > #:use-module (gnu packages sqlite) > #:use-module (gnu packages texinfo) > #:use-module (gnu packages tls) > - #:use-module (gnu packages tree-sitter) ; for tree-sitter > + #:use-module (gnu packages tree-sitter) > #:use-module (gnu packages web) ; for jansson > #:use-module (gnu packages webkit) > #:use-module (gnu packages xml) > --=20 > 2.39.1 > > From 8225d51edeb528c51d30ad0f225eb96be5586a37 Mon Sep 17 00:00:00 2001 > From: Pierre Langlois > Date: Tue, 29 Mar 2022 20:13:11 +0100 > Subject: [PATCH 2/2] gnu: tree-sitter-cli: Enable some tests and add node= and > dot. > > * gnu/packages/tree-sitter.scm (tree-sitter-cli)[inputs]: Add graphviz and > node-lts. > [arguments]<#:cargo-test-flags>: Skip tests that require downloading gram= mars. > <#:phases>: Add 'patch-node and 'patch-dot phases. Tweak install phase. > --- > gnu/packages/tree-sitter.scm | 49 ++++++++++++++++++++++++++++-------- > 1 file changed, 39 insertions(+), 10 deletions(-) > > diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm > index 2e44339ca2..4331ffdd97 100644 > --- a/gnu/packages/tree-sitter.scm > +++ b/gnu/packages/tree-sitter.scm > @@ -24,7 +24,9 @@ (define-module (gnu packages tree-sitter) > #:use-module ((guix licenses) #:prefix license:) > #:use-module (gnu packages crates-graphics) > #:use-module (gnu packages crates-io) > + #:use-module (gnu packages graphviz) > #:use-module (gnu packages icu4c) > + #:use-module (gnu packages node) > #:use-module (guix build-system cargo) > #:use-module (guix build-system gnu) > #:use-module (guix gexp) > @@ -96,13 +98,30 @@ (define-public tree-sitter-cli > println!(\"cargo:rustc-link-lib=3Dtree-sit= ter\");~@ > }~%"))))))) > (build-system cargo-build-system) > - (inputs (list tree-sitter)) > + (inputs > + (list tree-sitter graphviz node-lts)) > (arguments > (list > - ;; Running test requires downloading fixtures, see the > - ;; script/fetch-fixtures script, which fetches grammars. Maybe it= make > - ;; sence to run tests in the grammar's packages? > - #:tests? #f > + #:cargo-test-flags > + ''("--release" "--" > + ;; Skip tests which rely on downloading grammar fixtures. It is > + ;; difficult to support such tests given upstream does not enco= de > + ;; which version of the grammars are expected. > + ;; Instead, we do run some tests for each grammar in the tree-s= itter > + ;; build-system, by running `tree-sitter test'. This isn't as > + ;; complete as running all tests from tree-sitter-cli, but it's= a > + ;; good compromise compared to maintaining two different sets of > + ;; grammars (Guix packages vs test fixtures). > + "--skip=3Dtests::corpus_test" > + "--skip=3Dtests::highlight_test" > + "--skip=3Dtests::node_test" > + "--skip=3Dtests::parser_test" > + "--skip=3Dtests::pathological_test" > + "--skip=3Dtests::query_test" > + "--skip=3Dtests::tags_test" > + "--skip=3Dtests::test_highlight_test" > + "--skip=3Dtests::test_tags_test" > + "--skip=3Dtests::tree_test") > ;; We're only packaging the CLI program so we do not need to insta= ll > ;; sources. > #:install-source? #f > @@ -132,11 +151,21 @@ (define-public tree-sitter-cli > (add-after 'unpack 'delete-cargo-lock > (lambda _ > (delete-file "Cargo.lock"))) > - (replace 'install > - (lambda* (#:key outputs #:allow-other-keys) > - (let ((bin (string-append #$output "/bin"))) > - (mkdir-p bin) > - (install-file "target/release/tree-sitter" bin))))))) > + (add-after 'unpack 'patch-node > + (lambda _ > + (substitute* "cli/src/generate/mod.rs" > + (("Command::new\\(\"node\"\\)") > + (string-append "Command::new(\"" #$node-lts "/bin/node\= ")"))))) > + (add-after 'unpack 'patch-dot > + (lambda _ > + (substitute* "cli/src/util.rs" > + (("Command::new\\(\"dot\"\\)") > + (string-append "Command::new(\"" #$graphviz "/bin/dot\"= )"))))) > + (replace 'install > + (lambda _ > + (let ((bin (string-append #$output "/bin"))) > + (mkdir-p bin) > + (install-file "target/release/tree-sitter" bin))))))) > (description "Tree-sitter is a parser generator tool and an incremen= tal > parsing library. It can build a concrete syntax tree for a source file = and > efficiently update the syntax tree as the source file is edited. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmPohwEACgkQIgjSCVjB 3rDX8Q//fq1bUPBoBeQsdHaLPP9tiNPlptv9SBf3kR8etAwXfbM4p3+AZxmnUbwV /JyHMqoNegDfpEya+7lGXkQ4vVGGgXx7HEK5DJ24wbXOWzUAOWAmAcXia5ssbKHx bsbxbFiq4lBrtx7rj6Zbd4cXkgNXso/aMqH5EKZ+f0aXiLE7EkkB6K+gq8Hh2J0k HrZg2+OrMxVP1xIub8MwqVbLpJLL5GSBlvh+DJ7HYW8ZTM6CI5tTkW7ai4fWXAJA /2iXpm/kLBMeTTApcCzdWt7/jpDXNtNq7SXLPWHdAe5K0yHD30zk2SpaMyaJzW/5 LjUQrtuW8oLG6+FhzQCV7o37lIQesewHYdCExHayEjjpv56wlLUogkl8YJGDjFmr se12rvlSKMEj07pdy3Z3aM6Wm9ci40ptBarK61SdNgWJI9vZExWnNwwVm7lviNm4 l3GdU2UuaWPiF/Ckp9JdODjmdKhA9q6qBkvUckoqxGuRmtszq89saI2UuzEuIclT bTKxuhAaCPxbKK6ybYSJQj3RdtDaoqP9OPffVN95XUeXKoBvQKyPQZNEIeFbz7iv /JmrJfCutSJfuDYsC3tmn/i6IWCghiB0SZAiQCxv5CdqNsS6dDNikFtksD0NtJvY zfT9K42b77KseaN/YH7rZ5eXwutL8GVQ1KNd4hEyfUlGUuZdpWM= =3LwD -----END PGP SIGNATURE----- --=-=-=--