From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Misha Zharov 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 19:13:59 -0800 Message-ID: References: <83o7peho9b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="654"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61849@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 28 06:31:43 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 1pWsaU-000AXU-Hx for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Feb 2023 06:31:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWsZt-000178-12; Tue, 28 Feb 2023 00:31:05 -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 1pWsZr-00016f-Jm for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 00:31:03 -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 1pWsZr-00012U-Bo for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 00:31:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWsZr-0008UY-8E for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 00:31:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Misha Zharov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Feb 2023 05:31:03 +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.167756221632566 (code B ref 61849); Tue, 28 Feb 2023 05:31:03 +0000 Original-Received: (at 61849) by debbugs.gnu.org; 28 Feb 2023 05:30:16 +0000 Original-Received: from localhost ([127.0.0.1]:49481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWsZ5-0008TA-CW for submit@debbugs.gnu.org; Tue, 28 Feb 2023 00:30:15 -0500 Original-Received: from mail-ua1-f45.google.com ([209.85.222.45]:43985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWqRt-0004p9-Ix for 61849@debbugs.gnu.org; Mon, 27 Feb 2023 22:14:42 -0500 Original-Received: by mail-ua1-f45.google.com with SMTP id d12so177740uak.10 for <61849@debbugs.gnu.org>; Mon, 27 Feb 2023 19:14:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677554076; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=l5yz+VBzdPYfUNc+IXInQTt3J+Sih/RakvD7vkW/H+Y=; b=Z8ztuPssHYTYKTlCd2zmv1De2LGWK2zuJLo+YyoJGD8UsCUPuwsjroIi8NK70EBJ8Y 2Pf1Y0nT51fkdPZgYcikV0IoH22voUjxzDQslEakED+OsBTaK/ZuTDNzCmvZ+YvvmYEc HZ3gpAbgANCOkCKk5/NilCBf0zh+38neSqg6VxqY7TeB8YKkOY+F0pjV/ni5QGIsfefU hiis+SkT9DWewi2c+Rj/51mpEb/exq7AIor75MqUzYJZ4TinxBCZm+H+DEnwcv6G/iH8 txTTLegVmdtcbzYMRJcUyJSpnXWmZBHa0x268c/zjzFtTA+p88eD4XmTsK29Ao4SLyq1 laAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677554076; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l5yz+VBzdPYfUNc+IXInQTt3J+Sih/RakvD7vkW/H+Y=; b=W3knVoHm9+pRfhMjVz21JGooyzD6Q55RUWk7xIyh2j8iWBHXexDTqzpbE29Ev94hmb R64aoxznTGPwBnEOchaQfyLjr06h4f1fUG9VLEXg+R7iFEPofDh2UbSNKjp459cKv5Mb 5NceOuIZOFJDNuERLZWUje/NqsmD7bWSMpOLp+51eCrhnMxOUce7yi9aBJoTfPxfwwz+ nQRgZ6bG+rgK7QknmOFID+UXbst66XI9XYUjMSZQsLv3JejesL/nkyBh/XgOsXKOcq5P MBmkFprgZLCy8ggdYasMt8/zAJceufjiJ70vnuQV5IS2OGKrhS8nGN7jc+3eF87fOVm3 qmog== X-Gm-Message-State: AO0yUKUaxFuTOBGIlz5jNtrEtFdSjgOqj0F3hfz/TBIAdpkx8qtKpSM1 8lFYMZ0EcnfBHbjQlILcOfFxFWNv0sBORh1v9hA= X-Google-Smtp-Source: AK7set+4pemCQ9/tOHukPKxJvMrEW5Kq/JHtEG0mt3L0hD1gPf/4r7ILsgRls/LBRGYGVA2Onuqon2A2awYBdoHXabc= X-Received: by 2002:a05:6122:21a4:b0:3ea:b7e1:fb29 with SMTP id j36-20020a05612221a400b003eab7e1fb29mr1627476vkd.0.1677554075723; Mon, 27 Feb 2023 19:14:35 -0800 (PST) In-Reply-To: <83o7peho9b.fsf@gnu.org> X-Mailman-Approved-At: Tue, 28 Feb 2023 00:30:10 -0500 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:256933 Archived-At: Thanks for getting back to me > (Btw, why not use https://github.com/DerekStride/tree-sitter-sql > instead?) I just landed on the other one first, no particular reason. Initially it worked until they removed the autogenerated code that was in the repo. As a workaround I can switch to the sql grammar that you have recommended, but the problem might occur again in other repos. > I'm not sure we should incorporate in Emacs so much of this > specialized stuff. That's fair, but I fear that more repos will remove the autogenerated parser code, which will make treesit-install-language-grammar much less useful. Perhaps this won't occur often, but I wanted to consult on a possible solution. However, since this appears to be working as intended, then that is okay as well. Thanks for taking the time to look into this. On Mon, Feb 27, 2023 at 12:00=E2=80=AFPM Eli Zaretskii wrote= : > > > 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 befor= e > > 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 firs= t one > > would clone and configure the repository, and well as find the > > required files. The second function would simply compile the requ= ired > > 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?)