From owner-svn-ports-head@freebsd.org Mon Mar 6 13:27:58 2017 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 C36A6CFA854; Mon, 6 Mar 2017 13:27:58 +0000 (UTC) (envelope-from dumbbell@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 9B4C9194D; Mon, 6 Mar 2017 13:27:58 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v26DRvXL069725; Mon, 6 Mar 2017 13:27:57 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v26DRvxc069724; Mon, 6 Mar 2017 13:27:57 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201703061327.v26DRvxc069724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Mon, 6 Mar 2017 13:27:57 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r435537 - in head/lang: rust rust-nightly 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.23 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, 06 Mar 2017 13:27:58 -0000 Author: dumbbell Date: Mon Mar 6 13:27:57 2017 New Revision: 435537 URL: https://svnweb.freebsd.org/changeset/ports/435537 Log: lang/rust, lang/rust-nightly: Generate PLIST in post-install Several libraries have their filename computed and based on the absolute path to source files. Therefore, we need to generate the PLIST. Rust installer already produces manifests listing files it installs. The port now uses those files to complete `${TMPPLIST}`. While the port built fine in Poudriere, it failed when built directly on the host (regular make or with portmaster(1)) or using a different tool such as Synth. This commit fixes the build for those methods. Handling of DOCS-specific files is also unified with normal files. This gets rid of code duplication. How to do reproducible builds will be studied later. PR: 217309 Reported by: Several people on freebsd-ports@ or Bugzilla Tested by: Almost everyone who reported the issue Approved by: antoine (mentor), riggs (maintainer of lang/rust) Differential Revision: https://reviews.freebsd.org/D9816 Deleted: head/lang/rust-nightly/pkg-plist.amd64 head/lang/rust-nightly/pkg-plist.i386 head/lang/rust/pkg-plist.amd64 head/lang/rust/pkg-plist.i386 Modified: head/lang/rust/Makefile Modified: head/lang/rust/Makefile ============================================================================== --- head/lang/rust/Makefile Mon Mar 6 12:11:13 2017 (r435536) +++ head/lang/rust/Makefile Mon Mar 6 13:27:57 2017 (r435537) @@ -21,7 +21,6 @@ DISTFILES+= ${CARGO_REGISTRY}:registry .endif DIST_SUBDIR?= rust EXTRACT_ONLY?= ${DISTFILES:N*\:*bootstrap:C/:.*//} -PLIST= ${.CURDIR}/pkg-plist.${ARCH} MAINTAINER?= riggs@FreeBSD.org COMMENT= Language with a focus on memory safety and concurrency @@ -75,8 +74,6 @@ CONFIGURE_ARGS= --disable-valgrind \ --mandir=${MANPREFIX}/man \ --release-channel=${RUST_CHANNEL} -PORTDOCS= * - MAKE_ARGS+= VERBOSE=1 OPTIONS_DEFINE= DOCS GDB LLNEXTGEN PORT_LLVM @@ -98,6 +95,18 @@ LLVM_PREFIX= ${LOCALBASE}/llvm${LLVM_V TEST_TARGET= check TEST_ENV+= ALLOW_NONZERO_RLIMIT_CORE=1 +# Rust manifests list all files and directories installed by rust-installer. +# We use them in: +# - pre-install to cleanup the ${STAGEDIR} +# - post-install to populate the ${TMPPLIST} +RUST_MANIFESTS= lib/rustlib/manifest-rustc \ + lib/rustlib/manifest-rust-std-${RUST_TARGET} +RUST_DOCS_MANIFESTS= lib/rustlib/manifest-rust-docs +DOCS_VARS= rust_manifests+=${RUST_DOCS_MANIFESTS} + +PLIST_FILES= lib/rustlib/components \ + lib/rustlib/rust-installer-version + pre-fetch: # FIXME: This is the same check for CONFLICTS as the standard # one, except port origins are not compared. This allows @@ -145,37 +154,50 @@ post-patch: # new ones. Otherwise, the staging directory is polluted with unneeded # files. pre-install: - @for f in manifest-rustc manifest-rust-std-${RUST_TARGET}; do \ - if test -f ${STAGEDIR}${PREFIX}/lib/rustlib/$$f; then \ - ${SED} -E -e 's,^(dir|file:),${STAGEDIR},' \ - < ${STAGEDIR}${PREFIX}/lib/rustlib/$$f \ - | ${XARGS} ${RM}; \ + @for f in ${RUST_MANIFESTS} ${RUST_DOCS_MANIFESTS}; do \ + if test -f "${STAGEDIR}${PREFIX}/$$f"; then \ + ${SED} -E -e 's,^(file|dir):,${STAGEDIR},' \ + < "${STAGEDIR}${PREFIX}/$$f" \ + | ${XARGS} ${RM} -r; \ + ${RM} "${STAGEDIR}${PREFIX}/$$f"; \ fi; \ done - @${RM} \ - ${STAGEDIR}${PREFIX}/lib/rustlib/components \ - ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rustc \ - ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rust-std-${RUST_TARGET} \ - ${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \ - ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh - -pre-install-DOCS-on: - @for f in manifest-rust-docs; do \ - if test -f ${STAGEDIR}${PREFIX}/lib/rustlib/$$f; then \ - ${SED} -E -e 's,^(dir|file:),${STAGEDIR},' \ - < ${STAGEDIR}${PREFIX}/lib/rustlib/$$f \ - | ${XARGS} ${RM}; \ - fi; \ + @for f in ${PLIST_FILES}; do \ + ${RM} "${STAGEDIR}${PREFIX}/$$f"; \ done - @${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rust-docs +# In post-install, we use the manifests generated during Rust install +# to in turn generate the PLIST. We do that, instead of the regular +# `pkg-plist`, because several libraries have a computed filename based +# on the absolute path of the source files. As it is user-specific, we +# can't know their filename in advance. +# +# We fix manpage entries in the generated manifests because Rust +# installs them uncompressed but the Ports framework compresses them. post-install: - @for f in manifest-rustc manifest-rust-std-${RUST_TARGET}; do \ - ${REINPLACE_CMD} -e 's|${STAGEDIR}||' \ - ${STAGEDIR}${PREFIX}/lib/rustlib/$$f; \ - ${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/$$f.bak; \ + for f in ${RUST_MANIFESTS}; do \ + ${REINPLACE_CMD} -E \ + -e 's|:${STAGEDIR}|:|' \ + -e 's|(man/man[1-9]/.*\.[0-9])|\1.gz|' \ + ${STAGEDIR}${PREFIX}/$$f; \ + ${RM} ${STAGEDIR}${PREFIX}/$$f.bak; \ + ${ECHO} "${PREFIX}/$$f" >> ${TMPPLIST}; \ + ${AWK} '\ + /^file:/ { \ + file=$$0; \ + sub(/^file:/, "", file); \ + print file; \ + } \ + /^dir:/ { \ + dir=$$0; \ + sub(/^dir:/, "", dir); \ + system("find ${STAGEDIR}" dir " -type f | ${SED} -E -e \"s|${STAGEDIR}||\""); \ + }' \ + ${STAGEDIR}${PREFIX}/$$f >> ${TMPPLIST}; \ done - @${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/install.log + @${RM} \ + ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ + ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh # FIXME: Static libraries in lib/rustlib/*/lib/*.rlib are not stripped, # but they contain non-object files which make strip(1) unhappy. @${STRIP_CMD} \ @@ -184,13 +206,6 @@ post-install: ${STAGEDIR}${PREFIX}/lib/*.so \ ${STAGEDIR}${PREFIX}/lib/rustlib/*/lib/*.so -post-install-DOCS-on: - @for f in manifest-rust-docs; do \ - ${REINPLACE_CMD} -e 's|${STAGEDIR}||' \ - ${STAGEDIR}${PREFIX}/lib/rustlib/$$f; \ - ${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/$$f.bak; \ - done - .include # "make gen-registry" is a special target to ease this port update.