perf: python: Fix build when PYTHON_CONFIG is user supplied
PATCH 1/1 perf: python: Fix build when PYTHON_CONFIG is user supplied
The previous change to Python autodetection had a small mistake where the auto value was used to determine the Python binary, rather than the user supplied value. The Python binary is only used for one part of the build process, rather than the final linking, so it was producing correct builds in most scenarios, especially when the auto detected value matched what the user wanted, or the system only had a valid set of Pythons.
Change it so that the Python binary path is derived from either the PYTHON_CONFIG value or PYTHON value, depending on what is specified by the user. This was the original intention.
This error was spotted in a build failure an odd cross compilation environment after commit 4c41cb46a732fe82 ("perf python: Prefer python3") was merged.
--- tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile.config +1 -1
@@ -265,7 +265,7 @@ endif # defined. get-executable-or-default fails with an error if the first argument is supplied but # doesn't exist. override PYTHON_CONFIG := $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON_AUTO)) -override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_AUTO))) +override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_CONFIG))) grep-libs = $(filter -l%,$(1)) strip-libs = $(filter-out -l%,$(1))
Signature · 1 line
2.28.0
Quoted 13 lines · James Clark
The previous change to Python autodetection had a small mistake where the auto value was used to determine the Python binary, rather than the user supplied value. The Python binary is only used for one part of the build process, rather than the final linking, so it was producing correct builds in most scenarios, especially when the auto detected value matched what the user wanted, or the system only had a valid set of Pythons.
Change it so that the Python binary path is derived from either the
PYTHON_CONFIGvalue or PYTHON value, depending on what is specified by the user. This was the original intention.
Quoted 6 lines
This error was spotted in a build failure an odd cross compilation environment after commit
4c41cb46a732fe82("perf python: Prefer python3") was merged.Fixes 630af16eee495f58 ("perf tools: Use Python devtools for version autodetection rather than runtime")Signed-off-by James Clark <[email protected]>
Thanks,
Ian
Quoted 20 lines
--- tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/Makefile.config +1
-2@@ -265,7 +265,7 @@ endif # defined. get-executable-or-default fails with an error if the first argument is supplied but # doesn't exist. override PYTHON_CONFIG := $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON_AUTO)) -override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_AUTO))) +override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_CONFIG))) grep-libs = $(filter -l%,$(1)) strip-libs = $(filter-out -l%,$(1)) --2.28.0
Em Thu, Jul 28, 2022 at 09:37:32AM -0700, Ian Rogers escreveu:
Quoted 14 lines · James Clark
Quoted 13 lines
The previous change to Python autodetection had a small mistake where the auto value was used to determine the Python binary, rather than the user supplied value. The Python binary is only used for one part of the build process, rather than the final linking, so it was producing correct builds in most scenarios, especially when the auto detected value matched what the user wanted, or the system only had a valid set of Pythons.
Change it so that the Python binary path is derived from either the
PYTHON_CONFIGvalue or PYTHON value, depending on what is specified by the user. This was the original intention.
Quoted 8 lines
Quoted 6 lines
This error was spotted in a build failure an odd cross compilation environment after commit
4c41cb46a732fe82("perf python: Prefer python3") was merged.Fixes 630af16eee495f58 ("perf tools: Use Python devtools for version autodetection rather than runtime")Signed-off-by James Clark <[email protected]>Acked-by Ian Rogers <[email protected]>
Thanks, applied.
- Arnaldo
Quoted 23 lines
Thanks,
IanQuoted 20 lines
--- tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/Makefile.config +1
-2@@ -265,7 +265,7 @@ endif # defined. get-executable-or-default fails with an error if the first argument is supplied but # doesn't exist. override PYTHON_CONFIG := $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON_AUTO)) -override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_AUTO))) +override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_CONFIG))) grep-libs = $(filter -l%,$(1)) strip-libs = $(filter-out -l%,$(1)) --2.28.0
Signature · 1 line
- Arnaldo
Quoted 19 lines · Arnaldo Carvalho de Melo
Em Thu, Jul 28, 2022 at 09:37:32AM -0700, Ian Rogers escreveu:
Quoted 18 lines · James Clark
Quoted 17 lines
The previous change to Python autodetection had a small mistake where the auto value was used to determine the Python binary, rather than the user supplied value. The Python binary is only used for one part of the build process, rather than the final linking, so it was producing correct builds in most scenarios, especially when the auto detected value matched what the user wanted, or the system only had a valid set of Pythons.
Change it so that the Python binary path is derived from either the
PYTHON_CONFIGvalue or PYTHON value, depending on what is specified by the user. This was the original intention.This error was spotted in a build failure an odd cross compilation environment after commit
4c41cb46a732fe82("perf python: Prefer python3") was merged.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Fixes 630af16eee495f58 ("perf tools: Use Python devtools for version autodetection rather than runtime")Signed-off-by James Clark <[email protected]>Acked-by Ian Rogers <[email protected]>Thanks, applied.
Hi Arnaldo,
I couldn't find this change in any of your branches. Do you know if it got dropped somehow or was there an issue with it?
Thanks
James
Quoted 28 lines
- Arnaldo
Quoted 23 lines
Thanks,
IanQuoted 20 lines
--- tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/Makefile.config +1
-2@@ -265,7 +265,7 @@ endif # defined. get-executable-or-default fails with an error if the first argument is supplied but # doesn't exist. override PYTHON_CONFIG := $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON_AUTO)) -override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_AUTO))) +override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_CONFIG))) grep-libs = $(filter -l%,$(1)) strip-libs = $(filter-out -l%,$(1)) --2.28.0
Arnaldo Carvalho de Melo
maintainerEm Mon, Aug 22, 2022 at 11:08:37AM +0100, James Clark escreveu:
Quoted 25 lines · Arnaldo Carvalho de Melo
Quoted 22 lines
Em Thu, Jul 28, 2022 at 09:37:32AM -0700, Ian Rogers escreveu:
Quoted 21 lines · James Clark
Quoted 19 lines
The previous change to Python autodetection had a small mistake where the auto value was used to determine the Python binary, rather than the user supplied value. The Python binary is only used for one part of the build process, rather than the final linking, so it was producing correct builds in most scenarios, especially when the auto detected value matched what the user wanted, or the system only had a valid set of Pythons.
Change it so that the Python binary path is derived from either the
PYTHON_CONFIGvalue or PYTHON value, depending on what is specified by the user. This was the original intention.This error was spotted in a build failure an odd cross compilation environment after commit
4c41cb46a732fe82("perf python: Prefer python3") was merged.Fixes 630af16eee495f58 ("perf tools: Use Python devtools for version autodetection rather than runtime")Signed-off-by James Clark <[email protected]>
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Acked-by Ian Rogers <[email protected]>Thanks, applied.
Hi Arnaldo,
I couldn't find this change in any of your branches. Do you know if it got dropped somehow or was there an issue with it?
Applied it to my local perf/urgent branch, testing now. I thought I had processed it, not really :-\
- Arnaldo