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.bugs Subject: bug#69952: [PATCH] Support pdumping compiled queries by dumping their source Date: Mon, 22 Apr 2024 09:18:49 +0300 Message-ID: <868r157wdy.fsf@gnu.org> References: <86r0g1zaqi.fsf@gnu.org> <86le5hr9oj.fsf@gnu.org> <861q709y5y.fsf@gnu.org> <9B2A2190-AB42-4F1B-9F9D-5623B343CF0A@gmail.com> <86frvf8gf9.fsf@gnu.org> <86eday6j9o.fsf@gnu.org> 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="4073"; mail-complaints-to="usenet@ciao.gmane.io" Cc: serg.foo@gmail.com, dancol@dancol.org, 69952@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 22 08:20:13 2024 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 1ryn2C-0000pb-Fn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Apr 2024 08:20:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryn1p-0004oZ-80; Mon, 22 Apr 2024 02:19:49 -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 1ryn1m-0004nn-Q1 for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 02:19:46 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ryn1m-0001qC-HF for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 02:19:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ryn22-00022e-6s for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 02:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2024 06:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69952 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69952-submit@debbugs.gnu.org id=B69952.17137667697696 (code B ref 69952); Mon, 22 Apr 2024 06:20:02 +0000 Original-Received: (at 69952) by debbugs.gnu.org; 22 Apr 2024 06:19:29 +0000 Original-Received: from localhost ([127.0.0.1]:45524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryn1U-0001zx-Gg for submit@debbugs.gnu.org; Mon, 22 Apr 2024 02:19:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryn1R-0001yj-Es for 69952@debbugs.gnu.org; Mon, 22 Apr 2024 02:19:27 -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 1ryn0z-0001nW-Vv; Mon, 22 Apr 2024 02:19:03 -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=jkSmQjbEaoq33FNH2toVZC53STmSrtq4/eTlWaNt+Bo=; b=XQYNRFL+vpaw9SAtLhcP NIaolpng8zk85gpXYbe64gfPuVAbtoPNqgfIgU8127L36NVioy5yyR1iygvNRIsDnU9CXf1WXe6NR aFmsIzWUO+ke60iXojzpte3poRdBnreoyUpKqcZ62kYPnZqfnTrMRwyA9EQfoFCVDA1dPAjVYyQaY 6J6ULpiNCzhzZlRPEEKhs1OOVLNtcg8zg7cCy1txeSQL4WZDX3izM0NFUsjT/yL/VdewCg4y4D7g1 6WuehDJw0Sox6QQJGki3iPFFvp+eZf8MRxELyyC5vfhgTFW7fkPIDGeesC+i38TLenPDHHrhJSiCw pVDKBlRaUY8MXQ==; In-Reply-To: (message from Yuan Fu on Sun, 21 Apr 2024 23:04:47 -0700) 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:283804 Archived-At: > From: Yuan Fu > Date: Sun, 21 Apr 2024 23:04:47 -0700 > Cc: Daniel Colascione , > serg.foo@gmail.com, > 69952@debbugs.gnu.org > > >> No. You need both tree-sitter library and the grammar library. > > > > That's what I thought. So starting Emacs in that case will attempt to > > call a function from the tree-sitter library, and will segfault, > > right? If so, we should have some protection in the code in > > pdumper.c that loads queries, which tests that tree-sitter is > > availabale, and if not does something to prevent the segfault, like > > not loading the query, perhaps? > > Right, it can use Ftreesit_available_p (we can define a C equivalent if pdumper can’t call lisp), and decide whether to compile the query or just keep the query as a string, or signal an error? We cannot safely signal an error at that point, I think, so just keeping the query as a string should do, as it will then signal an error at run time when that query is used, is that right?