From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests Date: Wed, 11 Dec 2024 18:53:08 -0500 Message-ID: References: <173310542049.252624.8341603519407599366@vcs3.savannah.gnu.org> <20241202021023.5060A521787@vcs3.savannah.gnu.org> <87plm7zwqx.fsf@gmx.de> <87jzce7f6y.fsf@gmx.de> <86ttbgj5k7.fsf@gnu.org> Mime-Version: 1.0 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="21508"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Michael Albinus , Emacs Devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 12 00:54:07 2024 Return-path: Envelope-to: ged-emacs-devel@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 1tLWWs-0005RG-Tk for ged-emacs-devel@m.gmane-mx.org; Thu, 12 Dec 2024 00:54:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLWVy-0000jI-E6; Wed, 11 Dec 2024 18:53:10 -0500 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 1tLWVx-0000io-CN for emacs-devel@gnu.org; Wed, 11 Dec 2024 18:53:09 -0500 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 1tLWVw-00023S-VF; Wed, 11 Dec 2024 18:53:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=JsgIHy1yZpcKV6SLdcrJrowQafSlvar2WmITfSmKq48=; b=GH4Ulf6TFW5Yyb2asqbo +H9mzmwxWQAwml9aXZv4Odj5MtJLg6pu45owKgITvZkvG/6QT1QJc43Bx4P4YRBR9R2y4kaza01+T iP5Hvv3rtH+IQmtexNLewwBe570A0ER/nVNWwKLy0m+H0LB6+XTMZIBn7KSFh/RszdzE9vGs2qj+L fADuoWxjCPdJ65sVb0D7NZkGfOmA1nMDOtez4ysjN5Nbgx6d/wsdM2QB4MfFDQRiJXeTklIH9u0Rb 7+E60EcM/z+aI0TpayUsjNgmYl9E6m7Aqwo/XY/KZyDF06TykVcKtLBvoMWeyU0Uc49ny3AL2qRG/ xO+AMVNTg1Kqjw==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1tLWVw-0008T2-A2; Wed, 11 Dec 2024 18:53:08 -0500 In-Reply-To: (Andrea Corallo's message of "Wed, 11 Dec 2024 18:50:46 -0500") X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326389 Archived-At: Andrea Corallo writes: > Yuan Fu writes: > >>> On Dec 6, 2024, at 11:49=E2=80=AFPM, Eli Zaretskii wrote: >>>=20 >>>> From: Yuan Fu >>>> Date: Fri, 6 Dec 2024 17:04:42 -0800 >>>> Cc: Emacs Devel , >>>> Andrea Corallo >>>>=20 >>>>=20 >>>>=20 >>>>> On Dec 5, 2024, at 11:30=E2=80=AFPM, Yuan Fu wrot= e: >>>>>=20 >>>>>=20 >>>>>=20 >>>>>> On Dec 4, 2024, at 11:37=E2=80=AFPM, Michael Albinus wrote: >>>>>>=20 >>>>>> Yuan Fu writes: >>>>>>=20 >>>>>> Hi Yuan, >>>>>>=20 >>>>>>> This is baffling. I assume the pipeline build the latest >>>>>>> tree-sitter-c/cpp grammar right? I just updated my grammar and >>>>>>> tree-sitter lib to the latest and the tests still pass on my >>>>>>> machine. Is tree-sitter version also the latest? >>>>>>=20 >>>>>> See test/infra/Dockerfile.emba. The emacs-tree-sitter container imag= e is >>>>>> created prior every run, the treesitter grammars mentioned there are >>>>>> installed. >>>>>=20 >>>>> Ah, so the image uses Debian bookworm, which AFAIK is the current >>>>> stable release, so it probably doesn=E2=80=99t have the latest tree-s= itter >>>>> library. Let me try to run the pipeline with tree-sitter built >>>>> from upstream. >>>>>=20 >>>>> Yuan >>>>=20 >>>> I didn=E2=80=99t run the pipeline built from upstream, but I tried run= ning >>>> the tests locally with the tree-sitter library used in the >>>> pipeline. The pipeline uses tree-sitter provided by bookworm, which >>>> is v0.20.7, a pretty old version. And indeed, with that version of >>>> tree-sitter I can see the test failure. >>>>=20 >>>> Andrea, which version of tree-sitter do you have on your test bench? >>>>=20 >>>> Since tree-sitter is still relatively unstable, maybe we want to use u= pstream tree-sitter for the test suite? >>>=20 >>> I don't think this is practical. I'd rather mark that test as >>> expected failure or "unstable", if we cannot know the version of the >>> tree-sitter library used for the test. >>>=20 >>> Or maybe you could rewrite the test so that it works in both old and >>> new versions of the library. >>>=20 >>> (FWIW, I use 0.20.8, with the latest grammar libraries, and the test >>> fails here as well. Due to the issues with ABI breakage in the >>> tree-sitter library, I decided that I will upgrade only when 0.25 is >>> released, because it also bumps the language ABI version, which we can >>> detect in Emacs.) >> >> I dug into it, and the culprit is a bug in older tree-sitter versions >> where (the C equivalent of) treesit-node-field-name-for-child gives >> the wrong field name. I rewrote the indent function so it uses child >> node index instead of field name to match indentation rules. Now the >> tests should pass. >> >> Yuan > > Confirm But introduces progmodes/c-ts-mode.el:379:13: Warning: the function =E2=80=98treesit-node-= check=E2=80=99 is not known to be defined. on non treesit configs :) Andrea