From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Michael Albinus <michael.albinus@gmx.de>,
Emacs Devel <emacs-devel@gnu.org>,
acorallo@gnu.org
Subject: Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests
Date: Tue, 10 Dec 2024 22:15:32 -0800 [thread overview]
Message-ID: <A08D55EA-FA37-4C4F-A1F1-830F724075C7@gmail.com> (raw)
In-Reply-To: <86ttbgj5k7.fsf@gnu.org>
> On Dec 6, 2024, at 11:49 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Fri, 6 Dec 2024 17:04:42 -0800
>> Cc: Emacs Devel <emacs-devel@gnu.org>,
>> Andrea Corallo <acorallo@gnu.org>
>>
>>
>>
>>> On Dec 5, 2024, at 11:30 PM, Yuan Fu <casouri@gmail.com> wrote:
>>>
>>>
>>>
>>>> On Dec 4, 2024, at 11:37 PM, Michael Albinus <michael.albinus@gmx.de> wrote:
>>>>
>>>> Yuan Fu <casouri@gmail.com> writes:
>>>>
>>>> Hi Yuan,
>>>>
>>>>> 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?
>>>>
>>>> See test/infra/Dockerfile.emba. The emacs-tree-sitter container image is
>>>> created prior every run, the treesitter grammars mentioned there are
>>>> installed.
>>>
>>> Ah, so the image uses Debian bookworm, which AFAIK is the current stable release, so it probably doesn’t have the latest tree-sitter library. Let me try to run the pipeline with tree-sitter built from upstream.
>>>
>>> Yuan
>>
>> I didn’t run the pipeline built from upstream, but I tried running 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.
>>
>> Andrea, which version of tree-sitter do you have on your test bench?
>>
>> Since tree-sitter is still relatively unstable, maybe we want to use upstream tree-sitter for the test suite?
>
> 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.
>
> Or maybe you could rewrite the test so that it works in both old and
> new versions of the library.
>
> (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
prev parent reply other threads:[~2024-12-11 6:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <173310542049.252624.8341603519407599366@vcs3.savannah.gnu.org>
[not found] ` <20241202021023.2C8B8521785@vcs3.savannah.gnu.org>
2024-12-02 21:02 ` master 63d69bd1549 07/11: Use new baseline indent rule in c-ts-mode Andrea Corallo
2024-12-03 0:38 ` Yuan Fu
2024-12-03 8:05 ` Andrea Corallo
[not found] ` <20241202021023.5060A521787@vcs3.savannah.gnu.org>
2024-12-04 8:19 ` master 44fcd37a486 08/11: Add more c-ts-mode indent tests Michael Albinus
2024-12-05 6:50 ` Yuan Fu
2024-12-05 7:37 ` Michael Albinus
2024-12-06 7:30 ` Yuan Fu
2024-12-07 1:04 ` Yuan Fu
2024-12-07 7:49 ` Eli Zaretskii
2024-12-11 6:15 ` Yuan Fu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A08D55EA-FA37-4C4F-A1F1-830F724075C7@gmail.com \
--to=casouri@gmail.com \
--cc=acorallo@gnu.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).