Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Waldemar Brodkorb <wbx@openadk.org>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/avahi: fix python install issue
Date: Sun, 18 Aug 2024 12:11:15 +0200	[thread overview]
Message-ID: <ZsHIw+TLPfA7tort@waldemar-brodkorb.de> (raw)
In-Reply-To: <ZsG9eKK5aBo4DSjF@landeda>

Hi Yann,
Yann E. MORIN wrote,

> Waldemar, All,
> 
> On 2024-08-17 15:18 +0200, Waldemar Brodkorb spake thusly:
> > Since the update of Python to 3.12.4 in commit
> > 76cd14167f5eb3ffe22e131ddbbecf9bc61f2ef1 avahi fails to install
> > python subcomponents. The reason is that the obsolete imp
> > python modul is used. Add a patch to remove the imp dependency.
> > 
> > Fixes:
> >  - http://autobuild.buildroot.net/results/2bf/2bf391b93362204917a560705bc402585334ab3c
> > 
> > Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> 
> Applied to master, thanks.

Thanks you.
 
> But see below
> 
> > ---
> >  .../0002-remove-imp-from-py-compile.patch     | 50 +++++++++++++++++++
> >  1 file changed, 50 insertions(+)
> >  create mode 100644 package/avahi/0002-remove-imp-from-py-compile.patch
> > 
> > diff --git a/package/avahi/0002-remove-imp-from-py-compile.patch b/package/avahi/0002-remove-imp-from-py-compile.patch
> > new file mode 100644
> > index 0000000000..37534a3f7a
> > --- /dev/null
> > +++ b/package/avahi/0002-remove-imp-from-py-compile.patch
> > @@ -0,0 +1,50 @@
> > +Remove optional imp python module dependency.
> > +
> > +Upstream already removed py-compile entirely in their git repository,
> > +so the patch is not appropiate for upstream.
> 
> This is really weird: the git tree removed the py-comple in 2005, and it
> is not present in the v0.8 tag, but then the release tarball, that we
> use, does carry that file.
> 
> Could you see with upstream how they end up with py-compile in the
> released archive, while it is not in git?
> 
> There is a risk that that file gets added somehow by the autotools
> packagng process, so it will eventually be present in the next release
> as well, and we'd have to carry that patch forever and ever...

You are right, py-compile is generated.
But in avahi git you get one with following code:

python_major=`$PYTHON -V 2>&1 | sed -e 's/.* //;s/\..*$//;1q'`
if test -z "$python_major"; then
  echo "$me: could not determine $PYTHON major version, guessing 3" >&2
  python_major=3
fi

# The old way to import libraries was deprecated.
if test "$python_major" -le 2; then
  import_lib=imp
  import_test="hasattr(imp, 'get_tag')"
  import_call=imp.cache_from_source
  import_arg2=', False' # needed in one call and not the other
else
  import_lib=importlib
  import_test="hasattr(sys.implementation, 'cache_tag')"
  import_call=importlib.util.cache_from_source
  import_arg2=
fi

$PYTHON -c "
import sys, os, py_compile, $import_lib
...

So I believe newer Python version is handled there.

best regards
 Waldemar
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2024-08-18 10:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-17 13:18 [Buildroot] [PATCH] package/avahi: fix python install issue Waldemar Brodkorb
2024-08-18  9:23 ` Yann E. MORIN
2024-08-18 10:11   ` Waldemar Brodkorb [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZsHIw+TLPfA7tort@waldemar-brodkorb.de \
    --to=wbx@openadk.org \
    --cc=buildroot@buildroot.org \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox