Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp744358imu; Fri, 25 Jan 2019 10:10:09 -0800 (PST) X-Google-Smtp-Source: ALg8bN5gZUG3PXyoVqWYyQ1m6Vz6p+8BUKpy7G9IrQ7jbK9TPQ/QhkJBPi4B0r+lm30/sh4tIFOL X-Received: by 2002:a63:7b06:: with SMTP id w6mr10841373pgc.288.1548439809863; Fri, 25 Jan 2019 10:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548439809; cv=none; d=google.com; s=arc-20160816; b=ntBZekFe10nTBrz4SSdjGcX7FocYWqLHV1M30y2rTvk3FVEQJi0HzBCPaALLMD27me SsGnQU1q6AhYPCp2mddWZP4xjpSOK2xnPP/vlN3R7f3mf1/5HSrulDGscQhcg1jKHk7D ewlHpoC5QtKz9mswfbbH26r4KKGrmE3vjgU6eFErwV6M1Q++tcoRn//sam92j70cq//j Qh1K9U830rIilG6TZ0N5sseyCaoCbgpNiZlsi4GQ6saUEanfhIfoYAjgmBNjjiYMhkEm q3OuIcuB25XFwhcFEqocMWmkOkjsib4wCKRFodWfcD47cBeghXE3Tsikk99iuE9Uu2mN j6vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=8m2WLrXpPuxDXi8KWSH0OcZSW+eX12wWWVMQj5XxuEM=; b=aSdmk9Md2HjNoVafGoWNYrZx13wRT+LRcbbJAZjiDGVGiIE9sjq4fi1eabWcfSEgH1 RbwDAXC9kkp9d0hoYvXCd6MmLU5qwdnvGwkfYacG62i0yyXlk9gnZWDhcvyO11gmN6Tg nSTdd7i3y4bZo+aZA7PaCTAghSwnMePQYLBzm7wYzDCI2PxJcDH7EhXqnreuss7sbkUW 8LoaIDY/F+v9M0osyREGy1wQdC1UzduvC0oS15C0ixZR9+A9Y8ba29fO6+rO6ewieoBm /R+KCOmPhFk7bex143ImWQdzxUzeDrcjEpKcvLc8lIh5KflyGPudOSHMtSXZKx2OPGph cI5w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d66si25212730pfg.36.2019.01.25.10.09.54; Fri, 25 Jan 2019 10:10:09 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729353AbfAYSJu (ORCPT + 99 others); Fri, 25 Jan 2019 13:09:50 -0500 Received: from mx2.suse.de ([195.135.220.15]:56590 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729129AbfAYSJu (ORCPT ); Fri, 25 Jan 2019 13:09:50 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 04F49ADC2; Fri, 25 Jan 2019 18:09:48 +0000 (UTC) Subject: Re: [PATCH 0/6] Fix issues with Python3 scripting To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Seeteena Thoufeek , Ravi Bangoria , Jiri Olsa , Jonathan Corbet , linux-perf-users@vger.kernel.org References: <20190124005229.16146-1-tonyj@suse.de> <20190125123119.GD12077@kernel.org> <20190125135730.GE12077@kernel.org> From: Tony Jones Openpgp: preference=signencrypt Autocrypt: addr=tonyj@suse.de; prefer-encrypt=mutual; keydata= mQGiBEkQmbwRB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Qf/b5cVNyb5i8QI0G7BPGBNn4VlQX5n66TsPBnrRNOi3MhTTVEBCp8s+jqUjJjX EjjA+O4hIm7Qqdsozurw7GlcQ0A06dIzO/1RUglZZMoC0JL43ZQmJ+3+yFrLjWgGH6ev6AOb YLH7ZujgAB5n0Hy2ZIChzsKLKbHptFtBvpDKB8updq+GunsY4oN3wGa67h9sHqDvjyp64Czg n8G5uGLwx3f/edbECKz5kPUSzChEk3suK742SEP01v4ra5WX88Hn81NjGByQMz9acJLdC7Ff LzXvbNa0KgvDaSllYfsJIoGCz3eKVOuTWXOiaEIKuy833+3mr2PulLCyLKysAEddKohJBBgR AgAJBQJJEJm8AhsMAAoJELFYWyEf4koXhgQAn1EGATLZPS53At9t+p3S8BkNI9yRAJ9A0OmL liv+rwEesYGlGeGNaKHTJw== Message-ID: Date: Fri, 25 Jan 2019 10:09:43 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20190125135730.GE12077@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/25/19 5:57 AM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jan 25, 2019 at 01:31:19PM +0100, Arnaldo Carvalho de Melo escreveu: >> Em Wed, Jan 23, 2019 at 04:52:23PM -0800, Tony Jones escreveu: >>> Seeteena posted, earlier this week, some patches to add Python3 support >>> to scripts/python/*.py. Unfortunately there were some issues with these >>> patches (such as: https://lkml.org/lkml/2019/1/17/351) >>> >>> Since I already had a tested set of patches in openSUSE:Factory and >>> SLE15-SP1 and was about to submit them, Seeteena and I that agreed I >>> should post my patches not involving scripts/python/*.py and Seeteena >>> will later resubmit the patches for scripts/python/*.py incorporating >>> my review feedback under a joint signed-off-by. >>> >>> It should be noted that the use of "from __future__ import print_function" >>> (see: https://lkml.org/lkml/2019/1/16/641) and "except as" (see change to: >>> tests/attr.py) implies Python2 >= 2.6 as the necessary support has not >>> been backported to prior versions. I am not sure if it's worth detecting >>> <2.6 at build time or whether it's sufficiently old as to be a non-issue? >>> >>> The shebang changes were driven mostly by our build process as it scans >>> all files within an rpm and the shebangs would result in a rpm requires >>> on the python2 binary when BuildRequires was python3-devel. I think they >>> make sense to apply upstream but understand totally if it's prefered we >>> keep them local. >>> >>> These changes have been tested with PYTHON=python2 (v2.7) and >>> PYTHON=python3 (v3.6) on latest openSUSE Tumbleweed. I did notice that >>> test #18 "'import perf' in python" is failing on my system without these >>> changes. I'll look at it further but didn't want to hold up Seeteena's >>> resubmit. >> >> So it fails on AmazonLinux 1, that has python 2.6, please check if this >> is something we can workaround, if its difficult, I'll just use >> NO_PYTHON=1 there to disable it. Sorry about this. I'll be sure to test more broadly next time. >> >> CC /tmp/build/perf/util/parse-branch-options.o >> util/scripting-engines/trace-event-python.c: In function 'python_start_script': >> util/scripting-engines/trace-event-python.c:1520:2: error: passing argument 1 of 'PyImport_AppendInittab' discards 'const' qualifier from pointer target type [-Werror] >> PyImport_AppendInittab("perf_trace_context", initfunc); >> ^ >> In file included from /usr/include/python2.6/Python.h:130:0, >> from util/scripting-engines/trace-event-python.c:22: >> /usr/include/python2.6/import.h:54:17: note: expected 'char *' but argument is of type 'const char *' >> PyAPI_FUNC(int) PyImport_AppendInittab(char *name, void (*initfunc)(void)); >> ^ >> cc1: all warnings being treated as errors >> mv: cannot stat '/tmp/build/perf/util/scripting-engines/.trace-event-python.o.tmp': No such file or directory >> make[5]: *** [/tmp/build/perf/util/scripting-engines/trace-event-python.o] Error 1 > > I did a quick hack to init an auto variable with that const string and > then pass it, is passing everything so far: I see that you already amended in cc4376422552 Thanks!