From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61849: 29.0.60; Unable to use treesit-install-language-grammar because repo doesn't have parser.c Date: Mon, 27 Feb 2023 22:00:48 +0200 Message-ID: <83o7peho9b.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25566"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61849@debbugs.gnu.org To: Misha Zharov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 27 21:01:30 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pWjgf-0006Xf-7J for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Feb 2023 21:01:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWjga-0005Du-Ec; Mon, 27 Feb 2023 15:01:24 -0500 Original-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 1pWjgF-00055i-PO for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2023 15:01:05 -0500 Original-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 1pWjgE-0001jE-Af for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2023 15:01:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWjgE-0001b9-5Q for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2023 15:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Feb 2023 20:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61849 X-GNU-PR-Package: emacs Original-Received: via spool by 61849-submit@debbugs.gnu.org id=B61849.16775280506118 (code B ref 61849); Mon, 27 Feb 2023 20:01:02 +0000 Original-Received: (at 61849) by debbugs.gnu.org; 27 Feb 2023 20:00:50 +0000 Original-Received: from localhost ([127.0.0.1]:48886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWjg1-0001ac-OC for submit@debbugs.gnu.org; Mon, 27 Feb 2023 15:00:50 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWjfy-0001aN-9T for 61849@debbugs.gnu.org; Mon, 27 Feb 2023 15:00:48 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWjft-0001f8-2j; Mon, 27 Feb 2023 15:00:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=BIxTiD3no6DEtTmQeZBKer8wqW0Rrb8KbvaktaDcC/U=; b=U+nfCi2zpoaG CGMVSET0GF/cBU9jeEYYNvf8vkCVHil8MAz0W9uEy3U/A1QjuA53+KouPF25lmteRtHNra681sL1M YwY60UGpl5PRN6aQjXfpzGxz/qCjS8Jr5oiyjP+G1f43Yg7fzXjWIBUkZZxAeMt/k+uymRpeIumoK /yw/TqP1wphI+FhmGlbtDE2xv39R7pIWgkSSbhU8JLZ1ugK+tSHpF5TtBIpW+CfaXCo/WzDlzmibk rS6bsJfGmxNS+fbZqlqcVNhI5LgU2J36J/9suSg4hgqnwrF8UTPsJYq/P/2kHp9T8ap2q3+JwrZXo Opq6qn08hhh8c6KyP9PuVg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWjfr-0002dj-KN; Mon, 27 Feb 2023 15:00:40 -0500 In-Reply-To: (message from Misha Zharov on Sun, 26 Feb 2023 23:34:57 -0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256909 Archived-At: > From: Misha Zharov > Date: Sun, 26 Feb 2023 23:34:57 -0800 > > Add (sql "https://github.com/m-novikov/tree-sitter-sql") to > treesit-language-source-alist. Then use > treesit-install-language-grammar. The following error occurs: > > Error encountered when installing language grammar: (treesit-error > Command: cc -fPIC -c -I. parser.c Error output: cc1: fatal error: > parser.c: No such file or directory compilation terminated.) > > This error occurs because we need to run a configuration step on the > repo to generate parser.c. I believe this is because we need to either > run `npm run generate` or `tree-sitter generate` to generate the > `src/parser.c` file. It would be nice if we could implement a patch to: > > 1. Allow users to specify a configuration step to configure the repo > before searching for parser.c (like passing a lambda into > `treesit-language-source-alist`) > 2. Allow users to specify a git hash that should be checked out before > the configuration step is run. I know currently different branches > are supported, but not all projects have release branches. > 3. Alternatively this function can be split into 2 function, the first one > would clone and configure the repository, and well as find the > required files. The second function would simply compile the required > files into the shared libraries, and move them to the appropriate location I'm not sure we should incorporate in Emacs so much of this specialized stuff. treesit-install-language-grammar is meant for doing the simple steps of compiling C/C++ sources in a boilerplate repository into a shared library. Anything significantly more complex should IMO be left to manual procedures by people who know what they are doing, especially if that requires to have specialized tools installed. (Btw, why not use https://github.com/DerekStride/tree-sitter-sql instead?)