Bug 237089 - [patch] devel/ccls: Fix build with multiple LLVM's installed
Summary: [patch] devel/ccls: Fix build with multiple LLVM's 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: Tobias Kortkamp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-07 23:49 UTC by fullermd
Modified: 2019-04-08 00:57 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (tobik)


Attachments
patch - specify LLVM_DIR (530 bytes, patch)
2019-04-07 23:49 UTC, fullermd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fullermd 2019-04-07 23:49:27 UTC
Created attachment 203460 [details]
patch - specify LLVM_DIR

Port specifies clang info in the build, but not llvm.  When multiple LLVM installs are present, the port's build process can pick up the wrong one.  e.g.:

% grep llvm work/.build/CMakeCache.txt 
Clang_DIR:PATH=/usr/local/llvm80/lib/cmake/clang
LLVM_DIR:PATH=/usr/local/llvm50/lib/cmake/llvm

This causes the build to fail pretty quickly...
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-04-08 00:38:48 UTC
A commit references this bug:

Author: tobik
Date: Mon Apr  8 00:37:46 UTC 2019
New revision: 498336
URL: https://svnweb.freebsd.org/changeset/ports/498336

Log:
  devel/ccls: Fix build with multiple llvm* packages installed

  Apparently it is possible for the build to pick multiple LLVM
  versions if LLVM_DIR is not explicitly set similar to Clang_DIR.

  $ grep llvm $(make -V CONFIGURE_WRKSRC)/CMakeCache.txt
  Clang_DIR:PATH=/usr/local/llvm80/lib/cmake/clang
  LLVM_DIR:PATH=/usr/local/llvm50/lib/cmake/llvm

  PR:		237089
  Submitted by:	fullermd@over-yonder.net

Changes:
  head/devel/ccls/Makefile
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-04-08 00:38:50 UTC
A commit references this bug:

Author: tobik
Date: Mon Apr  8 00:38:30 UTC 2019
New revision: 498337
URL: https://svnweb.freebsd.org/changeset/ports/498337

Log:
  MFH: r498336

  devel/ccls: Fix build with multiple llvm* packages installed

  Apparently it is possible for the build to pick multiple LLVM
  versions if LLVM_DIR is not explicitly set similar to Clang_DIR.

  $ grep llvm $(make -V CONFIGURE_WRKSRC)/CMakeCache.txt
  Clang_DIR:PATH=/usr/local/llvm80/lib/cmake/clang
  LLVM_DIR:PATH=/usr/local/llvm50/lib/cmake/llvm

  PR:		237089
  Submitted by:	fullermd@over-yonder.net

  Approved by:	ports-secteam blanket

Changes:
_U  branches/2019Q2/
  branches/2019Q2/devel/ccls/Makefile
Comment 3 Tobias Kortkamp freebsd_committer freebsd_triage 2019-04-08 00:39:35 UTC
I could not reproduce with both llvm70 and llvm80 installed.  Adding
this should be harmless though.
Comment 4 fullermd 2019-04-08 00:57:16 UTC
Yeah, it probably requires versions that are "far enough" apart to completely blow up.  e.g., with 50 and 80, it builds for about 8 seconds, and then...


/home/fullermd/work/freebsd-hacks/ports/ccls/work/ccls-0.20190314/src/main.cc:74:25: error: no viable conversion from '(lambda at /home/fullermd/work/freebsd-hacks/ports/ccls/work/ccls-0.20190314/src/main.cc:74:25)' to 'void (*)()'
  cl::SetVersionPrinter([](raw_ostream &OS) {
                        ^~~~~~~~~~~~~~~~~~~~~

/home/fullermd/work/freebsd-hacks/ports/ccls/work/ccls-0.20190314/src/indexer.cc:697:69: error: non-virtual member function marked 'override' hides virtual member function
                           SourceLocation Loc, ASTNodeInfo ASTNode) override {

/home/fullermd/work/freebsd-hacks/ports/ccls/work/ccls-0.20190314/src/indexer.cc:493:8: error: no member named 'ConstantsAsWritten' in 'clang::PrintingPolicy'
    PP.ConstantsAsWritten = true;
    ~~ ^

[and on for another ~dozen errors]