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.devel Subject: Re: Versioned Tree-sitter parser libraries Date: Sun, 16 Apr 2023 17:49:41 +0300 Message-ID: <83a5z7c262.fsf@gnu.org> References: <462cd248-1269-ac55-bf94-f137b2c51697@mavit.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3291"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Peter Oliver Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 16 16:50:39 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 1po3iB-0000jD-MZ for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Apr 2023 16:50:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1po3hD-0003Yx-Rj; Sun, 16 Apr 2023 10:49:39 -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 1po3hB-0003Yh-VA for emacs-devel@gnu.org; Sun, 16 Apr 2023 10:49:38 -0400 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 1po3hB-0007QY-Ez; Sun, 16 Apr 2023 10:49:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=uamQx5KzQtQZVslv3zUWtJctkuYQ0ANkDS+LKFcbIGs=; b=Ugmuer+gNjqSIRCxBVRW LkEZ/j0xz5jUy/edpI2+z4NZ6czM6ddFEUywH6b3SjpAkHatA596C9Am57yq1NI+AK3IXy9vzNl98 dLvwHEkHqwQkdexEg/loDO6po6gdB4gCLsxTTKJNZADMNL7bYubwIC0oHEcydKstpFU1qM0Bv+4tp amcMx49FvpdmK1hzetYeUgRpytXd7Vz3O6KvJ8Ye26yckG3wrxGOfBedBUYIZ5SH324USPiDKE0Y2 kJAVf6fB9NmdQZnqkMvoJ0NLtgBbWgfRpLC2L/rgr4RlmyVmLW4+a3VzPAzVSGjB0Nj62K6SsvJuy o3W1s+360PBXEw==; 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 1po3hA-0003dy-RV; Sun, 16 Apr 2023 10:49:37 -0400 In-Reply-To: <462cd248-1269-ac55-bf94-f137b2c51697@mavit.org.uk> (message from Peter Oliver on Sun, 16 Apr 2023 15:20:51 +0100 (BST)) 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:305344 Archived-At: > Date: Sun, 16 Apr 2023 15:20:51 +0100 (BST) > From: Peter Oliver > > 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? > 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.