Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp994060ybb; Wed, 25 Mar 2020 13:32:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvsZsv0Bs4zbrbHnZcJu0AWBLS5Fj0/AAP4aBioEGkmLb2aVWDR1HToSLjfBENOXB9O2wpr X-Received: by 2002:aca:d446:: with SMTP id l67mr3939197oig.115.1585168339007; Wed, 25 Mar 2020 13:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585168338; cv=none; d=google.com; s=arc-20160816; b=FvPyNOPDc1G/mPEUPS5stewU5c2M0a4FV/04rxVu5Y85i4FSCfR70833i4HTQdyL7a Ic4+W+KoPKOcin7Ecb5jtUz/ZQQHUSOTD/15pVIvVcospvwIXjcRmGxfrsHU1UN6WULs eCkWcwVyo7V4t76SoP594blAhPN+sxfuMIY2Ju4HMESEDxabDIdNru4IXuT5gzKDMnhP 5BGAILDifwhyuLyYqxjv6asGgnqRDgBT7Hb4bpXmf5vVibmx6zmCmd/MJx6Z+OE5exkL LwDkVzhb6s8uiYolx9KVtcmRYsfRVuhXQC2s117YzLajcUIGW5lo7RKUFlI2rLjs1unv 301Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=v/Soi+AtCkjv5EFY6mwxhlnaHyokmI6akGeDjAoTVAs=; b=O06uDu5G0MvHjKbWKOyMM8BKIY3rgHdW7Trc6uV6eaNhk+ExqxaPN1UUqJR8eeENwJ KZc1dhz03eruYGiaAsEaG5qsrQZ4OV91UfDNcpLsTsrhsC76gmNtAlM9tp0FcvJka2xV UsUrbEEvwbb+8Cbub5DGcbovlOK4s7JTtqxQKB7dWQjkScly2iPU8FO1GIOS04+gIlRO Lhn+3/B3pfdfGd3SMkxJduk4jnkHpFeo5/WVyFyBtzLnOk2+YZhqHhE6rdwd5HOwS4hj MgzIF9wvrJIHHRRpzvha5vHpY4qkBThGU33+S9Zwk3K6uERl+U+9X3LCie3ozOgxL+aU O4ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HYnKrF+a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si83313otc.58.2020.03.25.13.32.06; Wed, 25 Mar 2020 13:32:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HYnKrF+a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727357AbgCYUb1 (ORCPT + 99 others); Wed, 25 Mar 2020 16:31:27 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:45832 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727236AbgCYUb1 (ORCPT ); Wed, 25 Mar 2020 16:31:27 -0400 Received: by mail-io1-f67.google.com with SMTP id a24so3122659iol.12 for ; Wed, 25 Mar 2020 13:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v/Soi+AtCkjv5EFY6mwxhlnaHyokmI6akGeDjAoTVAs=; b=HYnKrF+a2u3hfvTx7gQjR+7/E/YBo5PxyiRtgdtM9UvcD4ide7K9CNcG/v2diCIAgN ER2EkAeGcFoG0hW5Rn7sMaxyU+b3fNBhZjp5R/uzK+s0/+V6mpQ+RmiXknky3qnuOiwc rXxmtnONFlxV+MqWv+3vzwFJIgcp1GrUpxW3iH8nZRTwK/d6S/csrunkcoKjz4+H8pqW hafRUtn5dtagnGI0w/H+wb+K7KXTnaW89J7XVqmT8WK256JYwKPDNi+mtZj+JC8IfTZo GH/6PWvhUGbybFOw0O3nwQvdyZ9eFtbCldUjTYwXjcRJsoE2nU8Q8vzKwj4A5YfNKn2B 14Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v/Soi+AtCkjv5EFY6mwxhlnaHyokmI6akGeDjAoTVAs=; b=Nlh2KlPoJAOsPdXy+ahDGBAPydrsBZhxUm3ysFRd1y7TrHTWeKrTeOqF2NQLgbZfnz y5sLfKKWvAcM120SqHLpWL4aJKfx0EGNUBChL4VP7gaYFRf5TO/G9LhlGg621MWOXgUv QNiImWINkx/Q7i1TNlYPxVxbfRvDaDkA6U8fRkjeSK/H8WhD1xpCyPtZ9MRm1pfjzKrR knJePfGeM9I0s22ckmtOzOP8gb2mb0mOf088qHgcnBfRy3hCxDoAHAAZ/BlYIl5NL/bu iVmlse4LNLzhw2uFshiucq6D0mcg2kNjs1oaQtMvxeBlmd2TTX/UUcBY0OUkiT19m3oS gU8Q== X-Gm-Message-State: ANhLgQ3nPL4JL/YSNn3yHZurYPDjctsvBer0NJzKZ79n2glFbYKfSY4d RFET2QIpeY8nEsUXYNwCaxjZsoH11FK76pSERSc= X-Received: by 2002:a02:9288:: with SMTP id b8mr4752194jah.59.1585168286345; Wed, 25 Mar 2020 13:31:26 -0700 (PDT) MIME-Version: 1.0 References: <1581618066-187262-1-git-send-email-zhe.he@windriver.com> <20200216222148.GA161771@krava> <8cc46abf-208d-4aa4-8d0d-4922106bee6e@windriver.com> <20200325133012.GC14102@kernel.org> <20200325192640.GI14102@kernel.org> In-Reply-To: <20200325192640.GI14102@kernel.org> From: Sam Lunt Date: Wed, 25 Mar 2020 15:31:15 -0500 Message-ID: Subject: Re: [PATCH 1/2] perf: Be compatible with all python versions when fetching ldflags To: Arnaldo Carvalho de Melo Cc: He Zhe , Jiri Olsa , peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 25, 2020 at 2:26 PM Arnaldo Carvalho de Melo wrote: > > Em Wed, Mar 25, 2020 at 09:40:34AM -0500, Sam Lunt escreveu: > > On Wed, Mar 25, 2020 at 8:30 AM Arnaldo Carvalho de Melo > > wrote: > > > > > > Em Mon, Feb 17, 2020 at 10:24:27AM +0800, He Zhe escreveu: > > > > > > > > > > > > On 2/17/20 6:22 AM, Jiri Olsa wrote: > > > > > On Fri, Feb 14, 2020 at 02:21:05AM +0800, zhe.he@windriver.com wrote: > > > > >> From: He Zhe > > > > >> > > > > >> Since Python v3.8.0, with the following commit > > > > >> 0a8e57248b91 ("bpo-36721: Add --embed option to python-config (GH-13500)"), > > > > > we got similar change recently.. might have not been picked up yet > > > > > > > > > > https://lore.kernel.org/lkml/20200131181123.tmamivhq4b7uqasr@gmail.com/ > > > > > > > > Thanks for pointing out. > > > > > > So, just with your patch: > > > > > > [acme@five perf]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf > > > [acme@five perf]$ make PYTHON=python3 -C tools/perf O=/tmp/build/perf install-bin |& grep python > > > ... libpython: [ OFF ] > > > Makefile.config:750: No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev > > > CC /tmp/build/perf/tests/python-use.o > > > [acme@five perf]$ > > > > > > [acme@five perf]$ rpm -q python2-devel python3-devel python-devel > > > package python2-devel is not installed > > > python3-devel-3.7.6-2.fc31.x86_64 > > > package python-devel is not installed > > > [acme@five perf]$ > > > > > > [acme@five perf]$ cat /tmp/build/perf/feature/test-libpython.make.output > > > /bin/sh: --configdir: command not found > > > [acme@five perf]$ cat /tmp/build/perf/feature/test-libpython > > > test-libpython.make.output test-libpython-version.make.output > > > [acme@five perf]$ cat /tmp/build/perf/feature/test-libpython-version.make.output > > > /bin/sh: --configdir: command not found > > > [acme@five perf]$ > > > > > > > > > Without your patch: > > > > > > [acme@five perf]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf > > > [acme@five perf]$ make PYTHON=python3 -C tools/perf O=/tmp/build/perf install-bin |& grep python > > > ... libpython: [ on ] > > > GEN /tmp/build/perf/python/perf.so > > > MKDIR /tmp/build/perf/scripts/python/Perf-Trace-Util/ > > > CC /tmp/build/perf/scripts/python/Perf-Trace-Util/Context.o > > > LD /tmp/build/perf/scripts/python/Perf-Trace-Util/perf-in.o > > > CC /tmp/build/perf/tests/python-use.o > > > CC /tmp/build/perf/util/scripting-engines/trace-event-python.o > > > INSTALL python-scripts > > > [acme@five perf]$ > > > > > > [acme@five perf]$ ldd /tmp/build/perf/perf |& grep python > > > libpython3.7m.so.1.0 => /lib64/libpython3.7m.so.1.0 (0x00007f11dd1ee000) > > > [acme@five perf]$ perf -vv |& grep -i python > > > libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT > > > [acme@five perf]$ > > > > > > What am I missing? > > > > It looks like you are using python3.7, but the change in behavior for > > python-config happened in version 3.8 > > Humm, but shouldn't this continue to work with python3.7? Oh, my mistake, I didn't read the output carefully. It should obviously still work with old versions, yes. I actually submitted a similar patch, and it seemed to work when I used python 3.7. I wonder if the issue is the "||" operator in the subshell. https://lore.kernel.org/lkml/20200131181123.tmamivhq4b7uqasr@gmail.com/ > - Arnaldo > > > > [acme@five perf]$ cat /etc/redhat-release > > > Fedora release 31 (Thirty One) > > > [acme@five perf]$ > > > > > > - Arnaldo > > -- > > - Arnaldo