From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#69952: [PATCH] Support pdumping compiled queries by dumping their source Date: Sat, 20 Apr 2024 01:08:15 -0700 Message-ID: References: <86r0g1zaqi.fsf@gnu.org> <86le5hr9oj.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34848"; mail-complaints-to="usenet@ciao.gmane.io" Cc: serg.foo@gmail.com, dancol@dancol.org, 69952@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 20 10:09:25 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 1ry5mm-0008tN-Va for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Apr 2024 10:09:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ry5mL-00012U-43; Sat, 20 Apr 2024 04:08: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 1ry5mD-00011n-6s for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 04:08:49 -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 1ry5mC-0005HQ-QA for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 04:08:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ry5mR-0000r2-29 for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 04:09:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Apr 2024 08:09: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.17136005313179 (code B ref 69952); Sat, 20 Apr 2024 08:09:02 +0000 Original-Received: (at 69952) by debbugs.gnu.org; 20 Apr 2024 08:08:51 +0000 Original-Received: from localhost ([127.0.0.1]:34972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ry5mD-0000ot-9k for submit@debbugs.gnu.org; Sat, 20 Apr 2024 04:08:51 -0400 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:47512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ry5mB-0000ni-HT for 69952@debbugs.gnu.org; Sat, 20 Apr 2024 04:08:48 -0400 Original-Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1e3ca546d40so24295395ad.3 for <69952@debbugs.gnu.org>; Sat, 20 Apr 2024 01:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713600507; x=1714205307; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=c2iahCzrSthO+v5mXTNzbyK6BPfZ+XZ9TxlTdQJvpYw=; b=Cu6txPyPMRfneoHp2QsjRsvUzaARIeX6rcdwh8PVZVhLURs+Tp+SZ6wrk81QqgTC7+ 1zJnuLELKSchAWorynrBzNWh6/CYZA2vzlygGhszdsmhc4zhWuTOtdHmM31PJtjASNqI wuo+C22jTEM13ulKtlxJdP0LFkCuwhT7tIvJSoU2F9ilho7/wsgV0+heNZNJvZhU6hia site16M6U/FLgyb2dEkKvYuBXLKE7jYeRvUuyhXScQjrgiquxIHwBl5ce8yT4YTdN9ks BdaFoLCxbfXu/u6o7WRCA0qLpeTX9Loz9MpFdXwIqgNwDnEt5vs9h+z1NKhmSDdIuRln 1SUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713600507; x=1714205307; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c2iahCzrSthO+v5mXTNzbyK6BPfZ+XZ9TxlTdQJvpYw=; b=e1caDBJSiXJPqr9LMyjfzM7UUqzIrVBi/FLd0jU/scdZHfEEAHjoR2A/vzIFBB6gSn Tpcp0EtdJ0Vj22/Bgsag4i50Y1hJzfOvVkjJP+nR8BnB9Njtsw9ZOKk7GFuHLr9Kcyyg YNN1jZG4Luy6/1SLcKtsmPZn2Z0a67CWoal8BC+KPVZ2lDDTX+ES8qpLsUxBtXgc8kw/ iTiDxIS9xMpx0LZb+vLrmx4Sc/0R7VhR4pLFxQkG2I2+hs4VfKWCh3bxWkqUqPKftYtt Zfq+lYwVgpC4E0YXmFNBflxFTnwsqNlxUnFdtOvPEtRlxYt4gqxemxhExaOWl6v73lUo Kh7Q== X-Forwarded-Encrypted: i=1; AJvYcCWhB+//BZmtXplTG0CCAITGyV1MXmnciSi3FCotfJ1dQkNuWiK783wO5a7ulx4V1WJbFJei7V2x2Pw0WWpW9r/lPbZfy3c= X-Gm-Message-State: AOJu0Yyda6fNzDfi9RGKti9VxaaaNP+ccemYxZG9X1EbOSdovsrofA2k 47mpcOjnXIjJTHDkyEUAIdJN50n+CIwNDk81ps8ROPpNbc/LMSbb X-Google-Smtp-Source: AGHT+IE3vjIo39KuHiNSv7SEgjQ5O7390ifBRq8J4d4Vj5ejzhgFhf+iltv4xbx87MI3cJ6ny/YNLg== X-Received: by 2002:a17:903:32cf:b0:1e2:23b9:eb24 with SMTP id i15-20020a17090332cf00b001e223b9eb24mr5240159plr.33.1713600506758; Sat, 20 Apr 2024 01:08:26 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:641:300:4910:21b4:7382:dc:3202]) by smtp.gmail.com with ESMTPSA id ba5-20020a170902720500b001e2b4f513e1sm4559456plb.106.2024.04.20.01.08.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Apr 2024 01:08:26 -0700 (PDT) In-Reply-To: <86le5hr9oj.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.700.6.1.1) 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:283720 Archived-At: > On Apr 13, 2024, at 12:41 AM, Eli Zaretskii wrote: >=20 > Ping! Daniel and Yuan, any comments on this proposal? >=20 >> Cc: 69952@debbugs.gnu.org, Daniel Colascione , >> Yuan Fu >> Date: Sat, 23 Mar 2024 09:08:21 +0200 >> From: Eli Zaretskii >>=20 >>> Date: Sat, 23 Mar 2024 03:27:18 +0000 >>> From: Sergey Vinokurov >>>=20 >>> This patch aims to allow more things to be dumped. In particular,=20 >>> compiled treesitter queries can be easily dumped by storing their = source=20 >>> so that they will be recompiled on load. >>>=20 >>> I noticed that in my config compiled quires are created somewhere = which=20 >>> prevents me dumping with standard Emacs build. But with this patch I = can=20 >>> dump successfully and not bother finding out who produced the = queries. >>>=20 >>> It seems like there should be no drawbacks in allowing more things = to be=20 >>> dumped, please correct me if I'm wrong. >>=20 >> Thanks. I added Daniel and Yuan to the discussion, in case they have >> comments. >>=20 >> 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. Yeah, being able to dump queries is certainly nice. There will be = problems if the Emacs session that later loads the query either have a = different grammar version loaded, or a difference grammar library for = the same language, or outright doesn=E2=80=99t have tree-sitter like Eli = mentioned. I don=E2=80=99t know if they are big enough problems to give = up dumping queries, though. Yuan=