• Re: [gentoo-dev] [PATCH 4/5 v3] cargo.eclass: Shadow flag variables so

    From Sam James@21:1/5 to James Le Cuirot on Thu Jul 25 14:00:02 2024
    James Le Cuirot <chewi@gentoo.org> writes:

    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    eclass/cargo.eclass | 9 +++++++++
    1 file changed, 9 insertions(+)

    diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
    index 44d3f7ee31f59..9f0bffee0e048 100644
    --- a/eclass/cargo.eclass
    +++ b/eclass/cargo.eclass
    @@ -532,7 +532,16 @@ cargo_src_configure() {
    # host and target host respectively. Ensure these are set consistently between
    # Cargo invocations, otherwise rebuilds will occur.
    cargo_env() {
    + # Shadow flag variables so that filtering below remains local.
    + local flag
    + for flag in $(all-flag-vars); do
    + local -x "${flag}=${!flag}"
    + done
    +
    + # Rust extensions are incompatible with C/C++ LTO compiler see e.g.
    + # https://bugs.gentoo.org/910220
    filter-lto
    +

    Maybe mention in the commit message that this is what we do for
    distutils-r1 too.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)