From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 059301580EB for ; Thu, 22 May 2025 05:57:43 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id E18C53431C3 for ; Thu, 22 May 2025 05:57:42 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 6FC981104AE; Thu, 22 May 2025 05:56:57 +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)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id AC5241103DE for ; Thu, 22 May 2025 05:56:56 +0000 (UTC) Received: from eversor (unknown [24.157.215.217]) (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) (Authenticated sender: ionen) by smtp.gentoo.org (Postfix) with ESMTPSA id ED3E23430E6; Thu, 22 May 2025 05:56:55 +0000 (UTC) Date: Thu, 22 May 2025 01:56:53 -0400 From: Ionen Wolkens To: gentoo-dev@lists.gentoo.org, base-system@gentoo.org Subject: Re: [gentoo-dev] [PATCH] meson.eclass: setup python binaries if python eclasses are used Message-ID: Mail-Followup-To: gentoo-dev@lists.gentoo.org, base-system@gentoo.org References: <20250522043745.31273-1-eschwartz@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: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hqpfvUKz2p5dY0EF" Content-Disposition: inline In-Reply-To: X-Archives-Salt: 3a0a8e39-b435-43d9-8bb6-9616ec712384 X-Archives-Hash: 260157d77eb90fb02a20b5a41f1ebcf7 --hqpfvUKz2p5dY0EF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 22, 2025 at 01:08:07AM -0400, Ionen Wolkens wrote: > On Thu, May 22, 2025 at 12:35:48AM -0400, Eli Schwartz wrote: > > This has been bothering me for a while. Meson will detect > > find_program('python3') as the dummy shim in ${T} defined by the eclass, > > and py.find_installation() may be the python that *Meson* was built > > with. In DISTUTILS_USE_PEP517=3Dmeson-python a dedicated machine file is > > created by the build backend but we should set this for other types of > > packages as well. > >=20 > > Signed-off-by: Eli Schwartz > > --- > > eclass/meson.eclass | 11 ++++++++++- > > 1 file changed, 10 insertions(+), 1 deletion(-) > >=20 > > diff --git a/eclass/meson.eclass b/eclass/meson.eclass > > index a2bc5537e458..ab82234942d5 100644 > > --- a/eclass/meson.eclass > > +++ b/eclass/meson.eclass > > @@ -1,4 +1,4 @@ > > -# Copyright 2017-2024 Gentoo Authors > > +# Copyright 2017-2025 Gentoo Authors > > # Distributed under the terms of the GNU General Public License v2 > > =20 > > # @ECLASS: meson.eclass > > @@ -224,7 +224,16 @@ _meson_create_native_file() { > > pkg-config =3D '$(tc-getBUILD_PKG_CONFIG)' > > strip =3D $(_meson_env_array "$(tc-getBUILD_STRIP)") > > windres =3D $(_meson_env_array "$(tc-getBUILD_PROG RC windres)") > > + EOF > > + > > + if [[ -n ${EPYTHON} ]]; then > > + cat >> "${fn}" <<-EOF > > + python =3D '${EPREFIX}/usr/bin/${EPYTHON}' > > + python3 =3D '${EPREFIX}/usr/bin/${EPYTHON}' > > + EOF > > + fi >=20 > One problem is that there is two potential usecase here. >=20 > 1. build system storing path for runtime use (rare'ish) > 2. using at build time for some script (more common) >=20 > 1 should indeed be ${EPREFIX}/usr/bin/${EPYTHON} > 2 should be either the wrapper or ${PYTHON} which includes BROOT To add to this, guess we "could" use ${PYTHON} here as it'll be right when ROOT is unset and not break build-time usage for crossdev, but feel that just makes wrong-runtime-path issues harder to notice (vs the ${T} one) given we'll only spot issues with ROOT. tl;dr think the current situation is better even if means needing ebuild workarounds for #1. >=20 > So I think this breaks ROOT builds unless I'm missing something. >=20 > > =20 > > + cat >> "${fn}" <<-EOF > > [built-in options] > > c_args =3D $(_meson_env_array "${BUILD_CFLAGS} ${BUILD_CPPFLAGS}") > > c_link_args =3D $(_meson_env_array "${BUILD_CFLAGS} ${BUILD_LDFLAGS}") > > --=20 > > 2.49.0 > >=20 > >=20 >=20 > --=20 > ionen --=20 ionen --hqpfvUKz2p5dY0EF Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmguvKQACgkQskQGsLCs QzQnQQf5AX5ELkkwKh/AH52HtEBaep+C/wt7pvGf2tbpfOblU9DHk24fs8nZFVM/ duFiGrIUrT+Xndlz/9uRWvkAZfum31ftVbkahByUrRD/ovgWCK42By9wMrQ84pDW iKZYS+UU2CK5vFQ1d+oIz2ICaJWtjk/JgY4oGATHlwVTWs/9/MkKJ5mW+C+p74Qi Ia6fxk1pBvZRBxY3IGqEFBfotGYN40YEWbyD7T9s4byuAtnyW7h8k6QQiX6hyC1J Dy/ZmXSpY8IuZ0VX88mJJPHYgHnXEolSjFSWtQL8zs08Oxo1xnQh/tcc9ai0CSJ1 3OEDB4qVZOEIU5JPEeaGdYi2usHzPA== =fMHD -----END PGP SIGNATURE----- --hqpfvUKz2p5dY0EF--