From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8Ex7C0l55mMAYQAAbAwnHQ (envelope-from ) for ; Fri, 10 Feb 2023 18:05:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wBRcC0l55mP5PwAA9RJhRA (envelope-from ) for ; Fri, 10 Feb 2023 18:05:13 +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 B623828CE7 for ; Fri, 10 Feb 2023 18:05:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQWpc-0004c2-UW; Fri, 10 Feb 2023 12:05: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 1pQWpa-0004bF-J7 for guix-patches@gnu.org; Fri, 10 Feb 2023 12:05:02 -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 1pQWpa-0005Yo-A1 for guix-patches@gnu.org; Fri, 10 Feb 2023 12:05:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pQWpa-0001hV-3b for guix-patches@gnu.org; Fri, 10 Feb 2023 12:05: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: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 Feb 2023 17:05: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: 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.16760486936519 (code B ref 49946); Fri, 10 Feb 2023 17:05:02 +0000 Received: (at 49946) by debbugs.gnu.org; 10 Feb 2023 17:04:53 +0000 Received: from localhost ([127.0.0.1]:38015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQWpQ-0001h3-W1 for submit@debbugs.gnu.org; Fri, 10 Feb 2023 12:04:53 -0500 Received: from mout.gmx.net ([212.227.17.20]:56999) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQWpM-0001gn-47 for 49946@debbugs.gnu.org; Fri, 10 Feb 2023 12:04:51 -0500 Received: from labiere ([82.69.64.142]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mq2nK-1omTAw1Q1K-00n9Ns; Fri, 10 Feb 2023 18:04:40 +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> <87a61lr8cp.fsf@trop.in> <87o7q1qzol.fsf@gmx.com> User-agent: mu4e 1.8.13; emacs 28.2 From: Pierre Langlois Date: Fri, 10 Feb 2023 17:02:31 +0000 In-reply-to: <87o7q1qzol.fsf@gmx.com> Message-ID: <87v8k9o3iz.fsf@gmx.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Provags-ID: V03:K1:+HDhHRYd4DYq7tufCaRgop3taPG226GhYcov2K8HcpeETpKRry/ denIlAKbXMnQHPiib/07yoHbHy/1hLW5gcohIXMKJTLBfv5vi7knghVDmvp2joOXyyAmPnO dAzueJVOs9x6AlQsYYRYHgnNKZtCCYk+a3aZ2mw6x2rKVF8X4ANm6qG473h6jlIB/ob02yY uEM/bKuCf2Uvj/7w0tZdg== UI-OutboundReport: notjunk:1;M01:P0:1dFQtBRPy/w=;0t11VpNJ/grlWhwv4EWaQJlyJQJ jzuPSMCO0TWsL8ZLp0Tz+g0smKpetlfnOHW3EQLh4ntd5ZMWQ0xC/X1LDiY3CK2VHYkbbJWuU CmuBO2QsYLwKr8wsCOndFhdHNylJSjPgiH5H/LOsDM8lOZLisDlJjKtlJ9AX6Kj8kXvQTTyWe BM+Nhi9Rnr6rbqGkGQj8hmH3TQqEJmY8Z+fk+uwrBVDVcSvELq0hCRLQ6cahGTjCAQNAvSDXv gJ4b8+8EC23aplWFGYdSagBAhgvZFKdutQcmkCCZwCIc1H+sx+ajZr8cDefTS4YLXxSIn5pMr yJ1j3qCH6asHoiZoSdMu/mgnisSMLaLkl67nlHucTCuJw9G51iXhBEsgl9oFKMEFc7YC6BZUR +qyUHNJAwvtgcwf1qd1VWymFRsOYowvRd9C0uv5KVoAcLHFCFlmH9MEMna0s0V3iFJhzcQiQR vHjcVucn0kutBrUDV4uNPh2kvRAnCARCFqwl1cHlpwdDFIMU8TOhT/ngtjS7tUX27peO+oAR1 p5/e9QH2BooL+ByQuBjLUQDMTm0QBlMAU2/IrbiNmeEqFiL2+eAx16xARSezXfduulYA8ksLU djJ5mm6dAlcWu/iOOzNNODJxgno4HU2N3mQ0MDgYBwuOtFsZF6vW65Y4sBAzt8KsxGhCcUssB mjewP80UK4iVcbIvWYKUaHrwYSMcBw4C9SPUcHO9J5Ji9/sHV7f0XCVKTBTF8CwdlihkZS+LA Jua+JbdwCyALfVnzEdddEr1eb4fKQkCQIvV5VxDt1DKRFtBse0mJAL/VziiLSYNpV0CuI1s0X gxzzG3K6asOYD8+ISIH2J2qgSrIV4bncVMBQDfFi8WsRMH2a3pFPpUbki5sz/tJMADTFYOugk 88NGnmlRKBdTeOQI3S1sDjeswW8gPovI0OlGh2Zc5on3P7w2av/8GMqC0zoTB6TBRZLZ9kR5S xnVyD4GxPgnK4N7eF2iZggUx/lE= 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=1676048712; a=rsa-sha256; cv=none; b=Yxunc5LDdVyCPW2yTNJaOa7vZ4NwkysoCulbD+j1Oib7lopxNMuQcX4Tmr5FujLVUD7VV3 F9Mhb958YfHP8HVzDodYs3BPJ5xDr8dGh882ymKLDhZjJ6nQ4jY3/V+lqH5QFdsVrTOTWT U708NI9R/sTAlALzdCS7EYej53wYThGukVm5D/d6QRhqoaK5AA2K2hoZ6U5btJfHvrEFzR 0zZhu/VONdC7ePNkDpMiDU1pezoXACuslkKVrH1Me7+LAjVT+lyDVvvLEj6N2rEJ0g7cWs yTJ8cnB1UvdDQrfU7U3qn+vkAcMhInWAToh3NeMwlRM6bPWFcyDQ8oR0NcSktg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmx.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676048712; 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=9UvWAOn/24LD6vrOe2sOZpYhd6rMAVUSrikNRste5OA=; b=rsuOnzzufmF1qOQ/2DlGxgcXhe5AgYWjgMtV0FUbpsTIMukk36VpTKnWfVcJjP2c2C9obV zCPjpc3wb2MCuxSp01i5m9fHAIpEo5ixQqUqSUduW+zdd+UCu7TwtEjRy4udRFtaNUvKl5 ygQKGbRmYu880pNDXpm/c8NmR7CHCNfuDB3wvqG5lsPGfsseJo1GW5ckiGCKGh9647oV8b OcsrucjCLDmL6fPVvmF7OiklkJKGYiS4aXp6jGQVJGRtIB8K/swKTZtx0TTa6LYEGUmZxC Kv61ikMWQFm5YdeFFZ82kzktPNfZmn6WMVlH1BnQI3WvowprIVafOcm12aKiBg== X-Migadu-Scanner: scn0.migadu.com X-Spam-Score: -2.21 X-Migadu-Queue-Id: B623828CE7 X-Migadu-Spam-Score: -2.21 Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmx.com (policy=none) X-TUID: YeUPfz2A0r+M --=-=-= Content-Type: text/plain Pierre Langlois writes: > [[PGP Signed Part:Undecided]] > Hi Andrew, thanks for pushing this along! It's great to see things > getting merged. > > Andrew Tropin writes: > >> [[PGP Signed Part:Undecided]] >> On 2023-02-09 18:04, Andrew Tropin wrote: >> >>> 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. >>> >>> The html grammar is added for the testing purposes. It relies on >>> generated parser.c and scanner.c and we will need to repackage it using >>> grammar.js instead. I'm not sure if a separate build system is needed >>> for this, I guess we can just rewrite tree-sitter-grammar function, >>> which generates packages as in example with tree-sitter-grammar-html: >>> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/tree-sitter.scm?h=53b00b91b73bd60412d5bd057e22e6d63194a7f7#n158 >>> >>> Anyway, I only skimmed tree-sitter-build-system source code, and plan to >>> read it carefully, evaluate and either introduce new build system or >>> just move all needed parts to tree-sitter-grammar function. WDYT? >>> After we done with it we can package all other grammars. >> >> Ok, I realized that the proper build process for tree-sitter grammars is >> a little harder than I expected, tree-sitter-build system make sense. I >> reviewed it, made a small change: > > Ah great, I was going to comment to try and push for us to keep the > build system. I originally went with a template package and inheritance, > but Maxime suggested moving to a build-system which ended up making the > package definitions a *lot* nicer IMO (see previous discussion here > https://issues.guix.gnu.org/49946#144). It also allows us to deal with > grammars that depend on each other more nicely I think. > >> >> @@ -29,7 +29,7 @@ (define-module (guix build tree-sitter-build-system) >> ;; Commentary: >> ;; >> ;; Build procedures for tree-sitter grammar packages. This is the >> -;; builder-side code, which builds on top fo the node build-system. >> +;; builder-side code, which builds on top of the node build-system. >> ;; >> ;; Tree-sitter grammars are written in JavaScript and compiled to a native >> ;; shared object. The `tree-sitter generate' command invokes `node' in order >> @@ -114,7 +114,7 @@ (define (compile-language dir) >> "-fno-exceptions" >> "-O2" >> "-g" >> - "-o" ,(string-append lib "/" lang ".so") >> + "-o" ,(string-append lib "/libtree-sitter-" lang ".so") >> ;; An additional `scanner.{c,cc}' file is sometimes >> ;; provided. >> ,@(cond >> >> >> rewrote html grammar to use this build system and made it work with >> built-in treesit package. Also, tried examples of c and cpp grammars >> from patches in this thread. >> >> If you ok with it, I'll push the build system to master and update the >> html grammar accordingly. Oh, I forgot to say, this change to the build system LGTM! I'm really happy to see it merged soon :-). The path change will probably break the emacs-28-based tree-sitter support, but that's OK, it's better for the build-system to be made to target emacs 29's builtin support. I'm sure I can work around for emacs 28. Thanks, Pierre --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmPmeSQYHHBpZXJyZS5s YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31U2NMIAKtMcusAtlfJdTuxpVzNPJCK SMiWLULheY6nGPuNqTrsLA8ZmKsD572JJwLVuT4DMB8Vsf4a2FaL9NPAblTiOgsj Ho9WXtdnQ966/sTz6TQLX2YV/7EkfCCAavDTMYrYtpeMnph8XC50/6dRPf65XwsU 35iifeIO6hIb8anTv1SWVxUtBFlMb8K0AILBfiCCWfhHP4gl6CHEYtCzzXIZs3iP uDq9bt0l34YhfXLeO4hbIv+bzF37JauhnlW0lxDY4sRcH83C66sVLVr7eUUNiuBu fanpQKDZDFwWANN+lhbUWOxw95RmMGu4/Cr3CW77r7ip+QA7zrw9z+VXUqI3URo= =beyk -----END PGP SIGNATURE----- --=-=-=--