summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMatt Jolly <kangie@gentoo.org>2024-11-25 22:40:51 +1000
committerMatt Jolly <kangie@gentoo.org>2024-12-02 17:54:17 +1000
commite13b0ea6d4432745d9275d98fdb7ee36cd62ac8f (patch)
tree62be1246de6cf9c1012d5643a5a5af89e648ebce /eclass
parentdev-lang/rust: update non-slotted rust library tidyup (diff)
downloadgentoo-e13b0ea6d4432745d9275d98fdb7ee36cd62ac8f.tar.gz
gentoo-e13b0ea6d4432745d9275d98fdb7ee36cd62ac8f.tar.bz2
gentoo-e13b0ea6d4432745d9275d98fdb7ee36cd62ac8f.zip
cargo.eclass: add ${CARGO_BOOTSTRAP}
This variable enables ebuilds to tell the eclass to ignore the minimum Rust/Cargo version reqirement. It is intended for use when bootstrapping older Rust, consumers who are not dev-lang/rust should have a good reason for using this. Signed-off-by: Matt Jolly <kangie@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/cargo.eclass16
1 files changed, 14 insertions, 2 deletions
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 95ff317e1f21..5a3820267544 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -30,6 +30,9 @@ fi
# Either the lowest slot supported by rust.eclass _or_
# reference the changelog for a particular feature requirement
# https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md
+# For reference the actual minimum version of cargo that can be used
+# is 1.53.0 for `cargo update --offline`; updated to 1.71.1 with rust eclass.
+# No need to enable usage of legacy rust versions in ebuilds; keep it as-is.
_CARGO_ECLASS_RUST_MIN_VER="1.71.1"
case ${EAPI} in
@@ -37,8 +40,10 @@ case ${EAPI} in
if [[ -n ${RUST_MIN_VER} ]]; then
# This is _very_ unlikely given that we leverage the rust eclass but just in case cargo requires a newer version
# than the oldest in-tree in future.
- if ver_test "${RUST_MIN_VER}" -lt "${_CARGO_ECLASS_RUST_MIN_VER}"; then
- die "RUST_MIN_VERSION must be at least ${_CARGO_ECLASS_RUST_MIN_VER}"
+ if [[ -z ${CARGO_BOOTSTRAP} ]]; then
+ if ver_test "${RUST_MIN_VER}" -lt "${_CARGO_ECLASS_RUST_MIN_VER}"; then
+ die "RUST_MIN_VERSION must be at least ${_CARGO_ECLASS_RUST_MIN_VER}"
+ fi
fi
else
RUST_MIN_VER="${_CARGO_ECLASS_RUST_MIN_VER}"
@@ -109,6 +114,13 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
# )
# @CODE
+# @ECLASS_VARIABLE: CARGO_BOOTSTRAP
+# @DEFAULT_UNSET
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Ignore `_CARGO_ECLASS_RUST_MIN_VER` checks.
+# If you aren't bootstrapping Rust you probably don't need this.
+
# @ECLASS_VARIABLE: CARGO_OPTIONAL
# @DEFAULT_UNSET
# @PRE_INHERIT