Closed kevin-cgc closed 1 year ago
The inconsistency of lib
vs bin
in the Windows backup directory globs is easy enough to fix, but the existing search logic should be preferring C:\Program Files\LLVM\
since it appears earlier in the backup directory glob list. I'll need to look into what's going wrong.
I spent a while thinking this was some sort of bug, but the search directories are sorted in reverse order of preference and the Visual Studio patterns came after the more specific ones.
I've changed the lists of search directories to be in order of preference which makes more sense to me, added some tests to verify that the correct directories are preferred, and adjusted the Windows search directory order to prefer more specific installs in #153.
Once that is merged I'll do a release.
Released in v1.5.0.
Specifically, in my case, libclang from VS2019 (
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\Llvm\
v12.0.0) was being preferred over VS2022 (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\
v15.0.6) and the manually/explicitly installed LLVM (C:\Program Files\LLVM\
v15.0.6).This leads to some unexpected behavior:
For me, setting
$env:LIBCLANG_PATH="C:\Program Files\LLVM\bin\"
allowed me to use clang 15.0.6 with no issues.I think
C:\Program Files\LLVM\
should be prioritized over Visual Studio installations, given that it is generally the most explicitly installed version, and is likely the clang version exposed on the PATH. It would also be nice if newer versions of Visual Studio could be preferred over older versions, but this may add unnecessary complexity to the search functions.I imagine this is unrelated but, some entries in DIRECTORIES_WINDOWS seem inconsistent with this comment: https://github.com/KyleMayes/clang-sys/blob/master/build/common.rs#L231-L235