From: Michael Witten <mfwitten@gmail.com>
To: Raghavendra D Prabhu <rprabhu@wnohang.net>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Use the environment variable PYTHON if defined
Date: Sat, 09 Apr 2011 20:34:10 +0000 [thread overview]
Message-ID: <7f7c5d35-e644-4950-a3d3-dfcf46d5237e-mfwitten@gmail.com> (raw)
In-Reply-To: <20110409184245.GA5115@Xye>
On Sun, 10 Apr 2011 00:12:45 +0530, Raghavendra D Prabhu wrote:
> I have a question regarding the message that is displayed.
> It says "No Python.h found" when variable PYTHON is not set
> correctly, it would be better if it said "No Python.h for
> Python 2.x found" since the header file supplied by Py3k is
> also Python.h and in the rare case of only Py3k installed on
> the box, it may be confusing.
Well...
If PYTHON or PYTHON_CONFIG don't point to an executable, then
there is a complaint about no executable being found.
If PYTHON (or, more specifically, PYTHON_CONFIG) points to the
Python *3* binary, then the message will be about Python 3 being
incompatible.
If PYTHON or PYTHON_CONFIG point to an executable that does not
provide a suitable `Python.h', then it says `No Python.h found'.
Thus, I think all of the cases are covered pretty well.
In particular, let's say that somebody triggers the third case,
but is confused because he does indeed have Python 3 with a valid
Python.h installed. That `No Python.h found' message will cause
him to look at how he configured PYTHON{,_CONFIG}, and he'll
see that he used the wrong executable (which is probably a
fairly unlikely scenario, anyway). Thus, he will configure the
right variable to point to the Python 3 executable, only to
get a message that Python 3 is incompatible. Thus, he will then
know that Python 2 is required.
I suppose, though, we could simplify the experience for the user
by giving a hint earlier on that Python 2 is required.
The patch that follows fulfills your request. My advice is to
save this email to /tmp/email and then apply it over the last
couple of patches like this:
$ git apply /tmp/email
$ git commit -a --amend -C HEAD
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 1fd46bf..b5276c7 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -522,7 +522,7 @@ else
FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
- $(call disable-python,Python.h)
+ $(call disable-python,Python.h (for Python 2.x))
else
ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED)),y)
next prev parent reply other threads:[~2011-04-09 20:41 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-26 22:44 Raghavendra D Prabhu
2011-03-28 14:47 ` Arnaldo Carvalho de Melo
2011-03-28 22:36 ` Michael Witten
2011-03-29 18:15 ` Raghavendra D Prabhu
2011-03-29 19:15 ` Michael Witten
2011-03-29 20:40 ` Arnaldo Carvalho de Melo
2011-03-29 21:02 ` Michael Witten
2011-03-29 21:14 ` Arnaldo Carvalho de Melo
2011-03-31 19:15 ` Raghavendra D Prabhu
2011-03-31 20:29 ` Michael Witten
2011-04-02 20:46 ` Raghavendra D Prabhu
2011-04-02 22:40 ` Michael Witten
2011-03-31 15:37 ` Michael Witten
2011-04-08 21:17 ` Raghavendra D Prabhu
2011-04-09 1:24 ` Michael Witten
2011-04-02 21:46 ` [PATCH 2/2] perf tools: Makefile: PYTHON{,_CONFIG} to bandage Python 3 incompatibility Michael Witten
2011-04-09 1:12 ` [PATCH 1/2] perf tools: Makefile: Clean up `python/perf.so' rule Michael Witten
2011-04-09 18:42 ` [PATCH] Use the environment variable PYTHON if defined Raghavendra D Prabhu
2011-04-09 20:34 ` Michael Witten [this message]
2011-04-12 20:52 ` [PULL] Improve Python 3 handling Michael Witten
2011-04-21 9:22 ` [tip:perf/core] perf tools: Makefile: PYTHON{,_CONFIG} to bandage Python 3 incompatibility tip-bot for Michael Witten
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=7f7c5d35-e644-4950-a3d3-dfcf46d5237e-mfwitten@gmail.com \
--to=mfwitten@gmail.com \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rprabhu@wnohang.net \
/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
Powered by JetHome