On Fri, 2023-10-20 at 14:57 +0200, Julien Stephan wrote:
> Le jeu. 19 oct. 2023 à 20:34, Alexandre Belloni
> <alexandre.bell...@bootlin.com> a écrit :
> > 
> > On 19/10/2023 20:20:33+0200, Julien Stephan wrote:
> > > Le jeu. 19 oct. 2023 à 15:49, Alexandre Belloni
> > > <alexandre.bell...@bootlin.com> a écrit :
> > > > 
> > > > Hello,
> > > > 
> > > > On 19/10/2023 09:36:53+0200, Julien Stephan wrote:
> > > > > add support for PEP517 [1]
> > > > > 
> > > > > if a pyproject.toml file is found, use it to create the recipe,
> > > > > otherwise fallback to the old setup.py method.
> > > > > 
> > > > > [YOCTO #14737]
> > > > > 
> > > > > [1]: https://peps.python.org/pep-0517/
> > > > > 
> > > > > Signed-off-by: Julien Stephan <jstep...@baylibre.com>
> > > > > ---
> > > > >  .../lib/recipetool/create_buildsys_python.py  | 234 
> > > > > +++++++++++++++++-
> > > > >  1 file changed, 233 insertions(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/scripts/lib/recipetool/create_buildsys_python.py 
> > > > > b/scripts/lib/recipetool/create_buildsys_python.py
> > > > > index 69f6f5ca511..0b601d50a4b 100644
> > > > > --- a/scripts/lib/recipetool/create_buildsys_python.py
> > > > > +++ b/scripts/lib/recipetool/create_buildsys_python.py
> > > > > @@ -18,6 +18,7 @@ import os
> > > > >  import re
> > > > >  import sys
> > > > >  import subprocess
> > > > > +import toml
> > > > 
> > > > This fails on the autobuilders because we don't have the toml module 
> > > > installed so I guess you need to add a dependency.
> > > > 
> > > 
> > > Hello,
> > > 
> > > Sure I 'll do it. Just to confirm, I should add it here:
> > > https://docs.yoctoproject.org/ref-manual/system-requirements.html#required-packages-for-the-build-host
> > > ?
> > 
> > I guess the preferred way would be to depend on python3-toml-native
> > instead of requiring installation on the host.
> > 
> 
> Hi Alexandre,
> 
> How am I supposed to do that for a script? Is that even possible? Am I
> missing something obvious?

As far as I know you're not missing anything obvious. If the toml
dependency was in the target recipe this would be easier but needing
this from recipetool is harder as it is running under the host python.

Adding dependencies for the host is hard as it needs to be added on the
docs, on the autobuilder workers and into our buildtools-extended-
tarballs and generally impacts a lot of people/places.

I think moving the import into the code and having recipe tool error
and ask the user to install the dependency might be the best solution
for now. That does give us a challenge over where/when we can test the
code though.

On the autobuilder we could run recipetool for this test using the
python3native from a recipe sysroot where the toml dependency is
available I guess but that is a bit ugly.

As Tim mentions, with python 3.11 onwards, this problem does go away.
We could also make the test conditional upon the host python version I
guess so it only runs on newer hosts?

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#189537): 
https://lists.openembedded.org/g/openembedded-core/message/189537
Mute This Topic: https://lists.openembedded.org/mt/102055999/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to