On Thu, Sep 26, 2019 at 3:33 PM Gianfranco Costamagna <locutusofb...@debian.org> wrote: > > Source: ccls > Version: 0.20190823-4 > Severity: normal > tags: patch > > hello, after having a deeper look on ccls (not so deep, apologizes if I made > a mistake), I discovered that upstream cmake file, > uses clang -print-resource-dir to find out the include location, and this > seems to be just working correctly > clang -print-resource-dir > /usr/lib/llvm-9/lib/clang/9.0.0 > > ./obj-x86_64-linux-gnu/CMakeFiles/ccls.dir/build.make: /usr/bin/c++ > $(CXX_DEFINES) > -DCLANG_RESOURCE_DIRECTORY="R\"(/usr/lib/llvm-9/lib/clang/9.0.0)\"" > $(CXX_INCLUDES) $(CXX_FLAGS) -S /ccls-0.20190823/src/utils.cc -o > CMakeFiles/ccls.dir/src/utils.cc.s > > > so, why can't we just drop all that code? >
The problem is /usr/lib/llvm-9/lib/clang/9.0.0 will be compiled into the binary. When clang 9.0.0 is upgraded to clang 9.0.1, I need to rebuild ccls, that's what I want to avoid. ccls only needs a working clang resource directory. But I only find a symlink like /usr/include/clang/8. If there's a symlink /usr/include/clang/<always-working-one>, then I could use this and recommend package which contains this directory. > Also, this: > CLANG_RESOURCE_DIR := /usr/include/clang/$(CLANG_VER) > CCLS_SUBSTVARS += -Vccls:Recommends=$(shell dpkg-query -S > $(CLANG_RESOURCE_DIR) | sed -e 's/: .*//') > > > Why recommend libclang-common-9-dev? can't you just use libclang-dev as > runtime dependency? Because user don't need all packages that libclang-dev depends. Only the header files under /usr/include/clang/8/include are needed. > Do you want to be sure the same clang as the one used in build is picked up? No, just a package contains clang header files, whatever version. > In this case I guess it is fine to do it, but since it is just a > recommends... a simpler way might be useful > -- Shengjing Zhu