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 32DF315800A for ; Wed, 16 Aug 2023 12:13:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1E5CE2BC02B; Wed, 16 Aug 2023 12:13:11 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 D00642BC017 for ; Wed, 16 Aug 2023 12:13:10 +0000 (UTC) Message-ID: <91c2ce9213ec7f4238d584e6ae291175d18c69f1.camel@gentoo.org> Subject: Re: [gentoo-dev] [PATCH v2] python-utils-r1.eclass: Fix PYTHON_SITEDIR/INCLUDEDIR for cross-prefix From: James Le Cuirot To: gentoo-dev@lists.gentoo.org Date: Wed, 16 Aug 2023 13:12:47 +0100 In-Reply-To: References: <20230816064604.11064-1-chewi@gentoo.org> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-gWGjRWhqdkqs1oPLR2hP" User-Agent: Evolution 3.48.3 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 X-Archives-Salt: 2388083f-6e62-4e57-aae8-2b00db789fbb X-Archives-Hash: b0cf2e056d0759f89e39e5e8703c6d7c --=-gWGjRWhqdkqs1oPLR2hP Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2023-08-16 at 12:47 +0200, Micha=C5=82 G=C3=B3rny wrote: > On Wed, 2023-08-16 at 07:39 +0100, James Le Cuirot wrote: > > We dynamically determine Python's SITEDIR and INCLUDEDIR using the buil= d > > host's Python. This breaks down when the build host's prefix differs > > from the target host's prefix, so chop off the former and prepend the > > latter. > >=20 > > This assumes that each Python implementation is always installed using > > the same scheme. Meson already makes this assumption, and gpep517 makes > > a similar assumption to determine Python's stdlib location. > >=20 > > We could improve on this and determine these locations using SYSROOT's > > sysconfigdata file, like gpep517 does, but this seems needlessly > > complex. We would need to take this approach for PYTHON_LIBPATH and > > PYTHON_CONFIG, but these are only used by handful of packages. > >=20 > > ${BROOT-${EPREFIX}} is needed rather than plain ${BROOT} for the same > > reason we need it for PYTHON, namely that Portage <3.0.50 was buggy. > >=20 > > Signed-off-by: James Le Cuirot > > --- > >=20 > > Note that gpep517 also needs the same treatment, but I'll handle that > > later. This at least allows Portage itself to be installed. > >=20 > > eclass/python-utils-r1.eclass | 2 ++ > > 1 file changed, 2 insertions(+) > >=20 > > diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.ecl= ass > > index 2fffd6d56bf5..abfb74832f30 100644 > > --- a/eclass/python-utils-r1.eclass > > +++ b/eclass/python-utils-r1.eclass > > @@ -351,6 +351,7 @@ _python_export() { > > print(sysconfig.get_path("purelib")) > > EOF > > ) > > + PYTHON_SITEDIR=3D"${EPREFIX}${PYTHON_SITEDIR#${BROOT-${EPREFIX}}}" > > export PYTHON_SITEDIR > > debug-print "${FUNCNAME}: PYTHON_SITEDIR =3D ${PYTHON_SITEDIR}" > > ;; > > @@ -362,6 +363,7 @@ _python_export() { > > print(sysconfig.get_path("platinclude")) > > EOF > > ) > > + PYTHON_INCLUDEDIR=3D"${ESYSROOT}${PYTHON_INCLUDEDIR#${BROOT-${EPRE= FIX}}}" > > export PYTHON_INCLUDEDIR > > debug-print "${FUNCNAME}: PYTHON_INCLUDEDIR =3D ${PYTHON_INCLUDEDI= R}" > >=20 > >=20 >=20 > You don't seem to have changed that, actually. Ah! Sorry, I shouldn't make changes in a rush before starting the day job. ionen said globbing, when this is technically pattern matching, so I got confused and thought quoting the whole thing would fix it. Actually globbin= g doesn't even occur when assigning variables. --=-gWGjRWhqdkqs1oPLR2hP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQJFBAABCAAvFiEEPxcZ3tkwcedKm2a8EiZBXQDdMTcFAmTcvT8RHGNoZXdpQGdl bnRvby5vcmcACgkQEiZBXQDdMTekEhAAlB7WvDgxR/l4ElbBEWVGnaJdJ96JmMjW 252EMdcFREzYMgWcLEPSVyrTgQY+Py/ZkmbVvX++piXDfmXyBSmI7VNshvUwk+du oeywMcCaMALksXw+PxUPZSML+0jHQqzH84mdxWVMAY25H0UHBvmG/+FmE6tAlPhy QBprXiMMk4iiwkPm/llr0SQpzAqoaksPKcESp8Ws6gC3q3SufHAT7QJDsGJABT7d EUal/K7SG/UayRSJ4H2rPZyDEe4bW+FVYtvB7rNwYxOHS4NkZ4tN9r+Q1qVgimY8 bpqyVPvTwhqEIC3aN31p7s+PmUf7gMP2G/FVSo6KfP9xkfMrc/WxjVHx92UU7e3l 7Gtj/7YVEONjdiquNp9GMe+nTjhtoTDbBrgLAQoaVf/y8qzIOYgdQtS8ZQNYS9EX PdA78pTa8TodZXl5C0NAzTEhGAIWK/k5qp1/NyVI7lupG3paxTjBZcvypoaB0knx 57yY7bDVLkNhRwHfLriz9W8ekncpLgt1cddLJgR2eqMRyWypwoEwc5XVLrlqAQaM 5s78GDL4PptkYbylzDMi4Pvu3W/uZEFmxzUMFLHxTIA9P2vt38AjuwjLjAO0qCVR 5lIBKKm7tLjmfeZ5PoQ13X0FFTBBvcot4P8sg7g2J/3DcYd782gJ32Bwe3j4801z Xdcilj8rIDg= =P2JN -----END PGP SIGNATURE----- --=-gWGjRWhqdkqs1oPLR2hP--