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.devel Subject: Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests Date: Wed, 11 Dec 2024 22:08:13 -0800 Message-ID: <3A87C24C-DB9C-4947-87C5-C42F02B83EDD@gmail.com> 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 (Mac OS X Mail 16.0 \(3776.700.51\)) 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="35303"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Michael Albinus , Emacs Devel To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 12 07:09:00 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 1tLcNf-00092v-Ir for ged-emacs-devel@m.gmane-mx.org; Thu, 12 Dec 2024 07:08:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLcND-00086G-7I; Thu, 12 Dec 2024 01:08:31 -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 1tLcNC-000861-0U for emacs-devel@gnu.org; Thu, 12 Dec 2024 01:08:30 -0500 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLcNA-0003ur-9A; Thu, 12 Dec 2024 01:08:29 -0500 Original-Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-21654fdd5daso1829165ad.1; Wed, 11 Dec 2024 22:08:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733983705; x=1734588505; darn=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=FRhtpJ82ivtV8WIdsKwHAKHKGdJ8oEE7YLuOyaMKzFA=; b=DIAadA9vxn3Yi4axjXxrfBlqjl6aj7HnbqYgzTZgT2Ut+YlhvB7ZROp0TUJrNbOHJ8 awJ/xRGFumKk4WjeOQhZHl3kG8wV+MLL+mW5DvYyjnD+YPVzfryrORe06NeRBbNi+gJb Tz/4x94xih6hraIqhWTWCwWiRxoDJTX++VlZaqLNuR8QekXAbpIa/bIFiXsnmaJNrLDN pDLyKSopTeq2kihkMvnsKMojreIhk6zQGpuvY/eskw5+E0gkY5bEr7Wf0BDHO9aZ6nVa aLW5lnGb7Qv/29ESbDC7qF2tvREq20J8vHDZ1QCwrieQ/licSgfihq11LXTHhqSkJsX6 DYmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733983705; x=1734588505; 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=FRhtpJ82ivtV8WIdsKwHAKHKGdJ8oEE7YLuOyaMKzFA=; b=k5T4ziLqEM2meFSVfGMMwTq3mqMvjgodYMhXEnnUd+DxzyNc4myGZXZL9VMsnKzPkl W3E+RHUVX5EFZskG0v7GXD4QSTmZZz93kD6zGqxu+AWVzRo+D7r1dc5CQ+GZoZgm+XVK jfWtVxyMtgicSgpnbZWCDVySxnTcGXLgHVoy/GFCvigwUUEyGG9DCdbcgz4y6rKLgvzG A0oPxVG4GPxlCyY2i7iRpQ+VO6fGlgLH4i7OwUldI0t4HNSpSNFz/t1f8NFDjfQT8XQQ 8vRl12ms/2JL7RIZSvx6qphMIve5qUiD2GDUI2QDIeRzu4yhLQl0hhX0wQUx2AEDD9WP oSqQ== X-Forwarded-Encrypted: i=1; AJvYcCWX4yGs6VFu4SDZgt+pyJgNa4HUYZTkFMaixL12uKtasRmUOTVNEAVPOSM9Wubkev9RIlelJwNIf46Daw==@gnu.org X-Gm-Message-State: AOJu0YwTVcbN/5/Zc+ocGmiSi0vAsoJEEVQgUfaATZ8C+6+L3ufmJsCQ nC8NccVz75rxLj837suCUT9tNH/zfW2Q2IdBW9JnDzQPSUlGNd+6p0CynQ== X-Gm-Gg: ASbGncuh4q6Psigob/XThiQrs3etZMf9pgTh6syjoyNiP+GvpakAjQbX1s9B9vzgVv9 p1mEIAj78XeOk4RuELx+qwFs3QdQy3tmGGH1sA9UGeWmzEFqwbjq5ZFgLTTaddf6xA4CTg1MKy4 UHq5LaVBwP+eUMAmiQGm1hdcu/IWiFyM8Mwmrjh8MURNp9+b4RwxRxxVr4+OGN5nCpm+iyoB25q kDabXP18Cdb/ItsQCxpZs6H41CS1V1FfRK4STw5EA+fWv4rfsVOjeU9cj8RIFoYVGtV+580TGsL QmRA X-Google-Smtp-Source: AGHT+IH8pAQ1DXCApmoUHlYi+ccm3OET1NtNCJwyWrVugDMSMWq+TnHkhWb1rg1w8lEzid/kr/4PFA== X-Received: by 2002:a17:902:d48b:b0:215:a190:ba10 with SMTP id d9443c01a7336-2178ae594c6mr35495215ad.15.1733983705413; Wed, 11 Dec 2024 22:08:25 -0800 (PST) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:e40f:e83b:f0f0:1e5e]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-216460ee31bsm66749115ad.63.2024.12.11.22.08.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Dec 2024 22:08:24 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3776.700.51) Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=casouri@gmail.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:326401 Archived-At: > On Dec 11, 2024, at 3:53=E2=80=AFPM, Andrea Corallo = wrote: >=20 > Andrea Corallo writes: >=20 >> Yuan Fu writes: >>=20 >>>> 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 = wrote: >>>>>>=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 = image 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-sitter >>>>>> 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 = 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. >>>>>=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 upstream 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.) >>>=20 >>> 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. >>>=20 >>> Yuan >>=20 >> Confirm >=20 > But introduces >=20 > progmodes/c-ts-mode.el:379:13: Warning: the function = =E2=80=98treesit-node-check=E2=80=99 is not known to be defined. >=20 > on non treesit configs :) >=20 > Andrea Ah! I=E2=80=99m sorry :) Pushed the fix to master. I promise we=E2=80=99ll= be free of these problems soon ;) Yuan