Bug 239682 - Default to devel/llvm90 when libLLVM/libclang are required or if /usr/bin/clang is not enough
Summary: Default to devel/llvm90 when libLLVM/libclang are required or if /usr/bin/cla...
Status: New
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
URL:
Keywords: needs-qa
Depends on: 235215
Blocks:
  Show dependency treegraph
 
Reported: 2019-08-06 20:40 UTC by Jan Beich
Modified: 2019-08-13 00:27 UTC (History)
20 users (show)

See Also:
bugzilla: maintainer-feedback? (arrowd)
ashish: maintainer-feedback+
jbeich: maintainer-feedback? (brooks)
cmt: maintainer-feedback+
jbeich: maintainer-feedback? (cs)
jbeich: maintainer-feedback? (ed)
jbeich: maintainer-feedback? (gecko)
henry.hu.sh: maintainer-feedback+
info: maintainer-feedback+
jbeich: maintainer-feedback+
jbeich: maintainer-feedback? (jmd)
jbeich: maintainer-feedback? (kde)
jbeich: maintainer-feedback? (pgsql)
santhosh.raju: maintainer-feedback+
tobik: maintainer-feedback+
jbeich: maintainer-feedback? (x11)
yuri: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2019-08-06 20:40:45 UTC
According to llvm.org schedule 9.0.0 is to be released sometime after 2019-08-28. Let's test/fix consumers in advance. Those not ready by release to stop using LLVM_DEFAULT or be marked BROKEN. Runtime testing of every consumer is optional - up to maintainers, a la any other library update.

See review D21172 for the patch or add DEFAULT_VERSIONS+=llvm=90 to make.conf(5).
Comment 1 commit-hook freebsd_committer 2019-08-07 08:48:01 UTC
A commit references this bug:

Author: tobik
Date: Wed Aug  7 08:47:31 UTC 2019
New revision: 508301
URL: https://svnweb.freebsd.org/changeset/ports/508301

Log:
  devel/ccls: Update to latest commit

  This should make it work with devel/llvm90.

  PR:		239682

Changes:
  head/devel/ccls/Makefile
  head/devel/ccls/distinfo
Comment 2 Santhosh Raju 2019-08-07 17:59:23 UTC
www/cliqz was built without issues using llvm-90

In my test run, Mk/bsd.default-versions.mk was updated from 80 to 90 and the bulk builds were run.

The builds were tested successfully for the following versions of FreeBSD.

11.2-RELEASE-p12
12.0-RELEASE-p8
13.0-CURRENT 1300037 r350364

Both amd64/i386 were tested out in the above versions.
Comment 3 Ashish SHUKLA freebsd_committer 2019-08-07 18:04:41 UTC
Right now the lang/rubinius is broken due to non-LLVM reasons, so this update is good to go from my side. I will look at trying to fix it, or expire it soon.
Comment 4 commit-hook freebsd_committer 2019-08-08 11:42:36 UTC
A commit references this bug:

Author: tobik
Date: Thu Aug  8 11:42:06 UTC 2019
New revision: 508373
URL: https://svnweb.freebsd.org/changeset/ports/508373

Log:
  security/afl++: Update to latest commit

  This makes it work with devel/llvm90.

  PR:		239682

Changes:
  head/security/afl++/Makefile
  head/security/afl++/distinfo
Comment 5 Gleb Popov freebsd_committer 2019-08-08 13:11:03 UTC
What's required from me?
Comment 6 Jan Beich freebsd_committer 2019-08-08 13:26:47 UTC
(In reply to Gleb Popov from comment #5)
Report https://reviews.freebsd.org/P291 upstream, update or cherry pick the fix and test.
Comment 7 Gleb Popov freebsd_committer 2019-08-08 14:10:58 UTC
(In reply to Jan Beich from comment #6)

I've done that, but I believe it's much easier to fix KLEE dependency to llvm80 instead of LLVM_DEFAULT.
Comment 8 Jan Beich freebsd_committer 2019-08-08 14:49:19 UTC
(In reply to Gleb Popov from comment #7)
> much easier to fix KLEE dependency to llvm80 instead of LLVM_DEFAULT.

The patch in review D21172 already does. Unless the port supports only one LLVM version (e.g., llvm80 but not llvm70, llvm60) then using LLVM_DEFAULT is kinda OK if you're willing to support.

If we do end up with USES=llvm it'd be nice to have something more than version range checks. Alternatively, library support (e.g., libclang from devel/llvm*, libatomic from lang/gcc*) can be added into USES=compiler after throwing out unused cruft.
Comment 9 Gleb Popov freebsd_committer 2019-08-08 15:35:34 UTC
KLEE supports 6.0, 7.0 and 8.0 as of now. Upstream is known to lag behind newest LLVM releases.
Comment 10 Mohammad S. Babaei 2019-08-10 14:17:36 UTC
At the moment I do not have a FreeBSD workstation. So, I did setup a new FreeBSD VM and modified editors/jucipp port to rely on LLVM90. Now, I am getting the following weird error:

# Created by: Mohammad S. Babaei <info@babaei.net>
 install  -m 0644  unstable/pointer-gestures/pointer-gestures-unstable-v1.xml '/usr/ports/graphics/wayland-protocols/work/stage/usr/local/share/wayland-protocols/unstable/pointer-gestures'
====> Compressing man pages (compress-man)
===>  Installing for wayland-protocols-1.17
===>  Checking if wayland-protocols is already installed
===>   Registering installation for wayland-protocols-1.17 as automatic
Installing wayland-protocols-1.17...
===>   mesa-libs-18.3.2_1 depends on package: wayland-protocols>=1.8 - found
===>   Returning to build of mesa-libs-18.3.2_1
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/libdata/pkgconfig/pthread-stubs.pc - found
===>   mesa-libs-18.3.2_1 depends on executable: bison - found
===>   mesa-libs-18.3.2_1 depends on executable: msgfmt - found
===>   mesa-libs-18.3.2_1 depends on executable: gmake - found
===>   mesa-libs-18.3.2_1 depends on package: pkgconf>=1.3.0_1 - found
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/bin/python2.7 - found
===>   mesa-libs-18.3.2_1 depends on package: llvm80>=3.9.0_4 - not found
===>  llvm80-8.0.1_2 needs Python 3.6 at least, but 2.7 was specified.
*** Error code 1

Stop.
make[7]: stopped in /usr/ports/devel/llvm80
*** Error code 1

Stop.
make[6]: stopped in /usr/ports/graphics/mesa-libs
*** Error code 1

Stop.
make[5]: stopped in /usr/ports/graphics/mesa-libs
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/graphics/cairo
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/graphics/cairo
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/devel/gobject-introspection
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/graphics/gtk-update-icon-cache
*** Error code 1

Stop.
make: stopped in /usr/ports/editors/jucipp
Comment 11 Mohammad S. Babaei 2019-08-10 14:26:31 UTC
I have to mention I also did

$ cat /etc/make.conf 
DEFAULT_VERSIONS+=python=3.6

But it does not change anything.

But, if I do

$ cat /etc/make.conf 
DEFAULT_VERSIONS+=python=3.6
DEFAULT_VERSIONS+=llvm=90

// or

$ cat /etc/make.conf 
DEFAULT_VERSIONS+=llvm=90

I get the following error

===>  Applying FreeBSD patches for mesa-libs-18.3.2_1
===>   mesa-libs-18.3.2_1 depends on package: wayland-protocols>=1.8 - found
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/libdata/pkgconfig/pthread-stubs.pc - found
===>   mesa-libs-18.3.2_1 depends on executable: bison - found
===>   mesa-libs-18.3.2_1 depends on executable: msgfmt - found
===>   mesa-libs-18.3.2_1 depends on executable: gmake - found
===>   mesa-libs-18.3.2_1 depends on package: pkgconf>=1.3.0_1 - found
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/bin/python2.7 - found
===>   mesa-libs-18.3.2_1 depends on package: llvm90>=3.9.0_4 - found
===>   mesa-libs-18.3.2_1 depends on package: xorgproto>=0 - found
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/libdata/pkgconfig/xcb.pc - found
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/libdata/pkgconfig/xdamage.pc - found
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/libdata/pkgconfig/xext.pc - found
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/libdata/pkgconfig/xfixes.pc - found
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/libdata/pkgconfig/xshmfence.pc - found
===>   mesa-libs-18.3.2_1 depends on file: /usr/local/libdata/pkgconfig/xxf86vm.pc - found
===>   mesa-libs-18.3.2_1 depends on shared library: libwayland-egl.so - found (/usr/local/lib/libwayland-egl.so)
===>   mesa-libs-18.3.2_1 depends on shared library: libexpat.so - found (/usr/local/lib/libexpat.so)
===>   mesa-libs-18.3.2_1 depends on shared library: libdrm.so - not found
===>  License MIT accepted by the user
===>   libdrm-2.4.98_1,1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by libdrm-2.4.98_1,1 for building
===>  Extracting for libdrm-2.4.98_1,1
=> SHA256 Checksum OK for libdrm-2.4.98.tar.bz2.
===>  Patching for libdrm-2.4.98_1,1
===>  Applying extra patch /usr/ports/graphics/libdrm/files/extra-xf86drm.c
===>  Applying FreeBSD patches for libdrm-2.4.98_1,1
===>   libdrm-2.4.98_1,1 depends on file: /usr/local/libdata/pkgconfig/pthread-stubs.pc - found
===>   libdrm-2.4.98_1,1 depends on executable: meson - not found
===>  meson-0.51.0 needs Python 3.5 at least, but 2.7 was specified.
*** Error code 1

Stop.
make[9]: stopped in /usr/ports/devel/meson
*** Error code 1

Stop.
make[8]: stopped in /usr/ports/graphics/libdrm
*** Error code 1

Stop.
make[7]: stopped in /usr/ports/graphics/libdrm
*** Error code 1

Stop.
make[6]: stopped in /usr/ports/graphics/mesa-libs
*** Error code 1

Stop.
make[5]: stopped in /usr/ports/graphics/mesa-libs
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/graphics/cairo
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/graphics/cairo
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/devel/gobject-introspection
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/graphics/gtk-update-icon-cache
*** Error code 1

Stop.
make: stopped in /usr/ports/editors/jucipp

How should I get past these Python things and test the actual editors/jucipp
 port?
Comment 12 Jan Beich freebsd_committer 2019-08-10 15:59:41 UTC
(In reply to Mohammad S. Babaei from comment #10)
See bug 233723.
Comment 13 Henry Hu 2019-08-11 05:11:43 UTC
I tested cquery with newer version of LLVM, and "cquery --test-unit" and "cquery --check <sample c++ file>" seem to work fine. We can make it use the default LLVM version with this patch:

diff --git a/devel/cquery/Makefile b/devel/cquery/Makefile
index 4ebab81..a91ea4a 100644
--- a/devel/cquery/Makefile
+++ b/devel/cquery/Makefile
@@ -12,8 +12,8 @@ LICENSE=	MIT
 
 BROKEN_powerpc64=	fails to build: Checking for 'clang++' (C++ compiler): not found
 
-BUILD_DEPENDS=	llvm-config60:devel/llvm60
-LIB_DEPENDS=	libclang.so:devel/llvm60
+BUILD_DEPENDS=	llvm-config${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT}
+LIB_DEPENDS=	libclang.so:devel/llvm${LLVM_DEFAULT}
 
 USES=		compiler:c++14-lang waf
 
@@ -28,7 +28,7 @@ GH_TUPLE=	miloyip:rapidjson:daabb88:rapidjson/third_party/rapidjson \
 
 PLIST_FILES=	bin/cquery
 
-CONFIGURE_ARGS=	--variant=system --llvm-config=${LOCALBASE}/bin/llvm-config60
+CONFIGURE_ARGS=	--variant=system --llvm-config=${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT}
 MAKE_ARGS=	--variant=system
 
 post-install:
Comment 14 Jan Beich freebsd_committer 2019-08-11 05:17:36 UTC
(In reply to Henry Hu from comment #13)
> We can make it use the default LLVM version with this patch:

Already proposed and landed as part of bug 232598.
Comment 15 Mohammad S. Babaei 2019-08-12 23:44:08 UTC
(In reply to Jan Beich from comment #12)
OK, thanks that solved the issue for me. I'll test editors/jucipp and report back soon.
Comment 16 Mohammad S. Babaei 2019-08-13 00:26:37 UTC
editors/jucipp passes all the following tests with LLVM90 just fine:

    make stage

    make stage-qa

    make check-orphans

    make package

    make install

    make deinstall

    make clean