Bug 268247 - devel/cvise: fix build with devel/llvm15 installed
Summary: devel/cvise: fix build with devel/llvm15 installed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 265425
  Show dependency treegraph
 
Reported: 2022-12-08 16:24 UTC by Dimitry Andric
Modified: 2022-12-25 17:57 UTC (History)
2 users (show)

See Also:


Attachments
devel/cvise: fix build with devel/llvm15 installed (2.24 KB, patch)
2022-12-08 16:24 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2022-12-08 16:24:23 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that devel/cvise failed to build if devel/llvm15 is also installed:

  /wrkdirs/usr/ports/devel/cvise/work/cvise-2.4.0/clang_delta/ExpressionDetector.cpp:62:16: error: 'InclusionDirective' marked 'override' but does not override any member functions
    virtual void InclusionDirective(SourceLocation HashLoc,
                 ^
  /wrkdirs/usr/ports/devel/cvise/work/cvise-2.4.0/clang_delta/ExpressionDetector.cpp:62:16: warning: '(anonymous namespace)::IncludesPPCallbacks::InclusionDirective' hides overloaded virtual function [-Woverloaded-virtual]
  /usr/local/llvm15/include/clang/Lex/PPCallbacks.h:127:16: note: hidden overloaded virtual function 'clang::PPCallbacks::InclusionDirective' declared here: type mismatch at 6th parameter ('Optional<clang::FileEntryRef>' vs 'const clang::FileEntry *')
    virtual void InclusionDirective(SourceLocation HashLoc,
                 ^
  1 warning and 1 error generated.

This is because during the configure phase, it picks up ClangConfig.cmake from the llvm13 package, but LLVMConfig.cmake from the llvm15 package:

  -- Found LLVM 15.0.6
  -- Using LLVMConfig.cmake in /usr/local/llvm15/lib/cmake/llvm
  -- Using ClangConfig.cmake in /usr/local/llvm13/lib/cmake/clang
  -- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.9.15", minimum required is "3.6")

Add a -DLLVM_DIR flag to CMAKE_ARGS to point to the correct directory for LLVMConfig.cmake.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-12-08 16:24:46 UTC
Created attachment 238636 [details]
devel/cvise: fix build with devel/llvm15 installed
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-12-25 17:55:22 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0f1ce09fbc7d660aacacf0428f26632896b89419

commit 0f1ce09fbc7d660aacacf0428f26632896b89419
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-08 16:18:19 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-25 17:50:27 +0000

    devel/cvise: fix build with devel/llvm15 installed

    During an exp-run for llvm 15 (see bug 265425), it turned out that
    devel/cvise failed to build if devel/llvm15 is also installed:

      /wrkdirs/usr/ports/devel/cvise/work/cvise-2.4.0/clang_delta/ExpressionDetector.cpp:62:16: error: 'InclusionDirective' marked 'override' but does not override any member functions
        virtual void InclusionDirective(SourceLocation HashLoc,
                     ^
      /wrkdirs/usr/ports/devel/cvise/work/cvise-2.4.0/clang_delta/ExpressionDetector.cpp:62:16: warning: '(anonymous namespace)::IncludesPPCallbacks::InclusionDirective' hides overloaded virtual function [-Woverloaded-virtual]
      /usr/local/llvm15/include/clang/Lex/PPCallbacks.h:127:16: note: hidden overloaded virtual function 'clang::PPCallbacks::InclusionDirective' declared here: type mismatch at 6th parameter ('Optional<clang::FileEntryRef>' vs 'const clang::FileEntry *')
        virtual void InclusionDirective(SourceLocation HashLoc,
                     ^
      1 warning and 1 error generated.

    This is because during the configure phase, it picks up
    ClangConfig.cmake from the llvm13 package, but LLVMConfig.cmake from the
    llvm15 package:

      -- Found LLVM 15.0.6
      -- Using LLVMConfig.cmake in /usr/local/llvm15/lib/cmake/llvm
      -- Using ClangConfig.cmake in /usr/local/llvm13/lib/cmake/clang
      -- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.9.15", minimum required is "3.6")

    Add a -DLLVM_DIR flag to CMAKE_ARGS to point to the correct directory
    for LLVMConfig.cmake.

    PR:             268247
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2022Q4

 devel/cvise/Makefile | 1 +
 1 file changed, 1 insertion(+)