From: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@kernel.org>, Paul Mackerras <paulus@samba.org>,
Namhyung Kim <namhyung.kim@lge.com>,
LKML <linux-kernel@vger.kernel.org>, Jiri Olsa <jolsa@redhat.com>,
Thomas Ilsche <thomas.ilsche@tu-dresden.de>
Subject: Re: [PATCH v2 2/2] perf tools: Default to python version 2
Date: Sat, 02 Aug 2014 12:56:48 +0200 [thread overview]
Message-ID: <53DCC3F0.6000105@tu-dresden.de> (raw)
In-Reply-To: <20140801202149.GB13375@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 3449 bytes --]
Zitat von Arnaldo Carvalho de Melo <acme@kernel.org>:
> Em Tue, Jul 29, 2014 at 03:57:20PM +0900, Namhyung Kim escreveu:
>> According to PEP 394 recommendation [1], it's more portable to use
>> python2 rather than plain python to refer python binary version 2.
>>
>> Since there're distros using python3 by default like Arch, and we
>> don't support python3 (yet), it'd be better using python2 explicitly.
>>
>> But older versions (prior to 2.7) seem not to provide python2 but just
>> python. Given that it's only old version, try python2 first and then
>> fallback to python. It'll ensure that it always points to python 2.x.
>
> It should fallback, right?
Yes.
> [acme@fedora14 linux]$ ls -la /usr/bin/python2-config
> ls: cannot access /usr/bin/python2-config: No such file or directory
> [acme@fedora14 linux]$ ls -la /usr/bin/python-config
> lrwxrwxrwx. 1 root root 16 Mar 25 09:43 /usr/bin/python-config ->
> python2.7-config
Appearently this fedora package symlinks python -> python2 but does not so for
python2-config. The Makefile looks for either python2 or python as fallback and
then assumes that a respective "-config" exists. I think this is a sane assumption.
I guess if this needs to be supported, there needs to be another fallback if
$(PYTHON)-config is not found to try python-config again. However this may
behave weirdly if someone has python2, no python2-devel but python3-devel
installed, sets PYTHON=python2 and then still gets a version error. Or we
somehow only fallback if no PYTHON is specified (not sure how to implemented
that elegantly).
Best,
Thomas
> [acme@fedora14 linux]$ rpm -qf /usr/bin/python-config
> python-devel-2.7-8.fc14.1.x86_64
> [acme@fedora14 linux]$ cat /etc/fedora-release
> Fedora release 14 (Laughlin)
> [acme@fedora14 linux]$
>
> [acme@fedora14 linux]$ time make O=/tmp/build/perf -C tools/perf install
> make: Entering directory `/home/acme/git/linux/tools/perf'
> BUILD: Doing 'make -j4' parallel build
> config/Makefile:126: The path '/usr/bin/python2-config' is not executable.
> config/Makefile:339: No libdw DWARF unwind found, Please install
> elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR
> config/Makefile:481: Missing perl devel files. Disabling perl scripting
> support, consider installing perl-ExtUtils-Embed
> config/Makefile:512: No python-config tool was found
> config/Makefile:512: Python support will not be built
>
>> [1] https://www.python.org/dev/peps/pep-0394
>>
>> Suggested-by: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
>> Tested-by: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>> ---
>> tools/perf/config/Makefile | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
>> index e05d8f99424d..60177278a357 100644
>> --- a/tools/perf/config/Makefile
>> +++ b/tools/perf/config/Makefile
>> @@ -121,8 +121,8 @@ ifdef PARSER_DEBUG
>> endif
>>
>> ifndef NO_LIBPYTHON
>> - override PYTHON := \
>> - $(call get-executable-or-default,PYTHON,python)
>> + PYTHON2 := $(if $(call get-executable,python2),python2,python)
>> + override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON2))
>> override PYTHON_CONFIG := \
>> $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
>>
>> --
>> 2.0.0
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5015 bytes --]
next prev parent reply other threads:[~2014-08-02 10:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-29 6:57 [PATCH v2 1/2] perf tools: Fix make PYTHON override Namhyung Kim
2014-07-29 6:57 ` [PATCH v2 2/2] perf tools: Default to python version 2 Namhyung Kim
2014-08-01 20:21 ` Arnaldo Carvalho de Melo
2014-08-02 10:56 ` Thomas Ilsche [this message]
2014-08-02 13:20 ` Arnaldo Carvalho de Melo
2014-08-04 13:03 ` [PATCH v3 " Thomas Ilsche
2014-08-04 15:35 ` Arnaldo Carvalho de Melo
2014-08-13 5:19 ` [tip:perf/core] " tip-bot for Thomas Ilsche
2014-07-31 14:38 ` [PATCH v2 1/2] perf tools: Fix make PYTHON override Arnaldo Carvalho de Melo
2014-08-13 5:17 ` [tip:perf/core] " tip-bot for Namhyung Kim
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=53DCC3F0.6000105@tu-dresden.de \
--to=thomas.ilsche@tu-dresden.de \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.