Bug 243123 - Mk/Uses/objc.mk Forces old 7.0 clang version
Summary: Mk/Uses/objc.mk Forces old 7.0 clang version
Status: Closed Unable to Reproduce
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Jose Alonso Cardenas Marquez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-06 05:29 UTC by ari
Modified: 2020-06-04 23:04 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ari 2020-01-06 05:29:25 UTC
# uname -a
FreeBSD 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64

When building www/sogo4, the USES=objc flag appears to be responsible for bringing llvm70 port into the build dependency tree.

This is a problem because that port takes about 5 hours to build.


It appears that Mk/Uses/objc.mk forces clang to be version 7.0 with this line

OBJC_CLANG_VERSION=70


Can we make it easy to use the system installed clang instead?


# /usr/bin/clang --version
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
Target: x86_64-unknown-freebsd12.1
Thread model: posix
InstalledDir: /usr/bin
Comment 1 Jose Alonso Cardenas Marquez freebsd_committer 2020-01-06 06:14:26 UTC
(In reply to ari from comment #0)
It is strange. I have installed sogo4 from ports on 4 machines and it has not llvm70 dependency. If you look at Uses/objc.mk you can see the following:

# We do always need clang and prefer a recent version
.if (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < ${OBJC_CLANG_VERSION}) || ${COMPILER_TYPE} != clang
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= ${OBJC_CLANG_VERSION}
CC=     /usr/bin/clang
CPP=    /usr/bin/clang-cpp
CXX=    /usr/bin/clang++
OBJC_LLD=       lld
.else
BUILD_DEPENDS+=        ${LOCALBASE}/bin/clang${OBJC_CLANG_VERSION}:devel/llvm${OBJC_CLANG_VERSION}
CPP=   ${LOCALBASE}/bin/clang-cpp${OBJC_CLANG_VERSION}
CC=    ${LOCALBASE}/bin/clang${OBJC_CLANG_VERSION}
CXX=   ${LOCALBASE}/bin/clang++${OBJC_CLANG_VERSION}
OBJC_LLD=       lld${OBJC_CLANG_VERSION}
.endif
.endif

.if ! ${objc_ARGS:Mcompiler}
LIB_DEPENDS+=   libobjc.so.4.6:lang/libobjc2
OBJCFLAGS+=     -I${LOCALBASE}/include
LDFLAGS+=       -L${LOCALBASE}/lib
.endif
CONFIGURE_ENV+= OBJC="${CC}" OBJCFLAGS="${OBJCFLAGS}"
MAKE_ENV+=      OBJC="${CC}" OBJCFLAGS="${OBJCFLAGS}"

.endif

First line should jump llvm70 dependency. I think that is a problem in your system. Have you some variable defined into /etc/make.conf?
Comment 2 ari 2020-01-06 06:25:12 UTC
# cat make.conf
WITHOUT_X11=yes

JAVA_PORT=java/openjdk8
JAVA_VERSION=8

apache22-worker-mpm_SET+=PROXY_AJP PROXY_BALANCER PROXY_CONNECT PROXY_FTP PROXY_HTTP PROXY_SCGI

DEFAULT_VERSIONS+=  php=7.4
DEFAULT_VERSIONS+=  apache=2.4
DEFAULT_VERSIONS+=  ssl=openssl
DEFAULT_VERSIONS+=  mysql=10.3m
DEFAULT_VERSIONS+=  lua=5.1
DEFAULT_VERSIONS+=  python=3.6

OPTIONS_UNSET+= GSSAPI_BASE GSSAPI_MIT
OPTIONS_SET+= GSSAPI_NONE
ALLOW_UNSUPPORTED_SYSTEM=yes

I was building from poudriere, so I tried going to the ports tree manually and I get something slightly different:



/var/poudriere/ports/default/www/sogo4 # make all-depends-list | grep llvm
/var/poudriere/ports/default/devel/llvm80
Comment 3 Jose Alonso Cardenas Marquez freebsd_committer 2020-06-04 23:04:18 UTC
Sorry, I can't reproduce the problem. Try with a fresh installation and updated version of FreeBSD. Maybe you problem was generated by a failed or bad upgrade