From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8081A159C96 for ; Thu, 25 Jul 2024 11:50:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BB4C5E2AF7; Thu, 25 Jul 2024 11:50:34 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5FD8FE2AED for ; Thu, 25 Jul 2024 11:50:34 +0000 (UTC) From: Sam James To: James Le Cuirot Cc: gentoo-dev Subject: Re: [gentoo-dev] [PATCH 4/5 v3] cargo.eclass: Shadow flag variables so that LTO filtering remains local In-Reply-To: <20240725112005.10045-9-chewi@gentoo.org> (James Le Cuirot's message of "Thu, 25 Jul 2024 12:19:38 +0100") Organization: Gentoo References: <20240725112005.10045-3-chewi@gentoo.org> <20240725112005.10045-9-chewi@gentoo.org> Date: Thu, 25 Jul 2024 12:50:30 +0100 Message-ID: <87ikwtk7w9.fsf@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain X-Archives-Salt: 2ea9381d-148f-42f2-8f12-6edc74817074 X-Archives-Hash: 5a9ba73e805f1998f7bcd9f31d3328dc James Le Cuirot writes: > Signed-off-by: James Le Cuirot > --- > 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.