From 4b500674d50988b7ce3585914be27ef74fea3c1d Mon Sep 17 00:00:00 2001 From: Tobias Kortkamp Date: Thu, 25 Aug 2022 23:16:22 +0200 Subject: Uses/cargo: Allow using any Rust version if requested Skip the Rust version check when CARGO_BUILDDEP=any-version The current version check is justified by USES=cargo making use of newer toolchain features that not all Cargo versions support and the fact that Rust binaries are statically linked against libstd (and others) which have been vulnerable in the past. We can enforce the use of the correct toolchain only with the version check. Together with revision bumps of all ports that have lang/rust as input we can ensure that they are kept "fresh" and relinked whenever lang/rust is updated. According to amdmi3@ skipping the check might be useful for build testing in some cases. Individual ports should not set CARGO_BUILDDEP=any-version. It can be set in make.conf or on the command line by users. PR: 265062 Reported by: amdmi3 --- Mk/Uses/cargo.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk index 55bedf30b1e9..5fa8e0e7e651 100644 --- a/Mk/Uses/cargo.mk +++ b/Mk/Uses/cargo.mk @@ -98,6 +98,8 @@ WRKSRC_crate_${_crate}= ${WRKDIR}/${_wrksrc} CARGO_BUILDDEP?= yes . if ${CARGO_BUILDDEP:tl} == "yes" BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.63.0:lang/${RUST_DEFAULT} +. elif ${CARGO_BUILDDEP:tl} == "any-version" +BUILD_DEPENDS+= ${RUST_DEFAULT}>=0:lang/${RUST_DEFAULT} . endif # Location of toolchain (default to lang/rust's toolchain) -- cgit v1.2.3