GNU bug report logs - #64917
30.0.50; c-ts-mode throws warnings about missing cpp support

Previous Next

Package: emacs;

Reported by: Robert Pluim <rpluim <at> gmail.com>

Date: Fri, 28 Jul 2023 09:16:02 UTC

Severity: normal

Tags: notabug

Found in version 30.0.50

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64917 in the body.
You can then email your comments to 64917 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#64917; Package emacs. (Fri, 28 Jul 2023 09:16:02 GMT) Full text and rfc822 format available.

Message #3 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; c-ts-mode throws warnings about missing cpp support
Date: Fri, 28 Jul 2023 11:14:15 +0200
I built master with tree-sitter support, and installed the c-language
grammar using M-x treesit-install-language-grammar. I have
libtree-sitter-c.so in ~/.emacs.d/tree-sitter

I restarted emacs, visited src/xdisp.c, and did M-x c-ts-mode, which
popped up a *Warnings* buffer containing:

⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for cpp is unavailable (not-found): (libtree-sitter-cpp libtree-sitter-cpp.0 libtree-sitter-cpp.0.0 libtree-sitter-cpp.so libtree-sitter-cpp.so.0 libtree-sitter-cpp.so.0.0) No such file or directory
⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for cpp is unavailable (not-found): (libtree-sitter-cpp libtree-sitter-cpp.0 libtree-sitter-cpp.0.0 libtree-sitter-cpp.so libtree-sitter-cpp.so.0 libtree-sitter-cpp.so.0.0) No such file or directory

which is less than desirable (althoug `major-mode' is c-ts-mode, so I
guess things worked)

Robert

In GNU Emacs 30.0.50 (build 24, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.16.0) of 2023-07-28 built on rltb
Repository revision: a5dda9614a01ca753f25c904ccf7781176245b3c
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12009000
System Description: Debian GNU/Linux 12 (bookworm)

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3
ZLIB





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64917; Package emacs. (Fri, 28 Jul 2023 12:11:02 GMT) Full text and rfc822 format available.

Message #6 received at 64917 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 64917 <at> debbugs.gnu.org
Subject: Re: bug#64917: 30.0.50;
 c-ts-mode throws warnings about missing cpp support
Date: Fri, 28 Jul 2023 15:11:33 +0300
tags 64917 notabug
thanks

> From: Robert Pluim <rpluim <at> gmail.com>
> Date: Fri, 28 Jul 2023 11:14:15 +0200
> 
> I built master with tree-sitter support, and installed the c-language
> grammar using M-x treesit-install-language-grammar. I have
> libtree-sitter-c.so in ~/.emacs.d/tree-sitter
> 
> I restarted emacs, visited src/xdisp.c, and did M-x c-ts-mode, which
> popped up a *Warnings* buffer containing:
> 
> ⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for cpp is unavailable (not-found): (libtree-sitter-cpp libtree-sitter-cpp.0 libtree-sitter-cpp.0.0 libtree-sitter-cpp.so libtree-sitter-cpp.so.0 libtree-sitter-cpp.so.0.0) No such file or directory
> ⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for cpp is unavailable (not-found): (libtree-sitter-cpp libtree-sitter-cpp.0 libtree-sitter-cpp.0.0 libtree-sitter-cpp.so libtree-sitter-cpp.so.0 libtree-sitter-cpp.so.0.0) No such file or directory
> 
> which is less than desirable (althoug `major-mode' is c-ts-mode, so I
> guess things worked)

Please install the C++ grammar as well.  Those two go together because
some *.h files could be C or C++, and we can only test that at run
time.




Added tag(s) notabug. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 28 Jul 2023 12:11:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64917; Package emacs. (Fri, 28 Jul 2023 13:32:02 GMT) Full text and rfc822 format available.

Message #11 received at 64917 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64917 <at> debbugs.gnu.org
Subject: Re: bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp
 support
Date: Fri, 28 Jul 2023 15:31:14 +0200
>>>>> On Fri, 28 Jul 2023 15:11:33 +0300, Eli Zaretskii <eliz <at> gnu.org> said:

    Eli> tags 64917 notabug
    Eli> thanks

    Eli> Please install the C++ grammar as well.  Those two go together because
    Eli> some *.h files could be C or C++, and we can only test that at run
    Eli> time.

I had no intention of installing the C++ grammar, but I guess I have
no choice.

Some indication of that requirement at install time would help (as
well as an indication when installing that the grammar to install is
called 'cpp', not 'c++')

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64917; Package emacs. (Sat, 29 Jul 2023 17:47:01 GMT) Full text and rfc822 format available.

Message #14 received at 64917 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64917 <at> debbugs.gnu.org, Robert Pluim <rpluim <at> gmail.com>
Subject: Re: bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp
 support
Date: Sat, 29 Jul 2023 10:46:18 -0700

> On Jul 28, 2023, at 5:11 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> tags 64917 notabug
> thanks
> 
>> From: Robert Pluim <rpluim <at> gmail.com>
>> Date: Fri, 28 Jul 2023 11:14:15 +0200
>> 
>> I built master with tree-sitter support, and installed the c-language
>> grammar using M-x treesit-install-language-grammar. I have
>> libtree-sitter-c.so in ~/.emacs.d/tree-sitter
>> 
>> I restarted emacs, visited src/xdisp.c, and did M-x c-ts-mode, which
>> popped up a *Warnings* buffer containing:
>> 
>> ⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for cpp is unavailable (not-found): (libtree-sitter-cpp libtree-sitter-cpp.0 libtree-sitter-cpp.0.0 libtree-sitter-cpp.so libtree-sitter-cpp.so.0 libtree-sitter-cpp.so.0.0) No such file or directory
>> ⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for cpp is unavailable (not-found): (libtree-sitter-cpp libtree-sitter-cpp.0 libtree-sitter-cpp.0.0 libtree-sitter-cpp.so libtree-sitter-cpp.so.0 libtree-sitter-cpp.so.0.0) No such file or directory
>> 
>> which is less than desirable (althoug `major-mode' is c-ts-mode, so I
>> guess things worked)
> 
> Please install the C++ grammar as well.  Those two go together because
> some *.h files could be C or C++, and we can only test that at run
> time.

For future reference, that’s true but not the whole picture. The warning is caused by the call to (treesit-ready-p ‘cpp) at the end of c-ts-mode.el:

(if (treesit-ready-p 'cpp)
    (add-to-list 'auto-mode-alist
                 '("\\(\\.ii\\|\\.\\(CC?\\|HH?\\)\\|\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\|\\.\\(cc\\|hh\\)\\)\\'"
                   . c++-ts-mode)))

There was a discussion on whether we want to use (treesit-ready-p ‘cpp t) which tests for the availability of cpp grammar but doesn’t raise a warning. And your decision was to keep the warning, IIRC.

And my understanding is that these code that modifies auto-mode-alist whenever c-ts-mode.el is loaded are temporary for Emacs 29, and in the future might be removed. If they are removed, the warning will be gone.

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64917; Package emacs. (Mon, 31 Jul 2023 01:44:02 GMT) Full text and rfc822 format available.

Message #17 received at 64917 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 64917 <at> debbugs.gnu.org, eliz <at> gnu.org
Subject: Re: bug#64917: 30.0.50;
 c-ts-mode throws warnings about missing cpp support
Date: Sun, 30 Jul 2023 21:43:18 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

      > Eli> Please install the C++ grammar as well.  Those two go together because
      > Eli> some *.h files could be C or C++, and we can only test that at run
      > Eli> time.

I suggest we ought to make a way for a user who never operates on C++
programs to deactivate C++, deactivate this test, and not load
anything for C++.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64917; Package emacs. (Mon, 31 Jul 2023 02:29:01 GMT) Full text and rfc822 format available.

Message #20 received at 64917 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: rms <at> gnu.org
Cc: 64917 <at> debbugs.gnu.org, rpluim <at> gmail.com
Subject: Re: bug#64917: 30.0.50;
 c-ts-mode throws warnings about missing cpp support
Date: Mon, 31 Jul 2023 05:28:07 +0300
> From: Richard Stallman <rms <at> gnu.org>
> Cc: eliz <at> gnu.org, 64917 <at> debbugs.gnu.org
> Date: Sun, 30 Jul 2023 21:43:18 -0400
> 
>       > Eli> Please install the C++ grammar as well.  Those two go together because
>       > Eli> some *.h files could be C or C++, and we can only test that at run
>       > Eli> time.
> 
> I suggest we ought to make a way for a user who never operates on C++
> programs to deactivate C++, deactivate this test, and not load
> anything for C++.

If someone finds a way of doing that without any significant
downsides, I won't object.  It's just that we haven't found such a way
yet.

Btw, the Emacs tree already includes a few files in C++, so having
this grammar available is necessary for work on Emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64917; Package emacs. (Thu, 03 Aug 2023 08:14:02 GMT) Full text and rfc822 format available.

Message #23 received at 64917 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 64917 <at> debbugs.gnu.org
Subject: Re: bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp
 support
Date: Thu, 03 Aug 2023 11:13:40 +0300
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: 64917 <at> debbugs.gnu.org
> Date: Fri, 28 Jul 2023 15:31:14 +0200
> 
> >>>>> On Fri, 28 Jul 2023 15:11:33 +0300, Eli Zaretskii <eliz <at> gnu.org> said:
> 
>     Eli> tags 64917 notabug
>     Eli> thanks
> 
>     Eli> Please install the C++ grammar as well.  Those two go together because
>     Eli> some *.h files could be C or C++, and we can only test that at run
>     Eli> time.
> 
> I had no intention of installing the C++ grammar, but I guess I have
> no choice.
> 
> Some indication of that requirement at install time would help (as
> well as an indication when installing that the grammar to install is
> called 'cpp', not 'c++')

I don't really see a good place for mentioning this in a way that will
be discoverable enough.  Any suggestions?




Reply sent to Robert Pluim <rpluim <at> gmail.com>:
You have taken responsibility. (Wed, 09 Aug 2023 15:29:01 GMT) Full text and rfc822 format available.

Notification sent to Robert Pluim <rpluim <at> gmail.com>:
bug acknowledged by developer. (Wed, 09 Aug 2023 15:29:01 GMT) Full text and rfc822 format available.

Message #28 received at 64917-done <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64917-done <at> debbugs.gnu.org
Subject: Re: bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp
 support
Date: Wed, 09 Aug 2023 17:27:50 +0200
>>>>> On Thu, 03 Aug 2023 11:13:40 +0300, Eli Zaretskii <eliz <at> gnu.org> said:

    >> From: Robert Pluim <rpluim <at> gmail.com>
    >> Cc: 64917 <at> debbugs.gnu.org
    >> Date: Fri, 28 Jul 2023 15:31:14 +0200
    >> 
    >> >>>>> On Fri, 28 Jul 2023 15:11:33 +0300, Eli Zaretskii <eliz <at> gnu.org> said:
    >> 
    Eli> tags 64917 notabug
    Eli> thanks
    >> 
    Eli> Please install the C++ grammar as well.  Those two go together because
    Eli> some *.h files could be C or C++, and we can only test that at run
    Eli> time.
    >> 
    >> I had no intention of installing the C++ grammar, but I guess I have
    >> no choice.
    >> 
    >> Some indication of that requirement at install time would help (as
    >> well as an indication when installing that the grammar to install is
    >> called 'cpp', not 'c++')

    Eli> I don't really see a good place for mentioning this in a way that will
    Eli> be discoverable enough.  Any suggestions?

I donʼt either. Closing

Robert
-- 




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 07 Sep 2023 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.