Bug 227684 - devel/cquery: switch to llvm60
Summary: devel/cquery: switch to llvm60
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
Keywords: needs-qa, patch
Depends on: 227679
  Show dependency treegraph
Reported: 2018-04-22 06:10 UTC by Jan Beich
Modified: 2018-04-28 19:51 UTC (History)
1 user (show)

See Also:
henry.hu.sh: maintainer-feedback+

v0 (1.20 KB, patch)
2018-04-22 06:11 UTC, Jan Beich
no flags Details | Diff
update to 20180302 (1.69 KB, patch)
2018-04-28 04:29 UTC, Henry Hu
henry.hu.sh: maintainer-approval+
Details | Diff
poudriere log on 11.1-STABLE/amd64 (99.62 KB, text/plain)
2018-04-28 05:09 UTC, Henry Hu
no flags Details
updated patch (1.90 KB, patch)
2018-04-28 17:59 UTC, Henry Hu
henry.hu.sh: maintainer-approval+
Details | Diff
poudriere log on 10.4-RELEASE-p5/amd64 (99.57 KB, text/plain)
2018-04-28 18:02 UTC, Henry Hu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2018-04-22 06:10:29 UTC
FreeBSD 11.2 will use Clang 6.0, so it'd be nice if cquery does, too.
Comment 1 Jan Beich freebsd_committer 2018-04-22 06:11:26 UTC
Created attachment 192718 [details]
Comment 2 Henry Hu 2018-04-28 04:29:09 UTC
Created attachment 192864 [details]
update to 20180302

I tested and the current version does not work with llvm60. I updated it to latest release and it works. Here is the patch.
Comment 3 Henry Hu 2018-04-28 05:09:12 UTC
Created attachment 192865 [details]
poudriere log on 11.1-STABLE/amd64
Comment 4 Henry Hu 2018-04-28 17:59:55 UTC
Created attachment 192880 [details]
updated patch

Now cquery sets -std=c++14, which is not supported by clang in freebsd 10. In this patch, we specify -std=c++1y for freebsd 10.
Comment 5 Henry Hu 2018-04-28 18:02:32 UTC
Created attachment 192881 [details]
poudriere log on 10.4-RELEASE-p5/amd64
Comment 6 commit-hook freebsd_committer 2018-04-28 18:57:10 UTC
A commit references this bug:

Author: jbeich
Date: Sat Apr 28 18:57:07 UTC 2018
New revision: 468562
URL: https://svnweb.freebsd.org/changeset/ports/468562

  devel/cquery: update to 20180302

  - Switch to LLVM 6.0, chasing r468505

  Changes:	https://github.com/cquery-project/cquery/releases/tag/v20180215
  Changes:	https://github.com/cquery-project/cquery/releases/tag/v20180302
  PR:		227684
  Submitted by:	Henry Hu (maintainer)

Comment 7 Henry Hu 2018-04-28 18:59:59 UTC
(In reply to commit-hook from comment #6)
Sorry for the problematic patch, but the committed version may not work on FreeBSD 10. Please check the new version.
Comment 8 Jan Beich freebsd_committer 2018-04-28 19:11:37 UTC
(In reply to Henry Hu from comment #7)
> ... may not work on FreeBSD 10.

Can you elaborate? USES=compiler:c++14-lang sets CXX=clang++60 which does support C++14. I've also checked "cquery" binary doesn't crash on startup (in case of libc++/libcxxrt bugs).

Not to mention -std=c++1y isn't supported on GCC platforms e.g., mips*, powerpc*, sparc64. Of those, sparc64 is stuck at lang/gcc48 and mips* doesn't support modern any lang/gcc* port but may adopt clang 6.0 in base in future. powerpc* and sparc64 aren't supported by emulators/qemu-user-static, so it's kinda tricky to test C++11 or later consumers via poudriere without real hardware.

Build logs:
10.3 amd64: https://ptpb.pw/zaN5
10.3 i386:  https://ptpb.pw/jQje
10.4 amd64: https://ptpb.pw/5E9W
10.4 i386:  https://ptpb.pw/1dkQ
Comment 9 Jan Beich freebsd_committer 2018-04-28 19:17:42 UTC
(In reply to Jan Beich from comment #8)
> -std=c++1y isn't supported on GCC platforms

Where GCC 4.2.1 is still in base. USES=compiler:c++14-lang magic is supposed to request more modern CXX. During FreeBSD 9.x days on i386/amd64 USES=compiler:c++11-lang requested /usr/bin/clang++ while USES=compiler:c++14-lang requested clang++36. Once FreeBSD 11.1 reaches EOL USES=compiler:c++14-lang will probably transform into USES=compiler:c++17-lang.
Comment 10 Jan Beich freebsd_committer 2018-04-28 19:19:19 UTC
$ uname -rp
11.1-RELEASE mips64

$ c++ -v
Using built-in specs.
Target: mips64-undermydesk-freebsd
Configured with: FreeBSD/mips64 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]

$ echo 'int main() {}' >a.cc
$ c++ -std=c++1y a.cc
cc1plus: error: unrecognized command line option "-std=c++1y"
Comment 11 Henry Hu 2018-04-28 19:21:16 UTC
(In reply to Jan Beich from comment #8)
Oh I missed the USES=compiler:c++14-lang part. With that part it should work.

For c++17, do we have any plan to support compiler:c++17-lib?
Comment 12 Jan Beich freebsd_committer 2018-04-28 19:51:29 UTC
Better ask toolchain@. libc++ in base cannot be swapped out with a new version (see bug 215193). Another option is to use libstdc++ library from lang/gcc*. Due to libc++ vs. libstdc++ conflict leading to crashes every library dependency of a port has to be built against the same C++ library.