From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 iJEfIeGB6GMbHAEAbAwnHQ (envelope-from ) for ; Sun, 12 Feb 2023 07:06:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 8pADIeGB6GPOcQAAauVa8A (envelope-from ) for ; Sun, 12 Feb 2023 07:06:25 +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 598AB1835 for ; Sun, 12 Feb 2023 07:06:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pR5V3-0007mG-73; Sun, 12 Feb 2023 01:06:10 -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 1pR5Uw-0007kV-I1 for guix-patches@gnu.org; Sun, 12 Feb 2023 01:06:04 -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 1pR5Uw-0003e5-9T for guix-patches@gnu.org; Sun, 12 Feb 2023 01:06:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pR5Uw-0003We-2e for guix-patches@gnu.org; Sun, 12 Feb 2023 01:06: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:06: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.167618194813527 (code B ref 49946); Sun, 12 Feb 2023 06:06:02 +0000 Received: (at 49946) by debbugs.gnu.org; 12 Feb 2023 06:05:48 +0000 Received: from localhost ([127.0.0.1]:43862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR5Uh-0003W6-MO for submit@debbugs.gnu.org; Sun, 12 Feb 2023 01:05:48 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:51549) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR5Ud-0003Vr-IG for 49946@debbugs.gnu.org; Sun, 12 Feb 2023 01:05:46 -0500 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 01F28FF802; Sun, 12 Feb 2023 06:05:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1676181937; 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=wkEvLKtZWpHLOWaNK/6v9q86ICJe/M4LUsjsGtWsfP8=; b=bYdGV9A0QQwH6JMT5ugHfn0YedAdcZEH+11A/zJ5Rx8VpEAeGuP883YmRVfa51lGsmvWZB CDSv9s0cAb7Kmmu/pKhuaRQN63oqJhvDkpXdvYbhqG8VV2XRFVBYlNYt+nftwPBVg90IKQ IQrrtOFRlsxGN5QIH8yhOJ7hqU8EM87s77r2msrrbt6FmKRTm91k8wzjpCxHKsp8hhD1fQ 21Og7aw/xrt0pi/XsXBCXFhJ2lsFymXn4siRYOKD23i/b6DzYG9P8ttTkBhK6YYInJ/Vn8 /oQiSi2oI6fb1di20tv/tNeIbQ4U8u1hqV+nn9Y3pDfhThtQ58rYPncmGg+mLQ== From: Andrew Tropin In-Reply-To: <87v8k9o3iz.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> <87a61lr8cp.fsf@trop.in> <87o7q1qzol.fsf@gmx.com> <87v8k9o3iz.fsf@gmx.com> Date: Sun, 12 Feb 2023 10:05:30 +0400 Message-ID: <87k00nfmfp.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: pRVZDZVMzq/B --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2023-02-10 17:02, Pierre Langlois wrote: > 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.langlo= is@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.langlo= is@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-sitt= er.scm?h=3D53b00b91b73bd60412d5bd057e22e6d63194a7f7#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 na= tive >>> ;; shared object. The `tree-sitter generate' command invokes `node' i= n 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. Actually, I think we can build grammars with both names, just providing two .so files instead of one. If you won't find a better workaround we can go this way. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmPogaoACgkQIgjSCVjB 3rCzYhAAhapiaBqqMI9uquCvZGkU4uQMxNu5pOQwndhO6o7tqdta1BI2N0new05f G5STYsZWqap5hT/lFaUf6zvJhQx8ypAxnWGYRVUOuwqWbx3ryu+2uIGcueO0Dp57 sh8lnB3SrmrJKrtm3iDZBi+14kpPC+HG4rHDyva87MyPUpuc3O6pwKrTT+mbxbam Ym3dj1M9+HJIU+/1/yj6ch5JxhgVKCiDdFZwRQCtdmXCEW3QnCdxjAzYfso6dxl8 fOsCWsCl5JdssfHwA+k4dlyyK5ljNDEWJpqc9uW7SvYGukQsi6UuXchUFcU9JFRj 9bC0txaMNh/B8c/Of6cQ+gub87htVLW7A7ylZcOJobkPqPwZutnOOvNfVt6yzIwg vaEDrBPfg8rXSpiP1sr3/2OI5KQp6mEGXSEYMRlYrhD3Pe8KMYJgo4Q/yK7cSvVX 7OciKztHrnH79Uvx72ZOUagIkANM3eaeXYrYd5cnAIBtE/gfbE6iTxr995oFZc+x iMTdbqgu2ha1KcAERsSDtRKvye+s3MTNay9ldqt6oIZhZ1QeCP2GRVt69FU6Jfd/ s7FYB2+FE/GD+aHvJaneZ+vTzSI00PFavOjPhmscNLAV3zENqpo6sbTzHcC2opE3 SLA4V2TIQRS2IoGLiPUKXpmeg9FmTmmXih/kk0NrkRpJEbgdTDg= =vT2W -----END PGP SIGNATURE----- --=-=-=--