Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp407893imu; Fri, 25 Jan 2019 04:33:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN7j13tRXAO7TpJOH9tXt6cIBeCvYl1cIT+Coif7Q+H4mWr2KJ3bQgFY75tBX4fFhKdt7SwE X-Received: by 2002:a62:da5a:: with SMTP id w26mr10793731pfl.106.1548419584000; Fri, 25 Jan 2019 04:33:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548419583; cv=none; d=google.com; s=arc-20160816; b=dkH70HwFpn1iqRerQDkpFD5DCQ95EBHniarkcOU20O01djgp8H2CGwhFUMJQ4Au0ff jIvEvgRDU0kThzyj8BKMHJ6sxovEDD+3fgPsgKNTpU5AsJUJ2jbdM0Ewl5nRkNlsn7T7 c5uId8TWhTEzrPjSEEWH7BXYgGxx68MwSbFhjiNp0kRLxLJDEPCux4TGEtuYTfB0J+6B e7gxg3T70nmLHB6gWLqWl0hJpujIWnx6MNmbek/SNmV35oVu32BQjMFo1vAZ+ZatQZl+ V7pVVPcNJxqMNoUYCz0aKyTzA9P+fesKdXd8uBSOuYAQfiJdm0TkPhL6qklyeqWLJAEG KeRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CjZ9AYFhcdv4+AoLYQaUPPk+gbdQC9YhR/c7MQ3DPTE=; b=cRf426xBSd5wHy2FVdKcpAa+XzxzEntgmIuZNP1CbjcVxRw0GY4RYX584g9+nKoyHv EO5RtKU8v/f5OLKjynSFZ1rmdevNGQHHJtDZCK7FZltKkpCOsUsS40MnMheWCcf06rTk mEp2D39UnNW6dtmh9hW/ZRibGqjv/D7kJvgSUTifMRczchQwbQB0vSPzeYi9qlYXsbaw 0qqHz7Q26rxMOJBkFZEMx/Q/QomnhFVBvqzJ454oSa2/P4gUZtNFJ06NBCD8EOV5E2Bx pttPe6UoWVqbI4tILLKq4P4ecKG7YE0qqRcegItPaxFmQBh8RuoSMyjkTAx+HQd/6CiH CHnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yx2eDzya; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k62si6891097pfc.208.2019.01.25.04.32.48; Fri, 25 Jan 2019 04:33:03 -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; dkim=pass header.i=@kernel.org header.s=default header.b=yx2eDzya; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726347AbfAYMbW (ORCPT + 99 others); Fri, 25 Jan 2019 07:31:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:39522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbfAYMbW (ORCPT ); Fri, 25 Jan 2019 07:31:22 -0500 Received: from quaco.ghostprotocols.net (unknown [147.229.117.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE51E2146E; Fri, 25 Jan 2019 12:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548419481; bh=req2DWeINf2sHwaiVPbegwHPBqhGB/aCM9FphK49bjA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yx2eDzya7ETm/VGvmD5mEje72QRnmUD4+/gHn6voAH+tBlepmXTQ+8sAypDIdFS2B 0dxtRnYHNEGUtdtzuTUpFTKd6nO9kF8qt5ZJNWMV8NS/at6+gCNEIJ7PJmeW4tT3ja OxExAfstWgnzoyv24fq++Cgr+td/Jh/kPyU0bNto= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 23B954034F; Fri, 25 Jan 2019 13:31:19 +0100 (CET) Date: Fri, 25 Jan 2019 13:31:19 +0100 From: Arnaldo Carvalho de Melo To: Tony Jones Cc: linux-kernel@vger.kernel.org, Seeteena Thoufeek , Ravi Bangoria , Jiri Olsa , Jonathan Corbet , linux-perf-users@vger.kernel.org Subject: Re: [PATCH 0/6] Fix issues with Python3 scripting Message-ID: <20190125123119.GD12077@kernel.org> References: <20190124005229.16146-1-tonyj@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190124005229.16146-1-tonyj@suse.de> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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