aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2022-08-25 21:16:22 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2022-08-25 21:16:22 +0000
commit4b500674d50988b7ce3585914be27ef74fea3c1d (patch)
tree66f659aa32c13aee7924dbdcb28c641dfbe8cf2e
parentebfe943ce41f5a5fb8016ae3f9fc75c214b8d2cb (diff)
downloadports-4b500674d50988b7ce3585914be27ef74fea3c1d.tar.gz
ports-4b500674d50988b7ce3585914be27ef74fea3c1d.zip
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
-rw-r--r--Mk/Uses/cargo.mk2
1 files changed, 2 insertions, 0 deletions
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)