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: Treesit says grammar is unavailable when it Date: Tue, 12 Dec 2023 19:33:19 -0800 Message-ID: <1b24fc47-f792-415c-ac59-fcf3a2f5eeb9@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19280"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Gernot Kieseritzky , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 13 04:34:11 2023 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 1rDG0h-0004pG-L9 for ged-emacs-devel@m.gmane-mx.org; Wed, 13 Dec 2023 04:34:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDFzy-0003K9-Rx; Tue, 12 Dec 2023 22:33:26 -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 1rDFzw-0003Jm-QV for emacs-devel@gnu.org; Tue, 12 Dec 2023 22:33:24 -0500 Original-Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rDFzu-0004sI-Ep for emacs-devel@gnu.org; Tue, 12 Dec 2023 22:33:23 -0500 Original-Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3ba10647a19so1919312b6e.3 for ; Tue, 12 Dec 2023 19:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702438401; x=1703043201; darn=gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=84JYXRhlajwm/go5QzSFJQSE3EvtxXcc/FX7mhTtFCQ=; b=k0cV8RaZE30w4eseD3u09Pz8E8FK5wK2JEYsU83ciWdghZZlW7ueKYDEQPCHDfA7yR DNMbjONNdi0aEJ/wPeG05G2VIS3U7XZ/1FEnvO4+z9Axeklr9A2ytQxQRPftgRRjgVv/ 4P/WUdrE+cTbmxjRdTjcHEem9KNa4RdAQritHgmA8enqeh/u+jUwu5A18yxcW0GrkP/u DVP+kExw/q190N3Ahc68DhVVXF+E2ukC+0wpHdJwkjRmRYOLurSR27eFTAzGEqmtHlUF ByePGC7K00Qbn4VEBepFyizGdk4FtIBnOWKjiqS9RNO+Y/wZPvdFPVPOO7LALy0CwESG MaRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702438401; x=1703043201; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=84JYXRhlajwm/go5QzSFJQSE3EvtxXcc/FX7mhTtFCQ=; b=sbgiEKdsd+lankeN38oyrpTgeHs7PuRwOW7TZ3VHvr2SfZZOvlAeJ3ltmj4bpCe3eT OXTkaiiwJp/15voy9/KB7ksAcw0U7nsVvxMjyJHduEkvixa5TtL1ZRt0pBV6OuJ2tf5L f9t3VZH85gIIGwFRuPki1zCybAHf9p70L+zh7yP5hOBPvvhljyXlWPJIN8ZXS9CBqr2N v5vuzBygKgK00ffvNwYDCuoe8tx5l0y8rlEeGT9+p0vsKyCzpW3nykPlW4sPtm9lDVq7 3aDEskNWQaK+8sqGWZARDFD+5SZtIqraKhwrShAjk8HwggrbP0UVv7P+v2GSb2CbCqTj tl8A== X-Gm-Message-State: AOJu0Ywm7lO4AvUruaF94HL5uho0bRmBx/5LDkOQsZV/AUny1V1TFsqa /pd2VN5KL+9BnPqnrADhUxa0+weZmSHmBQ== X-Google-Smtp-Source: AGHT+IFKhSAsmeNKlmAye+FcwQmxATtNKMVlo0+Yn2gd0FGyGUK+Hb8qsBhU8q3meoUM1MlCDINqqA== X-Received: by 2002:a05:6808:4447:b0:3ba:d3a:a47a with SMTP id ep7-20020a056808444700b003ba0d3aa47amr5385403oib.18.1702438401200; Tue, 12 Dec 2023 19:33:21 -0800 (PST) Original-Received: from [192.168.1.7] (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id v4-20020aa78084000000b006ce50876c37sm8948758pff.100.2023.12.12.19.33.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Dec 2023 19:33:20 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::22b; envelope-from=casouri@gmail.com; helo=mail-oi1-x22b.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, T_SCC_BODY_TEXT_LINE=-0.01 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:313739 Archived-At: On 12/4/23 4:43 AM, Gernot Kieseritzky wrote: > Hello! > >> Warning (treesit): Cannot activate tree-sitter, because language grammar >> for python is unavailable (not-found): (libtree-sitter-python libtree-sitter-python.so) >> No such file or directory > I had the same error when using "libtree-sitter-yaml.so" and, finally, > had some time for a deeper investigation. I tried the Emacs built-in > debugger (M-x debug-on-entry treesit_load_language) but I found the > error only occurs inside the C function "treesit-available-p". Since > this error occurred directly when Emacs loads the shared library > resting inside of my ".emacs.d/tree-sitter/" directory I resorted to > debugging the dynamic linker by starting Emacs with > > $ LD_DEBUG=1; emacs 2> linker.log > > and then just proceeded to activate "yaml-ts-mode". Then I hit this: > > listdc++.so.6: error: version lookup error: version 'GLIBCXX_3.4.29' > not found (required by ~/.emacs.d/tree-sitter/libtree-sitter-yaml.so) > > Turns out the yaml module is using C++ for its scanner component (see > https://github.com/ikatyang/tree-sitter-yaml) unlike all the other > plugins I am using (C, C++, JS and TS). But I compiled this module on > my own -- on the same machine -- so how can my system's C++ standard > library suddenly turn incompatible?? > > Well, it turns out I am using Alex Murray's Emacs snap package on my > Ubuntu 22.04 system being based on the "core20" snap base package > (i.e. it is based on Ubuntu 20). So this Emacs snap provides an older > set of build essentials including an incompatible C++ standard > library. So as a workaround I would need to cross-compile this module > using an Ubuntu 20 compatible environment. But the best solution is > probably to ask Alex Murray to add all available tree sitter parsers > in his snap. > > Best regards, > Gernot Kieseritzky Thanks for sharing this! Eli, this sort of thing might be good reasons to also print the error message from ldopen, rather than simply saying not found? Yuan