Pass -ccc-install-dir explicitly as the compilation database code does
not pass argv[0] to getMainExecutable(), while some systems require it
to return the correct path. Since the relevant code is apparently only
applicable to Darwin, just pass correct -ccc-install-dir to make
the tests pass on *BSD systems.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
LGTM to unbreak the tests on *BSD, but could you please leave a comment?
It would probably be best to take argv[0] into account on *BSD systems as well (possibly only if clang could not be found).
At least if that's the behaviour on all other systems.
test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp | ||
---|---|---|
15 ↗ | (On Diff #182701) | Could you leave a comment this is passed to unbreak *BSD tests? |
Actually, it works on other systems because they don't use argv[0]. The problem is in compilation db code using getMainExecutable() in ctor without passing the real argv to it.
But it does so in all OSes and still manages find libc++, right? What's different for *BSD?
One possible fix is to start passing proper argv[0] into getMainExecutable, but my expectation is that using clang there was intentional: the tooling library tries to fallback to the system clang in that case.
Was confused about your comment, so it works on other systems because they don't rely on argv[0] to get the path to main executable. Got you.