[llvm-bugs] [Bug 43430] New: Clang Analyzer plugin examples always included in LLVMExports.cmake

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 24 06:15:10 PDT 2019


            Bug ID: 43430
           Summary: Clang Analyzer plugin examples always included in
           Product: Build scripts
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: lepesme.jb at gmail.com
                CC: llvm-bugs at lists.llvm.org

The clang Analysis plugin examples (in clang/lib/Analysis/plugins) are always
built and installed even if CLANG_BUILD_EXAMPLES is OFF.

When using llvm-toolchain-bionic in http://apt.llvm.org/bionic/ the package
llvm-10-dev includes a LLVMExports.cmake which includes thus samples. See
/data/user/lib/llvm-10/lib/cmake/llvm/LLVMExports.cmake in

When trying to use LLVM-10 from travis (with this config
I got the error:

  CMake Error at /usr/lib/llvm-10/lib/cmake/llvm/LLVMExports.cmake:1341
  The imported target "SampleAnalyzerPlugin" references the file
  but this file does not exist.  Possible reasons include:
  * The file was deleted, renamed, or moved to another location.
  * An install or uninstall procedure did not complete successfully.
  * The installation package was faulty and contained
  but not all the files it references.

I couldn't find SampleAnalyzerPlugin.so in any other packages
(clang-10-examples only has sources), so I tried to replicate the problem
locally, CLANG_BUILD_EXAMPLES was OFF, although the sample plugins were built
and installed. Deleting /usr/local/lib/SampleAnalyzerPlugin.so replicated the
travis error.

I proposed a fix here https://reviews.llvm.org/D67877.

This fix looks ok to me, although I'm no CMake expert, particularly in LLVM
context, and I might cure a symptom and not the cause, but with this patch if
CLANG_BUILD_EXAMPLES is OFF, they don't appear in LLVMExports.cmake are not
build/installed, and vice-versa if it's ON.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190924/8380ad4a/attachment.html>

More information about the llvm-bugs mailing list