Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: killerbot on January 29, 2024, 05:26:45 pm

Title: clangd plug-in can not find clangd
Post by: killerbot on January 29, 2024, 05:26:45 pm
Today build CB on a TumbleWeed distribution, all went fine.
It also contains clang (and clangd) in /usr/bin ,adn it is version 17.0.6.
Compiler detected by CB, the plug-in kind of detected clangd, the path in the settings is correctly specified. However the plug-in keep saying :
clangd_client plugin could not auto detect a clangd installation. PLease enter the location of clangd using ....

Aka the settings tab, where the correct path is present, but to no advantage it seems.

Suggestions ?
Title: Re: clangd plug-in can not find clangd
Post by: Pecan on January 29, 2024, 09:14:42 pm
Today build CB on a TumbleWeed distribution, all went fine.
It also contains clang (and clangd) in /usr/bin ,adn it is version 17.0.6.
Compiler detected by CB, the plug-in kind of detected clangd, the path in the settings is correctly specified. However the plug-in keep saying :
clangd_client plugin could not auto detect a clangd installation. PLease enter the location of clangd using ....

Aka the settings tab, where the correct path is present, but to no advantage it seems.

Suggestions ?
This is caused by the clangd_plugin not finding the clangd resources not the executable (most likely).
They keep changing how they name the resources and we keep fixing it.

Let me see if I can find a the right question to ask to find the resources.
Title: Re: clangd plug-in can not find clangd
Post by: Pecan on January 29, 2024, 09:46:47 pm
Today build CB on a TumbleWeed distribution, all went fine.
It also contains clang (and clangd) in /usr/bin ,adn it is version 17.0.6.
Compiler detected by CB, the plug-in kind of detected clangd, the path in the settings is correctly specified. However the plug-in keep saying :
clangd_client plugin could not auto detect a clangd installation. PLease enter the location of clangd using ....

Aka the settings tab, where the correct path is present, but to no advantage it seems.

Suggestions ?
On that system, please show the output clangd --version
Then cd to /lib/clang and show all the folder names .
We want to know how they named the clang resources.

For example:
Code
 F:\usr\programs\msys64_13.0.1\mingw64\bin\clangd.exe --version
clangd version 16.0.5
Features: windows
Platform: x86_64-w64-windows-gnu

S F:\usr\programs\msys64_13.0.1\mingw64> cd lib
PS F:\usr\programs\msys64_13.0.1\mingw64\lib> cd clang
PS F:\usr\programs\msys64_13.0.1\mingw64\lib\clang> ls


    Directory: F:\usr\programs\msys64_13.0.1\mingw64\lib\clang


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         6/29/2023  11:28 AM                16

Note that in my case the clangd version and it's resource do not match. We have to compensate for that.

On Linux Mint it's different:
Code
pecan@LinuxMint:/usr/bin$ clangd --version
Ubuntu clangd version 14.0.0-1ubuntu1.1
Features: linux+grpc
Platform: x86_64-pc-linux-gnu
pecan@LinuxMint:/usr/bin$ cd /lib/clang
pecan@LinuxMint:/lib/clang$ ls
14  14.0.0
pecan@LinuxMint:/lib/clang$
Title: Re: clangd plug-in can not find clangd
Post by: Pecan on January 30, 2024, 02:56:41 am
I've just spent 45 minutes trying to download TumbleWeed Liinux. It seems to be dead and suggesting to use Leap instead.

Am I barking up the wrong tree?
Do we want to spend hours/days supporting a dead distribution?

Does anyone know how I can download an ISO to load into VMware?
Title: Re: clangd plug-in can not find clangd
Post by: Grit Clef on January 30, 2024, 03:37:46 am
Where I live, I can download Tumbleweed via https://mirrors.ustc.edu.cn/opensuse/tumbleweed/iso/.
But I don't know whether you can access it.
Title: Re: clangd plug-in can not find clangd
Post by: Commaster on January 30, 2024, 04:39:48 am
I hope you are picking the right Tumbleweed...
https://get.opensuse.org/tumbleweed/

Leap is a normal distribution, assembled annually and has version numbers.
Tumbleweed is like gentoo, there's a new iso almost daily and the packages are updated forever.
Title: Re: clangd plug-in can not find clangd
Post by: Pecan on January 30, 2024, 05:12:06 am
I hope you are picking the right Tumbleweed...
https://get.opensuse.org/tumbleweed/

Leap is a normal distribution, assembled annually and has version numbers.
Tumbleweed is like gentoo, there's a new iso almost daily and the packages are updated forever.

Thanks, I don't know why this page didn't show up in my Google search.
Title: Re: clangd plug-in can not find clangd
Post by: killerbot on January 30, 2024, 12:14:15 pm
clangd --version
clangd version 17.0.6
Features: linux
Platform: x86_64-suse-linux


which clang
/usr/bin/clang


which clangd
/usr/bin/clangd


cd /usr/lib64/clang/
ls
17



lib64 versus lib ?
Title: Re: clangd plug-in can not find clangd
Post by: Pecan on January 30, 2024, 06:39:21 pm
clangd --version
clangd version 17.0.6
Features: linux
Platform: x86_64-suse-linux


which clang
/usr/bin/clang


which clangd
/usr/bin/clangd


cd /usr/lib64/clang/
ls
17



lib64 versus lib ?

Yep ! How are we suppose to guess what the lib name is ?

Is this just one of those cased that we keep adding names to check until no user complains?

Is there a way in Linux other than just keeping an array of lib names ?

Edit:
Oh, I know what to do, display an enumeration of /lib* and let the user choose, else if only one, choose it by default.

Title: Re: clangd plug-in can not find clangd
Post by: killerbot on January 31, 2024, 05:28:01 pm
can't you just try to find it in both, I would suggest starting with lib64, and if not found lib ?
Title: Re: clangd plug-in can not find clangd
Post by: Pecan on January 31, 2024, 05:44:29 pm
can't you just try to find it in both, I would suggest starting with lib64, and if not found lib ?

Agreed
Title: Re: clangd plug-in can not find clangd
Post by: Pecan on February 01, 2024, 08:57:14 pm
Hopefully fixed in Head rev 13442
Title: Re: clangd plug-in can not find clangd
Post by: killerbot on February 01, 2024, 11:17:16 pm
the pop-up boxes are gone. and the cc is working.

This can be seen in the cb log panel (bad or good ?)

 FindClangResourceDirs: Error opening directory /usr/lib64/mysql/plugin/auth_pam_tool_dir
 FindClangResourceDirs: Error opening directory /usr/etc/X11/xdm/authdir
 FindClangResourceDirs: Error opening directory /usr/etc/skel/.cache
 FindClangResourceDirs: Error opening directory /usr/etc/skel/.config
 FindClangResourceDirs: Error opening directory /usr/etc/skel/.local
 FindClangResourceDirs: Error opening directory /usr/etc/keys
 FindClangResourceDirs: Error opening directory /usr/etc/sudoers.d
 FindClangResourceDirs: Error opening directory /usr/libexec/ppp
Title: Re: clangd plug-in can not find clangd
Post by: Pecan on February 02, 2024, 12:56:23 am
the pop-up boxes are gone. and the cc is working.

This can be seen in the cb log panel (bad or good ?)

 FindClangResourceDirs: Error opening directory /usr/lib64/mysql/plugin/auth_pam_tool_dir
 FindClangResourceDirs: Error opening directory /usr/etc/X11/xdm/authdir
 FindClangResourceDirs: Error opening directory /usr/etc/skel/.cache
 FindClangResourceDirs: Error opening directory /usr/etc/skel/.config
 FindClangResourceDirs: Error opening directory /usr/etc/skel/.local
 FindClangResourceDirs: Error opening directory /usr/etc/keys
 FindClangResourceDirs: Error opening directory /usr/etc/sudoers.d
 FindClangResourceDirs: Error opening directory /usr/libexec/ppp

Thanks,
Hmmm, seems I forgot to comment out some debugging output.
And I don't know why the code is searching the non *lib* dirs.
I'll see if I can fix that.