linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] perf build: Add Debian/Ubuntu python-is-python3
Date: Mon, 20 Oct 2025 10:31:36 +0100	[thread overview]
Message-ID: <20251020093136.GD281971@e132581.arm.com> (raw)
In-Reply-To: <aPRR1APPW8vro4HB@google.com>

On Sun, Oct 19, 2025 at 11:49:56AM +0900, Namhyung Kim wrote:

[...]

> > Aha, I found it.  After uninstalling python3-dev, I got into the same
> > state as yesterday:
> > 
> >     $ make tools/perf
> >     [...]
> >     Makefile.config:875: No python interpreter was found: disables
> > Python support - please install python-devel/python-dev
> >     Makefile.config:918: *** ERROR: No python interpreter needed for
> > jevents generation. Install python or build with NO_JEVENTS=1..  Stop.
> > 
> > So these error messages sound like python is missing. And "python"
> > is indeed missing, but "python3" is available.
> > Hence I installed python-is-python3, but that turned out not to be
> > sufficient.
> > Hence I also installed python-dev-is-python3, and that fixed the issue,
> > as python-dev-is-python3 depends on python3-dev, so the latter was
> > installed, too.
> > 
> > After removing python-is-python3 and python-dev-is-python3, everything
> > keeps on working.  But if you never installed python3-dev manually,
> > and run "sudo apt autoremove", python3-dev is uninstalled, reintroducing
> > the issue.
> > 
> > So just recomming to install python-dev-is-python3 in the error
> > message should be sufficient?
> > 
> > What do you think?

Can we explicitly suggest that developers install python3-devel or
python3-dev instead?  Two reasons:

- python-dev-is-python3 is specific to Ubuntu/Debian; some distros do
  not provide this package and even advocate against using unversioned
  "/usr/bin/python" shebangs [1].

- As Namhyung mentioned, perf has removed Python 2 support (at least
  this is claimed), it is straightforward to install only the Python3
  packages.

[...]

> I think the code was to deal with either python2 or python3 in the past
> and we removed python2 support recently.  I don't know if any distro
> made 'python' to refer python3 and removed 'python3' otherwise we can
> just check python3.

I agreed with only checking python3 - neat and compatible for distros.

Just note, some legacy python shebangs are left, we can update to
"#!/usr/bin/env python3" but this can be done separately.

  $ git grep "#\!.*/usr/bin.*python"
  python/tracepoint.py:#! /usr/bin/env python
  python/twatch.py:#! /usr/bin/env python
  scripts/python/export-to-postgresql.py:#   #!/usr/bin/python2
  scripts/python/exported-sql-viewer.py:#!/usr/bin/env python
  scripts/python/libxed.py:#!/usr/bin/env python
  tests/shell/lib/perf_json_output_lint.py:#!/usr/bin/python

Thanks,
Leo

[1] https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package#Motivation

  reply	other threads:[~2025-10-20  9:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 12:44 [PATCH 0/2] perf build: Ubuntu LTS fixes Geert Uytterhoeven
2025-10-16 12:44 ` [PATCH 1/2] perf build: Fix confusing "No python interpreter needed" message Geert Uytterhoeven
2025-10-16 12:44 ` [PATCH 2/2] perf build: Add Debian/Ubuntu python-is-python3 Geert Uytterhoeven
2025-10-17 12:29   ` Leo Yan
2025-10-17 16:39     ` Geert Uytterhoeven
2025-10-19  2:49       ` Namhyung Kim
2025-10-20  9:31         ` Leo Yan [this message]
2025-10-20 10:15           ` Geert Uytterhoeven
2025-10-20 11:05             ` Leo Yan

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=20251020093136.GD281971@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=geert@linux-m68k.org \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).