perf: Additional fixes for 5.5+
PATCH 1/1 perf: Additional fixes for 5.5+
In e5c4f3127521 ("perf: fix build for v5.5+") this recipe was fixed for 5.5 kernels, however testing shows that there's a few other changes required.
perf's build system uses a file from the scripts/ directory to generate a bpf header, so this must be added to the list of files to perform a replace on.
Additionally the replacement would run on all occurrences of /usr/bin/python first, resulting in lines that contained "/usr/bin/env python32". This re-orders the sed lines to avoid that.
This fixes warnings such the following:
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'
---
Found when attempting to use 5.5 with OpenBMC.
The sed method of fixing this may be fragile, and moving to patching the source tree may be preferred in the future.
meta/recipes-kernel/perf/perf.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-kernel/perf/perf.bb +2 -2
@@ -239,11 +239,11 @@ 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}" + for s in `find ${S}/tools/perf/ -name '*.py'` scripts/bpf_helpers_doc.py; do 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}" + sed -i 's,/usr/bin/python,/usr/bin/env python3,' "${s}" done # unistd.h can be out of sync between libc-headers and the captured version in the perf source
Signature · 1 line
2.24.1
Quoted 9 lines · Joel Stanley
# use /usr/bin/env instead of version specific pythonmeta/recipes-kernel/perf/perf.bb +1
-2- for s in `find ${S}/tools/perf/ -name '*.py'`; do - sed -i 's,/usr/bin/python,/usr/bin/env python3,' "${s}" + for s in `find ${S}/tools/perf/ -name '*.py'`
scripts/bpf_helpers_doc.py; dosed -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}"+ sed -i 's,/usr/bin/python,/usr/bin/env python3,' "${s}"
Can all these lines be replaced by:
sed -i -e "1s,#!.*python.*,#!${USRBINPATH}/env python3," ${s}
Thanks,
Anuj
Quoted 12 lines · Anuj
Quoted 9 lines · Joel Stanley
# use /usr/bin/env instead of version specific pythonmeta/recipes-kernel/perf/perf.bb +1
-2- for s in `find ${S}/tools/perf/ -name '*.py'`; do - sed -i 's,/usr/bin/python,/usr/bin/env python3,' "${s}" + for s in `find ${S}/tools/perf/ -name '*.py'`
scripts/bpf_helpers_doc.py; dosed -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}"+ sed -i 's,/usr/bin/python,/usr/bin/env python3,' "${s}"
Quoted 3 lines
Can all these lines be replaced by:
sed -i -e "1s,#!.*python.*,#!${USRBINPATH}/env python3," ${s}
This would have the same effect, yes.
Quoted 35 lines · Joel Stanley
In
e5c4f3127521("perf: fix build for v5.5+") this recipe was fixed for 5.5 kernels, however testing shows that there's a few other changes required.perf's build system uses a file from the
scripts/directory to generate a bpf header, so this must be added to the list of files to perform a replace on.Additionally the replacement would run on all occurrences of
/usr/bin/pythonfirst, resulting in lines that contained "/usr/bin/envpython32". This re-orders the sed lines to avoid that.This fixes warnings such the following:
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'Change-Id I8d0011908c87d5fbcf1c3aefb362fe6beb64d22eSigned-off-by Joel Stanley <[email protected]>---
Found when attempting to use 5.5 with OpenBMC.The sed method of fixing this may be fragile, and moving to patching the source tree may be preferred in the future.
meta/recipes-kernel/perf/perf.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)meta/recipes-kernel/perf/perf.bb +0
-0
meta/recipes-kernel/perf/perf.bb do_configure_prepend () { · line 242
Quoted 6 lines
meta/recipes-kernel/perf/perf.bb +1
-2@@ -239,11 +239,11 @@ 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}" + for s in `find ${S}/tools/perf/ -name '*.py'` scripts/bpf_helpers_doc.py; do
bpf_helpers_doc.py script is already python3, and according to the GIT
[1] - it was created like that. Do we really need to include it in the list? Besides, provided this is really needed - does it make sense to check all scripts instead of explicitly supplying just one here?
Quoted 10 lines
meta/recipes-kernel/perf/perf.bb +1
-1sed -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}" + sed -i 's,/usr/bin/python,/usr/bin/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
Quoted 5 lines
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 2 lines
Regards, Andrey.
Quoted 19 lines · Joel Stanley
In
e5c4f3127521("perf: fix build for v5.5+") this recipe was fixed for 5.5 kernels, however testing shows that there's a few other changes required.perf's build system uses a file from the
scripts/directory to generate a bpf header, so this must be added to the list of files to perform a replace on.Additionally the replacement would run on all occurrences of
/usr/bin/pythonfirst, resulting in lines that contained "/usr/bin/envpython32". This re-orders the sed lines to avoid that.This fixes warnings such the following:
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'
Quoted 7 lines
Change-Id I8d0011908c87d5fbcf1c3aefb362fe6beb64d22eSigned-off-by Joel Stanley <[email protected]>---
Found when attempting to use 5.5 with OpenBMC.The sed method of fixing this may be fragile, and moving to patching the source tree may be preferred in the future.
unfortunately, we cannot do patches. Since perf is a copy of the code from the kernel source, you can't carry patches that apply everywhere.
Bruce
Quoted 30 lines
meta/recipes-kernel/perf/perf.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)meta/recipes-kernel/perf/perf.bb +2
-3@@ -239,11 +239,11 @@ 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}" + for s in `find ${S}/tools/perf/ -name '*.py'` scripts/bpf_helpers_doc.py; do 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}" + sed -i 's,/usr/bin/python,/usr/bin/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
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II