all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Peter Oliver <p.d.oliver@mavit.org.uk>, emacs-devel@gnu.org
Subject: Re: Versioned Tree-sitter parser libraries
Date: Sun, 16 Apr 2023 20:03:50 -0700	[thread overview]
Message-ID: <AD5923E3-6D00-4AE6-B31A-FEDBA5EED4A6@gmail.com> (raw)
In-Reply-To: <83a5z7c262.fsf@gnu.org>



> On Apr 16, 2023, at 7:49 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> Date: Sun, 16 Apr 2023 15:20:51 +0100 (BST)
>> From: Peter Oliver <p.d.oliver@mavit.org.uk>
>> 
>> A number of Tree-sitter parsers include a Makefile that will install, e.g., /usr/lib/libtree-sitter-json.so.0.0.  However, I notice that Emacs 29.0.90 will find it only if there exists a symlink /usr/lib/libtree-sitter-json.so.
>> 
>> Is this desirable?
> 
> If we were to load a versioned shared library, how would Emacs know
> which version to load?

Another thing is that tree-sitter grammars don’t really have versions (API or ABI versions), except for a tree-sitter version.

> 
>> The background to this question is that I’m thinking about packaging Tree-sitter parsers as RPMs for Fedora (https://pagure.io/tree-sitter-json/blob/rawhide/f/tree-sitter-json.spec).  Typical Fedora practice (https://docs.fedoraproject.org/en-US/packaging-guidelines/#_devel_packages) is to assume that the unversioned symlink isn’t required for regular use, and to place it in a …-devel subpackage that wouldn’t usually be installed.
> 
> That practice is fine for when a program is linked against the
> library, because the -lFOO linker switch is supposed to take care of
> that, and Emacs doesn't need to know which version is being used.  But
> here we load the shared libraries at run time, so we must know their
> names.  These names are explicitly mentioned in the Emacs sources.


Since Emacs requests/hopes the package manager or the system will provide the grammars, it seems a good idea to support the common way libraries tend to be named. Even maybe just a additional look up for only xxx.0.0, since grammars don’t have ABI versions, at least for now.

Yuan


  reply	other threads:[~2023-04-17  3:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-16 14:20 Versioned Tree-sitter parser libraries Peter Oliver
2023-04-16 14:49 ` Eli Zaretskii
2023-04-17  3:03   ` Yuan Fu [this message]
2023-04-17 17:03     ` Eli Zaretskii
2023-04-17 18:41       ` Yuan Fu
2023-04-17 18:49         ` Eli Zaretskii
2023-04-17 20:17         ` Peter Oliver
2023-04-24  7:00           ` Yuan Fu
2023-04-24 11:05             ` Eli Zaretskii
2023-04-24 17:39               ` Yuan Fu
2023-04-24 18:47                 ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=AD5923E3-6D00-4AE6-B31A-FEDBA5EED4A6@gmail.com \
    --to=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=p.d.oliver@mavit.org.uk \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.