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: Sat, 23 Mar 2024 15:09:30 +0200 Message-ID: <8634shyu0l.fsf@gnu.org> References: <86r0g1zaqi.fsf@gnu.org> <61a44fd0-289c-4eed-aa04-05b34617f10f@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19183"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69952@debbugs.gnu.org, dancol@dancol.org, casouri@gmail.com To: Sergey Vinokurov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 23 15:11:06 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 1ro25S-0004pd-0Q for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Mar 2024 15:11:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ro24r-0001gs-Jv; Sat, 23 Mar 2024 10:10:29 -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 1ro24l-0001eA-3T for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2024 10:10:23 -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 1ro24k-0006ur-PF for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2024 10:10:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ro25P-00082K-TR for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2024 10:11:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Mar 2024 14:11:03 +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.171120301830763 (code B ref 69952); Sat, 23 Mar 2024 14:11:03 +0000 Original-Received: (at 69952) by debbugs.gnu.org; 23 Mar 2024 14:10:18 +0000 Original-Received: from localhost ([127.0.0.1]:59234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ro24f-000803-8D for submit@debbugs.gnu.org; Sat, 23 Mar 2024 10:10:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ro1U7-0005tC-94 for 69952@debbugs.gnu.org; Sat, 23 Mar 2024 09:32:32 -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 1ro17u-0004ed-UC; Sat, 23 Mar 2024 09:09:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=0Yx4ciWlz2Ous0YYqUCGsnXnFJOTNg/urEU47lqI+bw=; b=lLKIEig/Gv+s sOEL5B5pFrXSrUTZ2wwQv+352r+DNbXCxvMcBiAnwUf4yqquLPe/9d0EFLYLdKZwVpntUyriRC6Oi XDfSVWYdET+t749ScM/hE/7k+TpfKtt4sO1ZgwrWwCTPJ1ycdifVcJVt9w3Y1oUCvHHWPIpVvglhb 2DYe7bT72edXkZME1MPiUqcCaLolDRyiQE+MpprbJLGY6OXAC2yJ7BhvATx0DGFmDpjyYU2KtIYtx jxR/R8laPxzoTCL9QHldziQgFyTTaqLhBPoTcX6k/DaMGzLpXno+RbZGGBei0p/ZRg5/DSwqw5MWP P+oYUDQRuMpnVDLRxa9M5A==; In-Reply-To: <61a44fd0-289c-4eed-aa04-05b34617f10f@gmail.com> (message from Sergey Vinokurov on Sat, 23 Mar 2024 12:53:37 +0000) 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:281983 Archived-At: > Date: Sat, 23 Mar 2024 12:53:37 +0000 > Cc: 69952@debbugs.gnu.org, Daniel Colascione , > Yuan Fu > From: Sergey Vinokurov > > On 23/03/2024 07:08, Eli Zaretskii wrote: > >> Date: Sat, 23 Mar 2024 03:27:18 +0000 > >> From: Sergey Vinokurov > >> > >> This patch aims to allow more things to be dumped. In particular, > >> compiled treesitter queries can be easily dumped by storing their source > >> so that they will be recompiled on load. > >> > >> I noticed that in my config compiled quires are created somewhere which > >> prevents me dumping with standard Emacs build. But with this patch I can > >> dump successfully and not bother finding out who produced the queries. > >> > >> It seems like there should be no drawbacks in allowing more things to be > >> dumped, please correct me if I'm wrong. > > > > Thanks. I added Daniel and Yuan to the discussion, in case they have > > comments. > > > > And I have a question: what happens if the pdumper file dumped with > > tree-sitter available is loaded by an Emacs session in which > > tree-sitter is not available? That can happen on Windows, for > > example, if the tree-sitter library or the grammar library required > > for recomputing the query is not available. I think we need some code > > to prevent Emacs from crashing on startup in that case. > > According to c2ecb08775dc24618de507d2d1ce0f9b0debe17e, treesitter > queries are compiled lazily on fist use. When loading dump file in an > Emacs with missing grammar library the user should encounter an error on > first use of the query. > > Quick testing shows that dump file can be loaded even with grammar > definitions removed. Compiled queries are still there in elisp and > there's no error during load. OK, thanks.