From owner-svn-ports-head@freebsd.org Mon Aug 29 15:23:54 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1737CBC7B82; Mon, 29 Aug 2016 15:23:54 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E956B2A85; Mon, 29 Aug 2016 15:23:53 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TFNr46079492; Mon, 29 Aug 2016 15:23:53 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TFNra5079490; Mon, 29 Aug 2016 15:23:53 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201608291523.u7TFNra5079490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Mon, 29 Aug 2016 15:23:53 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r421068 - in head/Mk: . Scripts X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 15:23:54 -0000 Author: mat Date: Mon Aug 29 15:23:52 2016 New Revision: 421068 URL: https://svnweb.freebsd.org/changeset/ports/421068 Log: Add a stage-qa check to check for the existence of SONAME in .so's. If a port provides .so.X files, they have to have a SONAME for them to work correctly. While there, incorporate a reverse soname checks in proxydeps. A port that needs a .so.X from another port which does not have a SONAME. Reviewed by: bapt Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D7454 Modified: head/Mk/Scripts/qa.sh (contents, props changed) head/Mk/bsd.port.mk (contents, props changed) Modified: head/Mk/Scripts/qa.sh ============================================================================== --- head/Mk/Scripts/qa.sh Mon Aug 29 15:07:48 2016 (r421067) +++ head/Mk/Scripts/qa.sh Mon Aug 29 15:23:52 2016 (r421068) @@ -627,11 +627,21 @@ proxydeps() { # No results presents a blank line from heredoc. [ -z "${dep_file}" ] && continue dep_file=$(subst_dep_file ${dep_file}) + # Skip files we already checked. if listcontains ${dep_file} "${already}"; then continue fi if $(pkg which -q ${dep_file} > /dev/null 2>&1); then dep_file_pkg=$(pkg which -qo ${dep_file}) + + # Check that the .so we need has a SONAME + if [ "${dep_file_pkg}" != "${PKGORIGIN}" ]; then + if ! readelf -d "${dep_file}" | grep -q SONAME; then + err "${file} is linked to ${dep_file} which does not have a SONAME. ${dep_file_pkg} needs to be fixed." + fi + fi + + # If we don't already depend on it, and we don't provide it if ! listcontains ${dep_file_pkg} "${LIB_RUN_DEPENDS} ${PKGORIGIN}"; then err "${file} is linked to ${dep_file} from ${dep_file_pkg} but it is not declared as a dependency" proxydeps_suggest_uses ${dep_file_pkg} ${dep_file} @@ -662,9 +672,35 @@ proxydeps() { return ${rc} } +sonames() { + [ -n "${BUNDLE_LIBS}" ] && return 0 + while read f; do + # No results presents a blank line from heredoc. + [ -z "${f}" ] && continue + # Ignore symlinks + [ -f "${f}" -a ! -L "${f}" ] || continue + if ! readelf -d ${f} | grep -q SONAME; then + warn "${f} doesn't have a SONAME." + warn "pkg(8) will not register it as being provided by the port." + warn "If another port depend on it, pkg will not be able to know where it comes from." + case "${f}" in + ${STAGEDIR}${PREFIX}/lib/*/*) + warn "It is in a subdirectory, it may not be used in another port." + ;; + *) + warn "It is directly in ${PREFIX}/lib, it is probably used by other ports." + ;; + esac + fi + # Use heredoc to avoid losing rc from find|while subshell + done <<-EOT + $(find ${STAGEDIR}${PREFIX}/lib -name '*.so.*') + EOT +} + checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo" checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo" -checks="$checks proxydeps" +checks="$checks proxydeps sonames" ret=0 cd ${STAGEDIR} Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Mon Aug 29 15:07:48 2016 (r421067) +++ head/Mk/bsd.port.mk Mon Aug 29 15:23:52 2016 (r421068) @@ -1509,6 +1509,7 @@ QA_ENV+= STAGEDIR=${STAGEDIR} \ LOCALBASE=${LOCALBASE} \ "STRIP=${STRIP}" \ TMPPLIST=${TMPPLIST} \ + BUNDLE_LIBS=${BUNDLE_LIBS} \ LDCONFIG_DIR="${LDCONFIG_DIR}" \ PKGORIGIN=${PKGORIGIN} \ LIB_RUN_DEPENDS='${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}' \