Re: [PATCH v3 0/3] Rewrite jevents program in python

From: Ian Rogers
Date: Tue Jun 14 2022 - 23:13:56 EST


On Tue, Jun 14, 2022 at 9:10 AM John Garry <john.garry@xxxxxxxxxx> wrote:
>
> On 14/06/2022 17:03, Ian Rogers wrote:
> >> diff -u tools/perf/trace/beauty/include/linux/socket.h
> >> include/linux/socket.h
> >> Makefile.config:259: *** which python-config not found. Stop.
> >> Makefile.perf:239: recipe for target 'sub-make' failed
> >> make[1]: *** [sub-make] Error 2
> >> Makefile:69: recipe for target 'all' failed
> >> make: *** [all] Error 2
> >> john@debian:~/linux/tools/perf$
> >>
> >> JFYI, this is my alternatives:
> >>
> >> sudo update-alternatives --config python
> >> There are 3 choices for the alternative python (providing
> >> /usr/bin/python).
> >>
> >> Selection Path Priority Status
> >> ------------------------------------------------------------
> >> 0 /usr/local/bin/python3.6 50 auto mode
> >> 1 /usr/bin/python2.7 1 manual mode
> >> 2 /usr/bin/python3.5 2 manual mode
> >> * 3 /usr/local/bin/python3.6 50 manual mode
> >>
> >> Press <enter> to keep the current choice[*], or type selection number:
> > Thanks Gary,
> >
> > Perhaps it relates to dev packages. Perhaps, apt-get install
> > python-dev-is-python3 which should resolve the symlinks. I wonder that
> > you have python dev for python2 but python3 installed without the dev.
> > We should be able to make a Makefile test for this.
>
> So I was trying another system here as a sanity test (as my main dev box
> is not working either). And this other system is debian and only
> supports python up to 3.5, so that is why I have
> /usr/local/bin/python3.6 as an alt, i.e. I downloaded and built myself.
>
> Anyway, I do have python3-dev:
>
> john@debian:~/linux/tools/perf$ sudo apt-get install python3-dev
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> python3-dev is already the newest version (3.5.3-1).
>

It turned out to be something simple. The build is set up to prefer
python2 over python3, so if you have both you get python2. I've fixed
this now in v4 (PTAL):
https://lore.kernel.org/lkml/20220615030438.51477-1-irogers@xxxxxxxxxx/

I think we should remove python2 build support as it is confusing and
python2 doesn't support setuptools meaning this patch fails:
https://lore.kernel.org/lkml/20220615014206.26651-1-irogers@xxxxxxxxxx/
and without that patch python3 generates deprecated module warnings.

Thanks,
Ian