From patchwork Tue Nov 22 13:50:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 697727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tNRhH5nD3z9svs for ; Wed, 23 Nov 2016 00:51:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="eu1YiqDQ"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:content-type; q=dns; s=default; b=AZ+fQO4fPnSJs8gEP/sxu GZV4AIW+Vj4fNGWKUGnZXXUo/6jgg4y9U7zP8g5lcaKJrPKvaocneemdU3jVouN/ HGyarrecpCaPDFuwe0hTSa4VYvzU2gTXJ5CMtHxsOlVYRFgKRYNRUXxv14sffpPf mFh8gP4GbljJToPTkzYrfE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:content-type; s=default; bh=2PSh2cByV0dGScU3m2RQ1nQ4560 =; b=eu1YiqDQ3BAwqR8inoZ2nDnH5p2O1xdEzfdLZFdxgBpAJwgyAbnZIuqEqSi hTBodXXVpZ951zVlWS0Ngv4XWakaRMPnm77mzPrmhSUf2ViFbirxDXLEHqu1+prN jRMLPMExZZh1S+6iGVAsaQIbeIRQiuiJ+rDhahBvHrRuEnSQ= Received: (qmail 26595 invoked by alias); 22 Nov 2016 13:51:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 26554 invoked by uid 89); 22 Nov 2016 13:51:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sf X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Message-ID: <58344D35.7080506@arm.com> Date: Tue, 22 Nov 2016 13:50:45 +0000 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: GNU C Library CC: Subject: [PATCH] make build-many-glibcs.py work on python3.2 X-ClientProxiedBy: DB4PR04CA0006.eurprd04.prod.outlook.com (10.160.41.16) To DB6PR0802MB2151.eurprd08.prod.outlook.com (10.172.227.9) X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2151; 2:7jAGcL4H9zgopjzGHZJbSHYrVZIRiH3TJnYePKGMJOREKmYAuQDVPrX5xhIE8oH3qBvxJ57YEOBWfKHFfvkh3dk1KyUG3FhYCcELmtklmrhs9OM4QGC2QRfaEJNUTVpEaiqOgRxGGDlHB/U0GEjcn897bnSUdhygEtANTig3GKc=; 3:Ibiao+iM0kShBlNZBrsNjaPxYUQ+dJcR/QoWkFPNR6vz4QmJrUCaW5uG6YVhclN4l6Gn32Z4BRPoRZl3g2/BItLKvOKjPnFpv4SWDcih4DcXR7/+fDH81aF94e7r61euB5oQ+gOAywPSjl+Zcdc1WwLbVbPySqtdV+RQYEH6fPA= X-MS-Office365-Filtering-Correlation-Id: f7ffdfb4-4cba-43e5-cb75-08d412de900f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB6PR0802MB2151; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2151; 25:aVYHzqdeNXhNfNO50PM90rkcVd9Y1opAIExQDQ8zbp6SlYo7oZxMVCj2HGw9D9Jf5zN1Cv2ihYSc24CLEdMn0W+GO8I2+fT6VSVNpTQ8/R5rXP1+h2jQ0P5r+AcGIiIjNrZEM0Yjm+3SUWTSevr2qkJR6/PanfxYeQBnqwGMu7MOT30uKUdua1K5BYVj3j6LfZZ0+W3evkN4wO4SBUjuZmCWGf6sTZQDnZ5nw71Flt7aZrm5fgAl6V+a/hY1vhPfky27exXipZ9VQHjAuMu09OYqrCDGNLDEA5oqNYqqzBS18eP8QbqRJLM3Ynx50mTtXA1Pv0CrIFbSvvd+AjI7VYZXWCXkToGbpK1uMrVCym+yADpCThxjbEx2Tp8dlRJ9P/966Vwz4MlI9Lm4a9mK8GVblqT0lk6+cvXrhYoywbiWeCcr/nHXOgVQttPNpBshl2GkpujMHdCBn3wzmERBwn41SVihgHkQGmDhy3q/heApj3fFUUJozL4S4ayq9TpEAfQVd1EM1Io6VPYEOs11VOiL/z40dHc1ugRpSqjCduXw46HZLG6+yjYOt18rsLgMp21lFweMDkIs8YqPnlolj31TBf/po+NPtK8nbjg86pW6J4NhuxjW5Buv0hFg/GUmBR2i7XZxf7lEJ2tzt9FaU/yqcjqlIOXMUTnQFv+C6xC1rBsXpaXKRviQkXmepD5SnYwr3RF+jswiHCDs1GBLeaaMlh8E8pxl5KA59BfqBgLryiQn9tS4uZzUcsjlnJxs2R1Jx9q/7FF8v3ZATdtSgr5v0pWakXgTsWr+DUV9+SOka48ECBlM3k4+4GSBphI6rGqK5S3nBO4ChQeWJRqF/Nv9MoHOUN1WX1UnCCCQAEI= X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2151; 31:BhXbtEBjX5sXCPZziEdiECsHunltt02zqyKMvpdGjmki4zKM217hW+rlf4phoh/HtaQ0KPkhgUC12+V0o/qxA+tUUWMow04CPXc70o7MMTLd5JCMbTKocJkepwwFYSHqnc5N/ZRv4PmRCg6QkOaGVwWJBPERPvbGzzADGnGitxf11oq0IbWDHQW0qNr9fc9+vheONngTJbZl/tdtwfgpAJwijautxt0PCmbUoL8dRvWrg4kZ3zsTedml4Oxoqq5YhzSXOk05IkyqeluLCeWDqQ==; 20:U1Qw8dzppKjhERIQVybjT2IS2+q0UMyCnZqSZeKNyQwuKDQgsmhsN6bnJipK63SZLtI0FrVPljZ632ofuSgUA6WDiUutveK3BfGylq9PrpNijsWeQt9ErowkgSiTGIRw97Z18d/xuqUn761R8Mauf6aBeFUSrDwULaxhdOyDqqM= NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040307)(6060326)(6045199)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(6061324); SRVR:DB6PR0802MB2151; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2151; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2151; 4:ufrNR2NW8990iCCmlKr9Vd4wS1ul/lrQ2/CZXYsnTNQDaH1aoDDlfof3uxo7ypEWAibbjIZ37OLYaHJ8E8flKjVXl1XdNUGEp5PLffQSoAd29pSIFy0L/miytOvDIUdLJc8X+JqSZ1zsyQQJXXBxh/vR3wRFsH9HhLZuj5CrPbga0+vZmv6cDlpcKXfsxUYJ3W0Av+qQMqNqGoXIaeI78P2bdCmv30G7rbO3lvPE3tCT74a1xcLlKmwY5mNeplYcii30psSc87Uj67p3SyE5q0a7Kpevo+CKUCsU8aXQ5Uh65AlElNTGYZ2YO8G4F7yOlbdw4H4/fETwpiO1b9DnKx6Mv9WCsncQqBRBjbIA8utIUhW6ztCRwQB9g1X5M5PT+bmC8oENmakhc38AWROL6gax1MmIBlcxnSF7rLHSOP3nHuLKed/yzrn0/X1YrvOnUwcZSdo7zA7dwZteOq8dVnSvTfXvTAmmYyRG/+Z5aNZ95U5fDwvLOC7CFO1mwIwmFrxiidUeyCAzGXOPD9KH+En/5EweL98+nEOEHB8/sJFqiHVtASWTSP3CAMbvT7Pp X-Forefront-PRVS: 0134AD334F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(199003)(189002)(377424004)(86362001)(270700001)(59896002)(36756003)(2476003)(512874002)(80316001)(450100001)(4326007)(2906002)(110136003)(6116002)(7736002)(68736007)(5000100001)(33656002)(3846002)(64126003)(7846002)(84326002)(305945005)(83506001)(5660300001)(4610100001)(6916009)(38730400001)(5890100001)(42186005)(21490400002)(87266999)(81156014)(65956001)(50986999)(106356001)(99136001)(101416001)(54356999)(8676002)(105586002)(66066001)(92566002)(97736004)(4001150100001)(189998001)(230783001)(568964002)(65806001)(65816999)(81166006)(4001350100001)(77096005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2151; H:[10.2.206.73]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0802MB2151; 23:cuT315E5KLmmS2CfBtno71HWNyDKlgk1GUMZzhu?= =?us-ascii?Q?Pk2sJnFEwkTPUlwbV2PEe2KzDY220EvLGEh2pTntIc2I4UWjlZVPMrozFSw8?= =?us-ascii?Q?ArYwDUAlHMdLJBGwaq9Ctz4IWCV18ixHK0yGDuLQW93w7RZqFCANMFsjJYYM?= =?us-ascii?Q?NiB/gIFBHxGulBfeih8d6daf5fyGi9/Bhyg3w31MPWIPQ62Y4wQi+VHx394o?= =?us-ascii?Q?Q8wOS4++DwEKJYw4zGRWaTV8n9bLB2zXHw47U1iFJjH5tJMDXKr3M4SFu2Z0?= =?us-ascii?Q?+0gG/a6Rt8XfmyBm00iM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99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2151; 7:BUbXPZWTb+NJCpnHbJ2cr2AsuxfGUcZvz5azpAtOmMNgNXAjOxl46zoH0wNvqM18Zxg+/mZlnfkmTxLVPRX6zF/mvkAtivZYFJ/FrGF+Q8SsDnjzDL7Po3JQF0apPrhLS7bAObnJWs2gLHsoxoe3S1LPVAOJHzjPYp6Fq6jfbmtjRTexBy4xnMryI0E19ME/YC3+pfBNl++NErC7R9HaTRo+gtPEu8+3OsSzuDt0LW+nGUo+/HmnV5w5DgyjRtNCguvt2IW0a/1b+0koaFafsTgD+r8AN0dDTJmiQSvXM/LhAxWbeJ/bs7bwoyCE7fmUUhmuGxSMiycZklH6O0rUEpq6ryd20VUy0NR7dX/HTys= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2016 13:50:47.4255 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2151 I used this patch to run the new build script with python3.2, it may be worth adding this hack if python3.5 is not widespread (might work with older python, i haven't tested that). 2016-11-22 Szabolcs Nagy * scripts/build-many-glibcs.py (os.cpu_count): Add compatibility definition. (re.fullmatch, subprocess.run): Likewise. diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index 517dec4..b928dee 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -40,6 +40,42 @@ import subprocess import sys import urllib.request +try: + os.cpu_count +except: + os.cpu_count = lambda: 1 + +try: + re.fullmatch +except: + re.fullmatch = lambda p,s,f=0: re.match("^"+p+"$",s,f) + +try: + subprocess.run +except: + class _CompletedProcess: + def __init__(self, args, returncode, stdout=None, stderr=None): + self.args = args + self.returncode = returncode + self.stdout = stdout + self.stderr = stderr + + def _run(*popenargs, input=None, timeout=None, check=False, **kwargs): + assert(timeout is None) + with subprocess.Popen(*popenargs, **kwargs) as process: + try: + stdout, stderr = process.communicate(input) + except: + process.kill() + process.wait() + raise + returncode = process.poll() + if check and returncode: + raise subprocess.CalledProcessError(returncode, popenargs) + return _CompletedProcess(popenargs, returncode, stdout, stderr) + + subprocess.run = _run + class Context(object): """The global state associated with builds in a given directory."""