From: Khem Raj <raj.khem@gmail.com>
To: Bruce Ashfield <bruce.ashfield@gmail.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v3] perf: Correct the substitution of python shebangs
Date: Fri, 21 Feb 2020 14:30:00 -0800 [thread overview]
Message-ID: <9c19e3eb-d6de-a3eb-05ae-9c33f2a51000@gmail.com> (raw)
In-Reply-To: <CADkTA4PRZsy2yvQ8rG8V=vXYhwFrBPTi63XsN+t=HPesAv9Wzg@mail.gmail.com>
On 2/21/20 2:23 PM, Bruce Ashfield wrote:
> On Fri, Feb 21, 2020 at 5:16 PM Khem Raj <raj.khem@gmail.com> wrote:
>>
>>
>>
>> On 2/21/20 1:43 PM, Joshua Watt wrote:
>>> On Thu, Feb 13, 2020 at 9:58 PM <zhe.he@windriver.com> wrote:
>>>>
>>>> From: He Zhe <zhe.he@windriver.com>
>>>>
>>>> To make the native python3 is always used,
>>>>
>>>> - Use sed one-liner instead
>>>> - Add substitution for ${S}/scripts/bpf_helpers_doc.py to fix the
>>>> following warning.
>>>>
>>>> File "/usr/lib/python3.6/sysconfig.py", line 421, in _init_posix
>>>> _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
>>>> ModuleNotFoundError: No module named '_sysconfigdata'
>>>>
>>>> This issue is first reported by Joel Stanley <joel@jms.id.au>
>>>> The sed one-liner is credited to Anuj Mittal <anuj.mittal@intel.com>
>>>>
>>>> Signed-off-by: He Zhe <zhe.he@windriver.com>
>>>> ---
>>>> meta/recipes-kernel/perf/perf.bb | 7 ++-----
>>>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
>>>> index 6d1b06693d..a6fb51d3db 100644
>>>> --- a/meta/recipes-kernel/perf/perf.bb
>>>> +++ b/meta/recipes-kernel/perf/perf.bb
>>>> @@ -239,11 +239,8 @@ do_configure_prepend () {
>>>> fi
>>>>
>>>> # use /usr/bin/env instead of version specific python
>>>> - for s in `find ${S}/tools/perf/ -name '*.py'`; do
>>>> - sed -i 's,/usr/bin/python,/usr/bin/env python3,' "${s}"
>>>> - sed -i 's,/usr/bin/python2,/usr/bin/env python3,' "${s}"
>>>> - sed -i 's,/usr/bin/env python2,/usr/bin/env python3,' "${s}"
>>>> - sed -i 's,/usr/bin/python3,/usr/bin/env python3,' "${s}"
>>>> + for s in `find ${S}/tools/perf/ -name '*.py'` ${S}/scripts/bpf_helpers_doc.py; do
>>>
>>> Do we have to hard code bpf_helpers_doc.py? It doesn't exist in older
>>> versions (e.g. 4.14) and causes do_configure to fail.
>>
>> Probably not, I also stumbled into this problem.
>
> Yah,
>
> We can either just do the entire directory (but during the review, we
> were talking about the fact that since we aren't using them, we don't
> actually know if they are py3 safe, so blindly converting the shebang
> isnt' a great idea either).
>
> But the solution we use in the devsrc recipe would work easily enough
> here, just do $(find . -name ${S}/scripts/bpf_helpers_doc.py) and let
> it return nothing for those older kernels.
then perhaps its better to callout each script by name and check if that
file exists, so older kernels can ignore that
>
> Bruce
>
>>
>>>
>>>> + sed -i -e "s,#!.*python.*,#!${USRBINPATH}/env python3," ${s}
>>>> done
>>>>
>>>> # unistd.h can be out of sync between libc-headers and the captured version in the perf source
>>>> --
>>>> 2.24.1
>>>>
>>>> --
>>>> _______________________________________________
>>>> Openembedded-core mailing list
>>>> Openembedded-core@lists.openembedded.org
>>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>
>
prev parent reply other threads:[~2020-02-21 22:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-14 3:57 [PATCH v3] perf: Correct the substitution of python shebangs zhe.he
2020-02-14 4:33 ` Chen, Qi
2020-02-14 13:18 ` Bruce Ashfield
2020-02-14 18:09 ` Richard Purdie
2020-02-21 21:43 ` Joshua Watt
2020-02-21 22:15 ` Khem Raj
2020-02-21 22:23 ` Bruce Ashfield
2020-02-21 22:30 ` Khem Raj [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=9c19e3eb-d6de-a3eb-05ae-9c33f2a51000@gmail.com \
--to=raj.khem@gmail.com \
--cc=bruce.ashfield@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/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