[gentoo-dev] [PATCH v2 5/5] cargo.eclass: Mark GIT_CRATES as pre-inherit

2023-06-16 Thread Michał Górny
The variable needs to be set before inherit in order for ${CARGO_CRATE_URIS} to be set correctly. Currently all ebuilds using GIT_CRATES except for one define it pre-inherit anyway, and this makes it consistent with CRATES. Signed-off-by: Michał Górny --- eclass/cargo.eclass | 1 + 1 file chang

[gentoo-dev] [PATCH v2 4/5] cargo.eclass: Support separating crate names/versions via `@`

2023-06-16 Thread Michał Górny
Support specifying crate names and versions separated by `@` character rather than `-`. Since `@` are not valid in crate names, this makes splitting the tokens trivial and free of regular expressions. Effectively, the `@` variant is roughly 180% faster: ``` * CRATES with '@' separator real 952

[gentoo-dev] [PATCH v2 3/5] cargo.eclass: Optimize GIT_CRATES check

2023-06-16 Thread Michał Górny
Optimize the GIT_CRATES check to call `declare -p` only if the variable is actually set. In the vast majority of ebuilds using cargo.eclass, it's not set, so the subshell-first approach is slowing things down. With this change, the speed improves by another ~20%: ``` real 363 it/s user 365 it/s

[gentoo-dev] [PATCH v2 2/5] cargo.eclass: Add variable alternative to $(cargo_crate_uris)

2023-06-16 Thread Michał Górny
Add a helper function that sets ${CARGO_CRATE_URIS} variable to make it possible to set SRC_URI without subshells. This gives a slight speedup (~20%): ``` real 300 it/s user 324 it/s ``` Signed-off-by: Michał Górny --- eclass/cargo.eclass | 48 + e

[gentoo-dev] [PATCH v2 1/5] eclass/tests: Add a minimal benchmark for cargo.eclass

2023-06-16 Thread Michał Górny
The initial results on my machine are: ``` real 252 it/s user 289 it/s ``` Signed-off-by: Michał Górny --- eclass/tests/cargo-bench.sh | 107 1 file changed, 107 insertions(+) create mode 100755 eclass/tests/cargo-bench.sh diff --git a/eclass/tests/cargo

[gentoo-dev] [PATCH v2 0/5] cargo.eclass: optimizations

2023-06-16 Thread Michał Górny
Hi, Changes from v1: `@` is used to separate crate names and versions rather than `/`. Thanks to Denis Lisov for the suggestion. -- Best regards, Michał Górny Michał Górny (5): eclass/tests: Add a minimal benchmark for cargo.eclass cargo.eclass: Add variable alternative to $(cargo_crate_u

Re: [gentoo-dev] [PATCH 4/5] cargo.eclass: Support separating crate names/versions via slash

2023-06-16 Thread Sam James
Michał Górny writes: > On Fri, 2023-06-16 at 17:48 +0300, Denis Lisov wrote: >> Hello Michał, >> >> On Fri, Jun 16, 2023 at 3:09 PM Michał Górny wrote: >> > Support specifying crate names and versions separated by forward slashes >> > rather than hyphens. Since slashes are not valid in crate

Re: [gentoo-dev] [PATCH 4/5] cargo.eclass: Support separating crate names/versions via slash

2023-06-16 Thread Michał Górny
On Fri, 2023-06-16 at 17:48 +0300, Denis Lisov wrote: > Hello Michał, > > On Fri, Jun 16, 2023 at 3:09 PM Michał Górny wrote: > > Support specifying crate names and versions separated by forward slashes > > rather than hyphens. Since slashes are not valid in crate names, this > > makes splitting

Re: [gentoo-dev] [PATCH 4/5] cargo.eclass: Support separating crate names/versions via slash

2023-06-16 Thread Denis Lisov
Hello Michał, On Fri, Jun 16, 2023 at 3:09 PM Michał Górny wrote: > Support specifying crate names and versions separated by forward slashes > rather than hyphens. Since slashes are not valid in crate names, this > makes splitting the tokens trivial and free of regular expressions. > Effectively

[gentoo-dev] [PATCH 5/5] cargo.eclass: Mark GIT_CRATES as pre-inherit

2023-06-16 Thread Michał Górny
The variable needs to be set before inherit in order for ${CARGO_CRATE_URIS} to be set correctly. Currently all ebuilds using GIT_CRATES except for one define it pre-inherit anyway, and this makes it consistent with CRATES. Signed-off-by: Michał Górny --- eclass/cargo.eclass | 1 + 1 file chang

[gentoo-dev] [PATCH 4/5] cargo.eclass: Support separating crate names/versions via slash

2023-06-16 Thread Michał Górny
Support specifying crate names and versions separated by forward slashes rather than hyphens. Since slashes are not valid in crate names, this makes splitting the tokens trivial and free of regular expressions. Effectively, the slash variant is roughly 180% faster: ``` * CRATES with slashes real

[gentoo-dev] [PATCH 3/5] cargo.eclass: Optimize GIT_CRATES check

2023-06-16 Thread Michał Górny
Optimize the GIT_CRATES check to call `declare -p` only if the variable is actually set. In the vast majority of ebuilds using cargo.eclass, it's not set, so the subshell-first approach is slowing things down. With this change, the speed improves by another ~20%: ``` real 363 it/s user 365 it/s

[gentoo-dev] [PATCH 2/5] cargo.eclass: Add variable alternative to $(cargo_crate_uris)

2023-06-16 Thread Michał Górny
Add a helper function that sets ${CARGO_CRATE_URIS} variable to make it possible to set SRC_URI without subshells. This gives a slight speedup (~20%): ``` real 300 it/s user 324 it/s ``` Signed-off-by: Michał Górny --- eclass/cargo.eclass | 48 + e

[gentoo-dev] [PATCH 1/5] eclass/tests: Add a minimal benchmark for cargo.eclass

2023-06-16 Thread Michał Górny
The initial results on my machine are: ``` real 252 it/s user 289 it/s ``` Signed-off-by: Michał Górny --- eclass/tests/cargo-bench.sh | 107 1 file changed, 107 insertions(+) create mode 100755 eclass/tests/cargo-bench.sh diff --git a/eclass/tests/cargo

[gentoo-dev] [PATCH 0/5] cargo.eclass: optimizations

2023-06-16 Thread Michał Górny
Hi, cargo.eclass is one of the slowest eclasses in ::gentoo, and does some pretty heavy processing in global scope. Here's a series of patches to optimize its behavior. Unfortunately, the optimizations cannot be done without changing the API. However, the series preserves backwards compatibilit

[gentoo-dev] [PATCH] common-lisp-3.eclass: Don't inherit eutils

2023-06-16 Thread Ulrich Müller
Neither the eclass nor any of the ebuilds inheriting common-lisp-3 needs eutils features. Signed-off-by: Ulrich Müller --- eclass/common-lisp-3.eclass | 2 -- 1 file changed, 2 deletions(-) diff --git a/eclass/common-lisp-3.eclass b/eclass/common-lisp-3.eclass index 6c87ef3db842..cd654f37b904 1

[gentoo-dev] [PATCH 2/2] rpm.eclass: Don't inherit eutils in EAPI 7

2023-06-16 Thread Ulrich Müller
None of the ebuilds inheriting rpm in EAPI 7 needs any of the remaining eutils features. Signed-off-by: Ulrich Müller --- eclass/rpm.eclass | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eclass/rpm.eclass b/eclass/rpm.eclass index d03493466e1e..d8bb0ad2814d 100644 --- a/ec

[gentoo-dev] [PATCH 1/2] rpm.eclass: Drop support for EAPI 5

2023-06-16 Thread Ulrich Müller
Signed-off-by: Ulrich Müller --- eclass/rpm.eclass | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eclass/rpm.eclass b/eclass/rpm.eclass index c97e23144c2b..d03493466e1e 100644 --- a/eclass/rpm.eclass +++ b/eclass/rpm.eclass @@ -1,14 +1,14 @@ -# Copyright 1999-2021