1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

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
This commit is contained in:
Tobias Kortkamp 2022-08-25 23:16:22 +02:00
parent ebfe943ce4
commit 4b500674d5
No known key found for this signature in database
GPG Key ID: A4F09FB73CC51F61

View File

@ -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)