Bug 227684

Summary: devel/cquery: switch to llvm60
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Jan Beich <jbeich>
Status: Closed FIXED    
Severity: Affects Only Me CC: henry.hu.sh
Priority: --- Keywords: needs-qa, patch
Version: LatestFlags: henry.hu.sh: maintainer-feedback+
Hardware: Any   
OS: Any   
Bug Depends on: 227679    
Bug Blocks:    
Attachments:
Description Flags
v0
none
update to 20180302
henry.hu.sh: maintainer-approval+
poudriere log on 11.1-STABLE/amd64
none
updated patch
henry.hu.sh: maintainer-approval+
poudriere log on 10.4-RELEASE-p5/amd64 none

Description Jan Beich freebsd_committer freebsd_triage 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 freebsd_triage 2018-04-22 06:11:26 UTC
Created attachment 192718 [details]
v0
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 freebsd_triage 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

Log:
  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)

Changes:
  head/devel/cquery/Makefile
  head/devel/cquery/distinfo
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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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.