GNU bug report logs - #69952
[PATCH] Support pdumping compiled queries by dumping their source

Previous Next

Package: emacs;

Reported by: Sergey Vinokurov <serg.foo <at> gmail.com>

Date: Sat, 23 Mar 2024 03:29:01 UTC

Severity: normal

Tags: patch

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Sergey Vinokurov <serg.foo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69952 <at> debbugs.gnu.org, Daniel Colascione <dancol <at> dancol.org>, Yuan Fu <casouri <at> gmail.com>
Subject: bug#69952: [PATCH] Support pdumping compiled queries by dumping their source
Date: Sat, 23 Mar 2024 12:53:37 +0000
On 23/03/2024 07:08, Eli Zaretskii wrote:
>> Date: Sat, 23 Mar 2024 03:27:18 +0000
>> From: Sergey Vinokurov <serg.foo <at> gmail.com>
>>
>> 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.




This bug report was last modified 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.