On 2/19/24 11:42 PM, Sam James wrote: > > Eli Schwartz writes: > >> The meson-python build backend -- as the name suggests -- uses meson >> under the hood. We have a meson eclass which does lots of useful things >> pertinent to meson. Make sure it gets invoked. >> > > Maybe check a sample (or ideally all) of the meson-python reverse > dependencies? Actually it works great for scipy but fails for numpy since numpy is using a localized testing branch of meson... so meson_src_configure cannot parse the new meson module they are adding. This is caused by the fact that I ran meson_src_configure followed by gpep517 build-wheel. It is doubling up the configure runs, which isn't great, but it wasn't obvious to me how to solve this: - how to get at the accumulated mesonargs? - BOOST_INCLUDEDIR / BOOST_LIBRARYDIR should be made global? >> Signed-off-by: Eli Schwartz >> --- >> eclass/distutils-r1.eclass | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> >> diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass >> index c0d1992ccce0..35825d4c3aa6 100644 >> --- a/eclass/distutils-r1.eclass >> +++ b/eclass/distutils-r1.eclass >> @@ -197,6 +197,10 @@ _DISTUTILS_R1_ECLASS=1 >> inherit flag-o-matic >> inherit multibuild multilib multiprocessing ninja-utils toolchain-funcs >> >> +if [[ ${DISTUTILS_USE_PEP517} = meson-python ]]; then >> + inherit meson >> +fi >> + >> if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then >> inherit python-r1 >> else >> @@ -1386,6 +1390,7 @@ distutils_pep517_install() { >> ) >> ;; >> meson-python) >> + meson_src_configure "${DISTUTILS_ARGS[@]}" >> local -x NINJAOPTS=$(get_NINJAOPTS) >> config_settings=$( >> "${EPYTHON}" - "${DISTUTILS_ARGS[@]}" <<-EOF || die >> @@ -1397,7 +1402,6 @@ distutils_pep517_install() { >> ninjaopts = shlex.split(os.environ["NINJAOPTS"]) >> print(json.dumps({ >> "builddir": "${BUILD_DIR}", >> - "setup-args": sys.argv[1:], >> "compile-args": ["-v"] + ninjaopts, >> })) >> EOF > -- Eli Schwartz