FS#67403 - [ccls] Wrong hardcoded resource dir

Attached to Project: Community Packages
Opened by Patrick (patrick96) - Sunday, 26 July 2020, 15:04 GMT
Last edited by Felix Yan (felixonmars) - Wednesday, 29 July 2020, 08:41 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The ccls package has the wrong clang resource dir hardcoded after a clang update.
While this doesn't crash ccls, it causes it to give wrong diagnostic messages.

Additional info:
* package version(s): ccls 0.20190823.6-1 (possibly others)

The resource dir is hardcoded into the executable at compile time: https://github.com/MaskRay/ccls/wiki/Customization#clangresourcedir

This means that everytime the output of `clang -print-resource-dir` changes (i.e. after every clang upstream release), ccls needs to be recompiled.

Steps to reproduce:

Try creating a variable of type `std::string` while including both `<string>` and `<memory>` and it will give you the following diagnostics error:

```
main.cpp:5:17 Error [ccls 2] cannot initialize a variable of type 'std::string' (aka 'int') with an lvalue of type 'const char [12]'
```

I have attached the corresponding main.cpp and .ccls file (the .ccls file is empty, but it has to exist in the same folder as `main.cpp`).


One can also detect that the resource dir is wrong by running `ccls --index=.` in a cpp project. It will produce a line like this:

```
16:56:04 ccls initialize.cc:314 I use -resource-dir=/usr/lib/clang/10.0.0
```

If the `resource-dir` doesn't match the output of `clang -print-resource-dir`, you may get the problems described above.
This task depends upon

Closed by  Felix Yan (felixonmars)
Wednesday, 29 July 2020, 08:41 GMT
Reason for closing:  Fixed
Additional comments about closing:  0.20190823.6-2

Loading...