> -----Original Message-----
> From: [email protected] <openembedded-
> [email protected]> On Behalf Of Tim Orling
> Sent: den 23 februari 2022 23:09
> To: [email protected]
> Cc: Tim Orling <[email protected]>
> Subject: [OE-core] [PATCH 1/4] python3-pip-native: install scripts in
> ${bindir}
>
> The naïve approach of simply unzipping the built wheel is not
> sufficient. 'pip install' would normally have created the
> [console_scripts] from entry-points.txt in ${D}${bindir}.
>
> For bootstrapping purposes, hardcode the scripts and install them into
> ${D}${bindir}. Skip the ${bindir}/pip variant.
>
> [YOCTO #14739]
>
> Signed-off-by: Tim Orling <[email protected]>
> ---
> .../python/python3-pip_22.0.3.bb | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/meta/recipes-devtools/python/python3-pip_22.0.3.bb
> b/meta/recipes-devtools/python/python3-pip_22.0.3.bb
> index 482a210ee99..5a77cb72d70 100644
> --- a/meta/recipes-devtools/python/python3-pip_22.0.3.bb
> +++ b/meta/recipes-devtools/python/python3-pip_22.0.3.bb
> @@ -23,6 +23,23 @@ do_install:class-native() {
For the record, OE-Core uses tabs to indent shell code,
compared to OpenEmbedded, which uses four spaces...
> install -d ${D}${PYTHON_SITEPACKAGES_DIR}
> unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PYPA_WHEEL} || \
There is no reason for the backslash at the end of the line above.
However, the line below should be indented to indicate that it is
a continuation of the line above,
> bbfatal_log "Failed to unzip wheel: ${PYPA_WHEEL}. Check the logs."
> +
> + # pip install would normally generate [console_scripts] in ${bindir}
> + install -d ${D}/${bindir}
Change "${D}/${bindir}" to "${D}${bindir}".
> + # We will skip the ${bindir}/pip variant as we would just remove it in
> the do_install:append
> + cat << EOF >> ${D}/${bindir}/pip3 | tee
> ${D}/${bindir}/pip${PYTHON_BASEVERSION}
Change the above to:
cat << EOF > pip3
or even better would be:
cat <<-EOF > pip3
as you then can indent the code below.
And the creation of the file belongs in do_compile:class-native()
instead.
> +#!/bin/sh
> +'''exec' ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} "\$0"
> "\$@"
> +' '''
What's the reason for the above construct? Why doesn't this work:
#!${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}
If it doesn't, then there should be a comment explaining what's
going on.
> +# -*- coding: utf-8 -*-
> +import re
> +import sys
> +from pip._internal.cli.main import main
> +if __name__ == '__main__':
> + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
> + sys.exit(main())
> +EOF
Isn't the code for pip3 available somewhere in the source code
so it could be copied from there instead? What happens if
upstream decides to change the implementation of pip3?
> + chmod 0755 ${D}${bindir}/pip3 ${D}${bindir}/pip${PYTHON_BASEVERSION}
Change the above to:
install pip3 ${D}${bindir}
install pip3 ${D}${bindir}/pip${PYTHON_BASEVERSION}
> }
>
> do_install:append() {
> --
> 2.30.2
Most of the above comments also apply to the patch for
python3-wheel-native.
//Peter
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#162282):
https://lists.openembedded.org/g/openembedded-core/message/162282
Mute This Topic: https://lists.openembedded.org/mt/89352490/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-