[Buildroot] [PATCH v14 4/5] package/pkg-meson.mk: set Python sysconfigdata

Adam Duskett aduskett at gmail.com
Wed Oct 23 20:42:54 UTC 2019


Arnout:

On Tue, Oct 22, 2019 at 3:19 PM Arnout Vandecappelle <arnout at mind.be> wrote:
>
>
>
> On 22/10/2019 23:58, Arnout Vandecappelle wrote:
> >  Note that this patch was authored by me, Adam accidentally took over authorship
> > (which is why he said on IRC he needs to send a v15).
> >
> > On 22/10/2019 22:59, Thomas Petazzoni wrote:
> >> On Mon, 21 Oct 2019 13:04:37 -0700
> >> aduskett at gmail.com wrote:
> >>
> >>> +   _PYTHON_SYSCONFIGDATA_NAME="$$(if $$(BR2_PACKAGE_PYTHON3),$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" \
> >>
> >> Why do we need this conditional on BR2_PACKAGE_PYTHON3 ?
> >> package/pkg-python.mk is using PKG_PYTHON_SYSCONFIGDATA_NAME
> >> unconditionally, regardless of Python 2.x vs. Python 3.x. Could you
> >> explain this ?
> >
> >  I can :-)
> >
> >  It's a mistake. I noticed that PKG_PYTHON_SYSCONFIGDATA_NAME was left empty for
> > python2, so I made sure it got the correct value (in Python2 there is only one
> > _sysconfigdata). However, python2 doesn't have the _PYTHON_SYSCONFIGDATA_NAME
> > variable so it's meaningless.
> >
> >  Should be tested if things work OK with python2 on target, but I expect they do.
>
>  I hadn't read Adam's remark in the cover letter yet, about how this patch
> breaks the build of libglib2.
>
>  I suspect that we shold not set _PYTHON_SYSCONFIGDATA_NAME if python3 is not
> selected. Indeed, python3 *will* observe this environment variable, but if
> target python3 is not selected, it will be empty. meson will do checks for
> host-python, and setting that environment variable will break the check (which
> is BTW an example of the comment I made in the commit log of this patch: "Note
> that this approach will still break things when meson needs to build something
> for the host during a target build."). libglib2 indeed does use python3 during
> the build, so it asks meson to check for it, but since it doesn't try to build C
> modules for the host, it still works even with a wrong _sysconfigdata.
>
>  Adam, could you test if this works better?
>
> +       $$(if
> $$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME)")
> \
$$(if $$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)"
Also does not work, because the target python3 may not yet be built.

>
>
>
>  Regards,
>  Arnout


More information about the buildroot mailing list