From owner-dev-commits-ports-branches@freebsd.org Wed Apr 28 05:34:01 2021 Return-Path: Delivered-To: dev-commits-ports-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCC0062B7EF; Wed, 28 Apr 2021 05:34:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FVS3s4zJWz3mgp; Wed, 28 Apr 2021 05:34:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 643C434F; Wed, 28 Apr 2021 05:34:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13S5Y1OI046715; Wed, 28 Apr 2021 05:34:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S5Y1qt046714; Wed, 28 Apr 2021 05:34:01 GMT (envelope-from git) Date: Wed, 28 Apr 2021 05:34:01 GMT Message-Id: <202104280534.13S5Y1qt046714@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Tobias Kortkamp Subject: git: 449cc76c953e - 2021Q2 - Mk/Uses/cargo.mk: Use canonical crate file extension going forward MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tobik X-Git-Repository: ports X-Git-Refname: refs/heads/2021Q2 X-Git-Reftype: branch X-Git-Commit: 449cc76c953eb2029248407bd6cc52c7113177d4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 05:34:01 -0000 The branch 2021Q2 has been updated by tobik: URL: https://cgit.FreeBSD.org/ports/commit/?id=449cc76c953eb2029248407bd6cc52c7113177d4 commit 449cc76c953eb2029248407bd6cc52c7113177d4 Author: Tobias Kortkamp AuthorDate: 2021-04-17 05:27:24 +0000 Commit: Tobias Kortkamp CommitDate: 2021-04-28 05:31:45 +0000 Mk/Uses/cargo.mk: Use canonical crate file extension going forward Crates should have the file extension .crate not .tar.gz. Cargo saves them with that extension and it is also what their original name was according to file(1): $ file rust/crates/* rust/crates/better-panic-0.2.0.tar.gz:gzip compressed data, was "better-panic-0.2.0.crate" rust/crates/binary-space-partition-0.1.2.tar.gz:gzip compressed data, was "binary-space-partition-0.1.2.crate" ... The only reason we used .tar.gz is that it was that way in OpenBSD's devel/cargo/cargo.port.mk module. At the moment they are all .tar.gz but they might have a different format in the future. Doing a delayed rollout of this over a change-everything-once approach to - not immeditately invalidate all uncommitted port changes or external ports - not make sweeping changes twice in main and 2021Q2 at the cost of having a transition period where mirrors might have to carry both the .tar.gz and .crate tarballs (all crates combined are ~600 MiB). Reviewed by: jbeich MFH: 2021Q2 (to ease future cherry picks) Differential Revision: https://reviews.freebsd.org/D29760 (cherry picked from commit 3758b337a1b07b4a767d74e21e6b0b67db5e763c) --- Mk/Uses/cargo.mk | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk index 5014a1add25a..2533eda78631 100644 --- a/Mk/Uses/cargo.mk +++ b/Mk/Uses/cargo.mk @@ -34,10 +34,20 @@ CARGO_CARGOLOCK?= ${WRKSRC}/Cargo.lock CARGO_DIST_SUBDIR?= rust/crates # Generate list of DISTFILES. +# Prefer canonical file extension .crate going forward +.if make(makesum) +CARGO_CRATE_EXT= .crate +.else +# If there is a rust/crates/*.tar.gz in distinfo keep using the old +# extension. We need to delay eval until the last moment for +# DISTINFO_FILE. We cache the command output to avoid multiple +# slow grep runs for every CARGO_CRATE_EXT access. +CARGO_CRATE_EXT= ${defined(_CARGO_CRATE_EXT_CACHE):?${_CARGO_CRATE_EXT_CACHE}:${:!if ${GREP} -q '\(${CARGO_DIST_SUBDIR}/.*\.tar\.gz\)' "${DISTINFO_FILE}" 2>/dev/null; then ${ECHO_CMD} .tar.gz; else ${ECHO_CMD} .crate; fi!:_=_CARGO_CRATE_EXT_CACHE}} +.endif .for _crate in ${CARGO_CRATES} # Resolving CRATESIO alias is very inefficient with many MASTER_SITES, consume MASTER_SITE_CRATESIO directly MASTER_SITES+= ${MASTER_SITE_CRATESIO:S,%SUBDIR%,${_crate:C/^([-_a-zA-Z0-9]+)-[0-9].*/\1/}/${_crate:C/^[-_a-zA-Z0-9]+-([0-9].*)/\1/},:S,$,:cargo_${_crate:C/[^a-zA-Z0-9_]//g},} -DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}.tar.gz:cargo_${_crate:C/[^a-zA-Z0-9_]//g} +DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}${CARGO_CRATE_EXT}:cargo_${_crate:C/[^a-zA-Z0-9_]//g} .endfor # Build dependencies. @@ -211,7 +221,7 @@ cargo-extract: .for _crate in ${CARGO_CRATES} @${MV} ${WRKDIR}/${_crate} ${CARGO_VENDOR_DIR}/${_crate} @${PRINTF} '{"package":"%s","files":{}}' \ - $$(${SHA256} -q ${DISTDIR}/${CARGO_DIST_SUBDIR}/${_crate}.tar.gz) \ + $$(${SHA256} -q ${DISTDIR}/${CARGO_DIST_SUBDIR}/${_crate}${CARGO_CRATE_EXT}) \ > ${CARGO_VENDOR_DIR}/${_crate}/.cargo-checksum.json @if [ -r ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig ]; then \ ${MV} ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig \