From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Versioned Tree-sitter parser libraries Date: Sun, 16 Apr 2023 20:03:50 -0700 Message-ID: References: <462cd248-1269-ac55-bf94-f137b2c51697@mavit.org.uk> <83a5z7c262.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) 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="22949"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Peter Oliver , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 17 05:05:05 2023 Return-path: Envelope-to: ged-emacs-devel@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 1poFAu-0005kY-Qu for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Apr 2023 05:05:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poFA0-0003yW-OK; Sun, 16 Apr 2023 23:04:08 -0400 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 1poF9z-0003yN-GP for emacs-devel@gnu.org; Sun, 16 Apr 2023 23:04:07 -0400 Original-Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poF9w-0006i1-Fx; Sun, 16 Apr 2023 23:04:05 -0400 Original-Received: by mail-pj1-x1029.google.com with SMTP id v9so29439139pjk.0; Sun, 16 Apr 2023 20:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681700642; x=1684292642; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wKEn9sltNEZL3FNefvfQylglG83fOK1sxKojODda4ec=; b=MPqRo9E00U1WJTxkQirdaNrcfNp5S9Op8GA76c/czGMTHWCIB6mdBeAsveouFerz/k PyGZmQg5okcSsBzQ7QeH0VqszO51WxUr+fgYsj9Y9W1weGHe6s1tAFBwn3cqHOBhBZvZ lTKphn7mUJSPBdrPKH46vc/xcPIzqxjKs+pN1YTiC4VtrW8lK6gqViGHcpXKsOiJnDW+ RuDsJzXZ6sWfyAJVMeo/jGLq9/eJUiHYNalK2BGMY/KSJASaAKI/wsTNTSn7MisibGCI f327v/3jcf87LOdrM1u4UTaCl6/hoOcZ1GiSGXJq1nVxrfGNFMfjjT4RSnngMCgwi3PG omJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681700642; x=1684292642; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wKEn9sltNEZL3FNefvfQylglG83fOK1sxKojODda4ec=; b=LKLmBHvk/IZkb5j8cTipz2Abef5XHOW/sguRm3lSkUzJtCL/kX32I+jxTWF5oKLaLN LFxLIfY9jwnN/h+ZI9TvB4N5QIkSDNwV5yyMu6p2rhjdd4jXyKL85k7f7Mm5hXIQLkVh lPQcIf5mM90zHoLR0jCTE66bsk3Y71Rfg2Yj3pA83ILleNsDbRtIpoQ+yyxd713L7Mra N0L2tCTGxn7XhNBs3YAfcG4TXxBfLXWHf8HSHpQblFZIH/7wKI7+ViaTf6DYvUtaWu90 gZLdHV4H6yVjQckukjannJKi7PO7AOEvEjHqfwUpWPFgli4aO9TimAVvEJ48KSl0/lSI VoFQ== X-Gm-Message-State: AAQBX9dbaySOyPLSWx1UAYUwjDBt/B0nx8k8ExZLICXCMoLC614rb2h+ a9s7AwveW4e786WysVl/AOtvHOTykyN5pw== X-Google-Smtp-Source: AKy350aYWhsNkS5jsnQjOtR1O+2fe8kz91tSdCYdHoEAF7Q/bRekmQwjr3q2kmGtgRfFFWyDp75jbg== X-Received: by 2002:a05:6a20:cc46:b0:e9:353a:120 with SMTP id hq6-20020a056a20cc4600b000e9353a0120mr11145443pzb.15.1681700641948; Sun, 16 Apr 2023 20:04:01 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id i4-20020a6561a4000000b0050336b0b08csm5937231pgv.19.2023.04.16.20.04.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Apr 2023 20:04:01 -0700 (PDT) In-Reply-To: <83a5z7c262.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.500.231) Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=casouri@gmail.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305355 Archived-At: > On Apr 16, 2023, at 7:49 AM, Eli Zaretskii wrote: >=20 >> Date: Sun, 16 Apr 2023 15:20:51 +0100 (BST) >> From: Peter Oliver >>=20 >> 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. >>=20 >> Is this desirable? >=20 > 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=E2=80=99t really have = versions (API or ABI versions), except for a tree-sitter version. >=20 >> The background to this question is that I=E2=80=99m 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_package= s) is to assume that the unversioned symlink isn=E2=80=99t required for = regular use, and to place it in a =E2=80=A6-devel subpackage that = wouldn=E2=80=99t usually be installed. >=20 > 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=E2=80=99t have ABI versions, at least = for now. Yuan=