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: Wed, 22 May 2024 15:55:50 +0300 Message-ID: <86ikz66m5l.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> <868r157wdy.fsf@gnu.org> <868r0phq6e.fsf@gnu.org> <493C3C1B-74F2-405D-830F-213B4D76DDC1@gmail.com> <86wmnrecr0.fsf@gnu.org> <61C9A0EB-D97D-4223-B257-FCA8DB150AA6@gmail.com> 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="28788"; mail-complaints-to="usenet@ciao.gmane.io" Cc: serg.foo@gmail.com, dancol@dancol.org, 69952@debbugs.gnu.org To: Yuan Fu , Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 22 14:57: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 1s9lWk-0007Fy-6n for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 May 2024 14:57:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9lWc-0005F9-Ng; Wed, 22 May 2024 08:56:58 -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 1s9lWb-0005Dn-2f for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 08:56:57 -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 1s9lWa-0002J8-QT for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 08:56:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s9lWg-0002QS-I5 for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 08:57: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: Wed, 22 May 2024 12:57: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.17163825709305 (code B ref 69952); Wed, 22 May 2024 12:57:02 +0000 Original-Received: (at 69952) by debbugs.gnu.org; 22 May 2024 12:56:10 +0000 Original-Received: from localhost ([127.0.0.1]:55806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9lVp-0002Q1-PB for submit@debbugs.gnu.org; Wed, 22 May 2024 08:56:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9lVn-0002Pv-3M for 69952@debbugs.gnu.org; Wed, 22 May 2024 08:56:08 -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 1s9lVb-0002ER-U3; Wed, 22 May 2024 08:55:55 -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=43XU39Np+IENhWfFRQbyOVX0hqp/qqxn9cFg2MMdOKc=; b=LJK+DNy/Ew3+YBkpKLGY xQGMWn47wyGr/IUK4H7Pv7XhEjKofFPKNAn4OoX/ayd4EdsaSOWfkxR3X7hf1oQPibmCPwTDiA0vH 2OIA3g27Cg1M62QKFiG7FEgJzziLoosOGyHhbl9x7PDmDDAWiF1PYYGYCsl8Ju1III+kZ4s2H7CC4 tQAXz4Up60JoH/HhpFYRVcmvHyVAsmmZgwI3J/rVGypC0TT/1Hej+9gvwYJF+i4KzX3Qv1vRQcpwn S3ayPDXC9fTLwHUxohCTO7JzDAx/FygXEu4ZqF9pt4PxfZPEcohWko4LCzeQc+pxOhbnUlmvvKaoc cZMgu8iPODrNlg==; In-Reply-To: <61C9A0EB-D97D-4223-B257-FCA8DB150AA6@gmail.com> (message from Yuan Fu on Tue, 21 May 2024 23:36: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:285611 Archived-At: > From: Yuan Fu > Date: Tue, 21 May 2024 23:36:47 -0700 > Cc: serg.foo@gmail.com, > dancol@dancol.org, > 69952@debbugs.gnu.org > > >>>> Yes, most likely a function-undefined signal, since all the treesit.c functions like treesit-query-capture or treesit-query-compile will be nonexistent. And usually the Lisp program trying to use the query would check for tree-sitter availability with treesit-available-p before trying to use any tree-sitter functions; so that signal will be usually avoided as well. > >>> > >>> Can you suggest such an addition to the patch? > >> > >> Let me take a look. > >> > >> Yuan > > Am I missing something? It seems the patch doesn’t include anything about loading a dumped query? Looks like that, yes. > I guess that’s the addition you’re talking about? If I want to add a special loader, where should I start? I guess in dump_do_emacs_relocation and/or dump_do_dump_relocation? Alternatively, perhaps it's better to define a hook via pdumper_do_now_and_after_load_impl or pdumper_do_now_and_after_late_load_impl, in which case the hook will be run after loading the dump file. This sounds easier if you can access all the loaded queries one by one, instead of catching them as they are being loaded. Andrea, can you help Yuan here? You have dealt with some of this when you added dumping and restoring of native-compiled CUs, so I guess you know your way better in pdumper.c.