Gentoo Archives: gentoo-dev

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-dev@l.g.o
Cc: Georgy Yakovlev <gyakovlev@g.o>
Subject: [gentoo-dev] [PATCH 1/7] cargo.eclass: bump minimum rust to 1.57.0
Date: Thu, 09 Feb 2023 20:49:39
Message-Id: 20230209204847.3270114-2-gyakovlev@gentoo.org
In Reply to: [gentoo-dev] cargo.eclass improvements by Georgy Yakovlev
1 and mark RUST_DEPEND as readonly
2
3 Signed-off-by: Georgy Yakovlev <gyakovlev@g.o>
4 ---
5 eclass/cargo.eclass | 28 ++++++++++++++++------------
6 1 file changed, 16 insertions(+), 12 deletions(-)
7
8 diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
9 index a92fe97ec502..d37293ada136 100644
10 --- a/eclass/cargo.eclass
11 +++ b/eclass/cargo.eclass
12 @@ -13,28 +13,32 @@
13 if [[ -z ${_CARGO_ECLASS} ]]; then
14 _CARGO_ECLASS=1
15
16 -# check and document RUST_DEPEND and options we need below in case conditions.
17 +# @ECLASS_VARIABLE: RUST_DEPEND
18 +# @INTERNAL
19 +# @DESCRIPTION:
20 +# Minimum rust/cargo version that should be used with this eclass.
21 +# Versions below that may not provide functionality we rely on.
22 +# This variable should not be overriden by ebuilds, just manually
23 +# add more recent version if package requires it.
24 # https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md
25 -RUST_DEPEND="virtual/rust"
26 +# 1.37 added 'cargo vendor' subcommand and net.offline config knob
27 +# 1.39 added --workspace
28 +# 1.46 added --target dir
29 +# 1.48 added term.progress config option
30 +# 1.51 added split-debuginfo profile option
31 +# 1.52 may need setting RUSTC_BOOTSTRAP envvar for some crates
32 +# 1.53 added cargo update --offline, can be used to update vulnerable crates from pre-fetched registry without editing toml
33 +# 1.57 added named profile support in stable
34 +readonly RUST_DEPEND=">=virtual/rust-1.57"
35
36 case "${EAPI:-0}" in
37 0|1|2|3|4|5|6)
38 die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
39 ;;
40 7)
41 - # 1.37 added 'cargo vendor' subcommand and net.offline config knob
42 - RUST_DEPEND=">=virtual/rust-1.37.0"
43 ;;
44
45 8)
46 - # 1.39 added --workspace
47 - # 1.46 added --target dir
48 - # 1.48 added term.progress config option
49 - # 1.51 added split-debuginfo profile option
50 - # 1.52 may need setting RUSTC_BOOTSTRAP envvar for some crates
51 - # 1.53 added cargo update --offline, can be used to update vulnerable crates from pre-fetched registry without editing toml
52 - RUST_DEPEND=">=virtual/rust-1.53"
53 -
54 if [[ -z ${CRATES} && "${PV}" != *9999* ]]; then
55 eerror "undefined CRATES variable in non-live EAPI=8 ebuild"
56 die "CRATES variable not defined"
57 --
58 2.39.1