From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sFdmN2575mNEIwAAbAwnHQ (envelope-from ) for ; Fri, 10 Feb 2023 18:14:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OKhHN2575mOAywAA9RJhRA (envelope-from ) for ; Fri, 10 Feb 2023 18:14:22 +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 2E11E178C3 for ; Fri, 10 Feb 2023 18:14:22 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQWyL-0007Vm-03; Fri, 10 Feb 2023 12:14:05 -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 1pQWyJ-0007Vb-1h for guix-patches@gnu.org; Fri, 10 Feb 2023 12:14:03 -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 1pQWyI-0007lo-AL for guix-patches@gnu.org; Fri, 10 Feb 2023 12:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pQWyH-0001vB-Nm for guix-patches@gnu.org; Fri, 10 Feb 2023 12:14:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v7 01/32] gnu: tree-sitter: Move to its own module. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 Feb 2023 17:14:01 +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: Andrew Tropin Cc: "\(" , Pierre Langlois , 49946@debbugs.gnu.org, Luis Henrique Gomes Higino , zimoun Received: via spool by 49946-submit@debbugs.gnu.org id=B49946.16760492017329 (code B ref 49946); Fri, 10 Feb 2023 17:14:01 +0000 Received: (at 49946) by debbugs.gnu.org; 10 Feb 2023 17:13:21 +0000 Received: from localhost ([127.0.0.1]:38019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQWxd-0001u6-75 for submit@debbugs.gnu.org; Fri, 10 Feb 2023 12:13:21 -0500 Received: from mout.gmx.net ([212.227.15.15]:38525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQWxY-0001tr-Ua for 49946@debbugs.gnu.org; Fri, 10 Feb 2023 12:13:19 -0500 Received: from labiere ([82.69.64.142]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MtOKi-1oaLZz0HMs-00upRQ; Fri, 10 Feb 2023 18:13:09 +0100 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> User-agent: mu4e 1.8.13; emacs 28.2 From: Pierre Langlois Date: Fri, 10 Feb 2023 17:04:58 +0000 In-reply-to: <87cz6jgcku.fsf@trop.in> Message-ID: <87fsbdo34v.fsf@gmx.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:anvIUw9Z/UbdW6TwK8L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WSjOYbkNHFcMaabKRDNbGzQYjfPYuSXI/nYv6HBUH6 /d/x8rGdgCl4bm9LgZW5B5SbP5HlxBTuuSQsjQNyEv6h3n57PoKv9n2cmvIp7XAmArV1sCwMs 1R/COQ== 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676049262; a=rsa-sha256; cv=none; b=dAVaz4odCou6LJc16iapYuvFCpO0+WvTuUiQAM/cU4lNE0CuH1exhNVPQGIDqYGQ0VJcwD SoQ/zNc4K8FQNbY/lzUXOCuTNvs7uiYu7jtUkzNO5kvlbydJ690bMtsGMC621OHihU9yDG 5f9Lf6aiwsGuPZsIXwgSIn+3ancAqJOffoMbzFu9guKAhUdHEr46OexuRKVUyHwsYcnora 1ts5NYHhtSwXTk9OtoNFyR2ffH5+M7mS0LzNHfwfKHIRMtEx7TnRWDyo5F+q1KjR5IZg1m 46aytW68F+RQAKz7ogaEXc7w8acOg0h8KMHhu2Daodl5rG8EUE8Oh9JL8S0O7w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmx.com (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676049262; 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: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; bh=Ow5O1mTcLJdRMyrFwtVq3x+BgSuuX/aHLFrWxRppxLA=; b=jVW/NV6BBLloP/IMwYufbAIprrOIeyQvKIIxJe9IDZ0WcUlu2MMV9vX3wEl23wORYKWMoD KRlXmrLRCn8I18f+7zTl0FARzILBesD9me1ZsGzY9g4uanC/bcDyFuO6HlJV7JIeyx9lTz 6PZDRQwv7ieHmsnYvyuXRjHJX2QAOW5KqpFYyXCubSHpNDYxZQUwEH+R6yY+A9ZoNSVJuS cnUW+tFpvQ1M/wb4mqvwkKR4h9XOXTCyWGg9Pe6rF5d8bt6AK9mHLec//edWcXbNJh/yPF EX+85/CUudPQae9OopKtbumWbMCk1uGIOQl6T9jT1SuhBfpDxLI5yRVw5mESBw== Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmx.com (policy=none); 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" X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -2.21 X-Spam-Score: -2.21 X-Migadu-Queue-Id: 2E11E178C3 X-TUID: CiARw9GVKuEN --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain 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. What do you think of the following two patches? --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmPmeyAYHHBpZXJyZS5s YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31UX5kIAIrZysgv8hWcXNW4Jsu5EcWn wok8kyxdTQWA+WbISavEq142olVZSGNmrJhBLv/EvciUCyVnxBFH+U8ru50d00al 2kvqE1agfVRD7UwrZy19liPfH8rWGP1r8INRwuUR3SHiyIXv7ANhef1iFtTKMWNx 4mB8aVyPkV5jz1WQom6PIhpU/yx0xijSq6dL83qQTccPPdjcBARrjasv29ctNbOe ilnUJdroSd+72lJApV6mieLbYTLSFMsiJIPctX/ZnSorLPcLdEjZXSBUD6RC0Qbw 2LnavQAHyOnQLNskpBg1w/9Qf2H6ia/wTkL0gWkNQYAcKDVKo7Rxa0LFZtsuLAA= =753I -----END PGP SIGNATURE----- --==-=-=-- --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-Remove-tree-sitter-comment-from-emacs.scm-import.patch >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) -- 2.39.1 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-gnu-tree-sitter-cli-Enable-some-tests-and-add-node-a.patch >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 grammars. <#: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=tree-sitter\");~@ }~%"))))))) (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 encode + ;; which version of the grammars are expected. + ;; Instead, we do run some tests for each grammar in the tree-sitter + ;; 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=tests::corpus_test" + "--skip=tests::highlight_test" + "--skip=tests::node_test" + "--skip=tests::parser_test" + "--skip=tests::pathological_test" + "--skip=tests::query_test" + "--skip=tests::tags_test" + "--skip=tests::test_highlight_test" + "--skip=tests::test_tags_test" + "--skip=tests::tree_test") ;; We're only packaging the CLI program so we do not need to install ;; 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 incremental 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. -- 2.39.1 --=-=-= Content-Type: text/plain Thanks, Pierre --=-=-=--