unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Misha Zharov <mishazharov1@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 61849@debbugs.gnu.org
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	[thread overview]
Message-ID: <CAEzzQa8X==vi-_tJV+-n7BTmo4b0-HdjSBrpkayJoqX7et-JtA@mail.gmail.com> (raw)
In-Reply-To: <83o7peho9b.fsf@gnu.org>

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 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Misha Zharov <mishazharov1@gmail.com>
> > 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?)





  reply	other threads:[~2023-02-28  3:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27  7:34 bug#61849: 29.0.60; Unable to use treesit-install-language-grammar because repo doesn't have parser.c Misha Zharov
2023-02-27 20:00 ` Eli Zaretskii
2023-02-28  3:13   ` Misha Zharov [this message]
2023-02-28 12:04     ` Eli Zaretskii
2023-03-03 22:27 ` Yuan Fu
2023-03-04  7:06   ` Eli Zaretskii
2023-03-04 11:06     ` Eli Zaretskii
2023-03-04 20:52       ` Misha Zharov
2023-03-19  7:38       ` Eli Zaretskii
2023-03-20  5:14         ` Misha Zharov
2023-03-20 19:28           ` Eli Zaretskii
2023-03-20 20:04             ` Dmitry Gutov
2023-03-20 20:20               ` Eli Zaretskii
2023-03-20 22:01                 ` Gregory Heytings
2023-03-21  3:27                   ` Eli Zaretskii
2023-03-21  9:39                     ` Gregory Heytings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEzzQa8X==vi-_tJV+-n7BTmo4b0-HdjSBrpkayJoqX7et-JtA@mail.gmail.com' \
    --to=mishazharov1@gmail.com \
    --cc=61849@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).