From patchwork Wed Aug 6 14:53:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "chris.laplante@agilent.com" X-Patchwork-Id: 68150 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BFE9CA0EC0 for ; Wed, 6 Aug 2025 14:53:43 +0000 (UTC) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.47]) by mx.groups.io with SMTP id smtpd.web10.27195.1754492013034209775 for ; Wed, 06 Aug 2025 07:53:33 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@agilent.com header.s=selector1 header.b=Fttrpscx; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: agilent.com, ip: 40.107.244.47, mailfrom: chris.laplante@agilent.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eSlpYS7oJ09Dc1mMsFjxfgwQLWl0MfYk24nbCKggI4SIHbtHcElV0TO9ugpvge6sj2mrjDZH5eeelPeYiKdp2v0GVHjq3mzUayc7mkS8njokiXamB3MxlJxHtq9hAPEyygypvi4r7bMRXLDtfa2YLJP6WN/QqMYZRwNO5ODFrDi5wG5qoOeTFz9j3FdRTKyz3756VcAKPJqCgOjZ+MxLcWhh1kIrydUY+PWWQFFhlQkSiq5PRjMHr9QFw8d9cQL4tNWPX4qg8efY2JHDjunYRnps5pktCaGviGRwvNHTaT0NAwOqhqFu6rtJE8ti3l9GtYf+3TAWACciSEsJS7CyUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GiNEU5RdvTkVmn8uczgxYo4zenIhb0A8A+l3XJQr4tQ=; b=mAu5nnw1M025U0Ln3l8uEM84I2EGgwDKQWyr6G4k5kAzzctSE7310Z0nOln9vwQNrc16ZIcfUYZafwSYYyt07FTQyLmGlxVF0MufF3bJu4AG46hktzPbK5mm1eys1bRr1bLdia/Ts42gRTaIPlxqaUFkejhOiubKKSuVJPtOT/yxv7/Bt+I0VovPE7a6Ll3Igi/1U0ppaYeRgHO5l1rmL9jis8KCEdcUN8UMEgGu4pZ9w0ezDi/4nrsPCTm7i/qaTN8qhh9vwkkpr07bayf7JDn69DjUo8IKHu+tboEAg8tNLZnTey+1XTky0SWE6BlfzhhC+wWX4WcmTu3gZabBRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.25.218.37) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=agilent.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=agilent.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agilent.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GiNEU5RdvTkVmn8uczgxYo4zenIhb0A8A+l3XJQr4tQ=; b=FttrpscxP8pfOweR70BbP4+sxXqezRlBOvCLZ1NI05d8apsbMIven7pdzZsWmym3BvGDoZxpIoSJS3T3UPTMyDr6d0MafcbzpNGP8rBlaqAgqVpIaZ+QPy86zco4tuM9Y0dIyFgXcRnd9WBPRsNRoRVLiUxysWBx7DBLAU1biwsGaPAC0/rpPuvoK6lFuVnlqfj4iOw1Zt0o8pClPDLAw4BckwKMPrk4NPJz2cUTTCFKB97Ys1nPqxoEPD9zDTh3YYAOQ5k/5TQM3tJcEhizCLhlAzgfnpgVxvjqfE/BRPbDAoK6eNptoefohEsCGr46KeI7Siuu9HLcjpErfmkl3g== Received: from SJ0PR05CA0064.namprd05.prod.outlook.com (2603:10b6:a03:332::9) by IA0PPF0C93AC97B.namprd12.prod.outlook.com (2603:10b6:20f:fc04::bc7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8943.35; Wed, 6 Aug 2025 14:53:28 +0000 Received: from MWH0EPF000971E5.namprd02.prod.outlook.com (2603:10b6:a03:332:cafe::17) by SJ0PR05CA0064.outlook.office365.com (2603:10b6:a03:332::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9031.6 via Frontend Transport; Wed, 6 Aug 2025 14:53:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.25.218.37) smtp.mailfrom=agilent.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=agilent.com; Received-SPF: Pass (protection.outlook.com: domain of agilent.com designates 192.25.218.37 as permitted sender) receiver=protection.outlook.com; client-ip=192.25.218.37; helo=edgeappmail.agilent.com; pr=C Received: from edgeappmail.agilent.com (192.25.218.37) by MWH0EPF000971E5.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9009.8 via Frontend Transport; Wed, 6 Aug 2025 14:53:27 +0000 Received: from laplante-B650.lfs.agilent.com (192.25.126.5) by edgeappmail.agilent.com (192.25.218.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.57; Wed, 6 Aug 2025 08:53:17 -0600 From: To: CC: Chris Laplante Subject: [PATCH 1/3] cooker: remove some redundant control flow Date: Wed, 6 Aug 2025 10:53:06 -0400 Message-ID: <20250806145308.2052128-1-chris.laplante@agilent.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E5:EE_|IA0PPF0C93AC97B:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ca9307d-9254-4854-eb53-08ddd4f90060 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: k2qz9+mEB1MN6+2XbEoj37n4dhuzC1Dm+9QyecWef9YN/0sZ4BgGFw3scAPez+AsZBq5a3xAk6sDorU3LNsKC7PVAnxcOonrazLYV/9DV8Gp86ofIYU4r4gGL0/yA21ioiAnM4IdnxQGng6ZnZXuTm3js6n0jwCOV53Q86brJvYJG4SYEoZ3cf5Zhz8Wh1OWhWYhF7E8Okwi+g4nr6aoEicD/UngbWeQ91Latf8+uaO4/oDTcn+j5UE8ObPgX2cQpKdGlcB8t7/wfZ83LMJ+eLps0qg8fSbVY052qOsM9qZgEcIpPbjTgzFdG4sACApQ2KrDyF+zRUyO7sWrqt2CPvX+d9xtLycLtyMuoecqBnGpHvOlO4AM1IM/BZNZF2GBJUyyvgcsmJ3VoXkB9AM9JWKXj/HoJfXcj7w+yXVTYlMwJiBXf6bTIYCRIRg3eD/3oenCab+lAF5CyFQ1T0QYv8FILpdwNVUerKABzibXD7Amw6j9+Cu0IAQBLM+xZ2BX9T2YziemPwq3GBfxjo0p74gdsfLjprWaAbpdQbz5GEzCyXUXL/Gt5BJ19LzgPdDTZHl+umgcUq7R6+jKyWPdnjEN3jGpaZ4LboxbcNgT/wgDCh0gwK/fTXPDt8K0e6JXB0SRr3yv3rJ85U/nEqPOERH+Gn8Ub5Q9dSmpgLCUD6iWo9SjtmSQWGordRfTojzcCY5Pv4wbdl2Wyn5LTbacyh9m8zjpaJDi1VSHg8V+JDPDNemxDZF84nfQPoiZlLXqPf5Xbo3dU8aDvEtUezIi+1FaghFJnX8PocA/LA0cfquPAQFodX/2EQAbEWDJ+sNVlW025oTu5Yn2bFybgnoRmFFfHD2x6sqwP1+lhZQS1AGXVCHGaAiin9uKbPaGMEPz2H7WiHoax2iD+yYCLJL8Nf1tsmUl7uSkGMuWf7G3taiw2s4nx/I6o9N/Vhzb3pwE9F0yDzaL4Mrk5u8NZrPo1z84RN3eShw8g3P9WG9UIU+3qwv4wa9Ykj/Lws2J0AMyfHGNCQ3Pn+oMN7AaG93eDAPJGE927YU28hnuHVq2t3e29VPfPS0YFPymJkwRMsduTh0JC/ilq4GFpOiEScmQcODbAxIy+S5P9fm/3d5iAVFgGz7ZwZ952mrKeoLQp+rUBJgqqPk4w9isT3OZrcW4FIMqqCFj6b7XH8xG4XwhKZvkJkMOJBL3Z3ZbSYa2UjjKbzcYWbnv5zTgaSE+mMGtkTIgHpYmGsD+3aE/JFBZvau5s19jnWSnyuPA+QUfsf/1ACWEnoCj+hq2dlskEuiXB/uR5JJkbgKzWTiMMK9VLzFumXzKUvmH5/JdmcxE8mgDj7vW7npUUYqh89kRTRo3DcrJo7T5xBfht0UgILi5wSWHSEcD+N5oitL8G2qSbHySGdxpWamBbRz29u7FTrRJO8oWaCCZYTEZ76Utusj+lVgp26Z6ZST2oaMCvipIRwrSRKluBMYFr8CvBaLRv7rlabkKhpJtZcvn3+GcrPcVbjDJC9pRdcc41ykYklX52heW X-Forefront-Antispam-Report: CIP:192.25.218.37;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edgeappmail.agilent.com;PTR:wpcosapexchedg1.windmz.agilent.com;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: agilent.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2025 14:53:27.3922 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ca9307d-9254-4854-eb53-08ddd4f90060 X-MS-Exchange-CrossTenant-Id: a9c0bc09-8b46-4206-9351-2ba12fb4a5c0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a9c0bc09-8b46-4206-9351-2ba12fb4a5c0;Ip=[192.25.218.37];Helo=[edgeappmail.agilent.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-MWH0EPF000971E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PPF0C93AC97B List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 06 Aug 2025 14:53:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/17840 From: Chris Laplante Prior to commit aa84a900e ("cooker: Ensure delays are accurately transfered to the idle loops from runqueue"), this was necessary. But now retval is returned directly. Signed-off-by: Chris Laplante --- lib/bb/cooker.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 9e4000b63..fb87368f1 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -1434,8 +1434,7 @@ You can also remove the BB_HASHSERVE_UPSTREAM setting, but this may result in si if quietlog: bb.runqueue.logger.setLevel(rqloglevel) return bb.server.process.idleFinish(msg) - if retval is True: - return True + return retval self.idleCallBackRegister(buildFileIdle, rq) @@ -1504,8 +1503,6 @@ You can also remove the BB_HASHSERVE_UPSTREAM setting, but this may result in si bb.event.disable_heartbeat() return bb.server.process.idleFinish(msg) - if retval is True: - return True return retval self.reset_mtime_caches() From patchwork Wed Aug 6 14:53:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "chris.laplante@agilent.com" X-Patchwork-Id: 68152 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B6B3C87FDA for ; Wed, 6 Aug 2025 14:53:43 +0000 (UTC) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.107.100.83]) by mx.groups.io with SMTP id smtpd.web11.27435.1754492016294004637 for ; Wed, 06 Aug 2025 07:53:36 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@agilent.com header.s=selector1 header.b=Tq9HAvnN; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: agilent.com, ip: 40.107.100.83, mailfrom: chris.laplante@agilent.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qcAieypEnLjKZDFWJXTVur8BSpDax2Sut3BmD8VcIw0QdLL95UwFWmLCJIk1vQId3mhKZfB3X7PRwyIyIls6SnIXaq8AKFRxgQg9JHI1NQeG+t4s6cbZxZsv5NYlWEnu87/zNJwMF1h6wWNS7iesLcI3DQmPK+/D1Dw4LHMyl31QA+J/kidoLZB00Z0SK7f0zxaX5VURFY4N+yIUcCRGTb/78KU9egUT8WTGhtVS2gK4t1eTD9JhxwzjGxZ4xo2LqANQrNt5hzzgQnPA03QbqABDhGG/LkOg1vo8Olboi1YpcdO0wJZcrNHw0qVmdG6w5QADeDm63mloWWcxadCuAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+CGBAcOFHSeAeXoW4T26dlrUx9izLtDWqt9jdLS7ep8=; b=dekvVN9JrMbfqSAG10HzbXRx6SXzaE2mFpLjl+bVRot7/W0xLg4g43DdeUNXLU+RJN6E1DYpHjtrSa/DgK5avANkIOepGkb1u0DIj76uwbCoew5cUHKUc7Jl6uS5m7lPWRAV3kMM5jM75+ly8aNDIMeiBBf5dpe/fW91Rq/9ShEsjNPTVis+1IRtMFWfk0jGFuubxYvMdb2Qx0knyeZPA39XPWYN16PsHJO/y+gw6gN79SuRssnA8oWgHvE8CCluMYPv86e9oc9rJ7sdNcG5rFFRkTf4yH5wfQK2DVpKuoFwgeJl5SmJQ2McPGpQFBBSrCUkeSKYSHmE4M7/QXXdkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.25.218.37) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=agilent.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=agilent.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agilent.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+CGBAcOFHSeAeXoW4T26dlrUx9izLtDWqt9jdLS7ep8=; b=Tq9HAvnNiIcfJLXrWQQetWJsmPw9Dlv48o/CjYRSndBuvFvZ/q7rGnwe0OHFTjVD6MOlx/ZZFJlbSdFz4nnAVXJDsizZ41Eew07wEmvLfT8nnKaEuM6N5fB9Ezfzn8ofGth1Iq4PyngCZgndI1wuZ324MbzhZwk4ISiCIoIzsFQHuSzkwi7kFtoK+C0iBLp3LASXOXxERXZsLrScirQNGGOZw50m8iGCqCg+dCZ0LwHjumzurfZ3aBBBzRyA+DqJ1Myu2BWFA+61okBBFBTZh4euAUcmj4eZEuMz6Wm4XfT1UJIc8Fg4527mmrHPMt3aMWe3F352J0UsKKMM8z8NSw== Received: from SJ0PR03CA0382.namprd03.prod.outlook.com (2603:10b6:a03:3a1::27) by CH3PR12MB9024.namprd12.prod.outlook.com (2603:10b6:610:176::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9009.14; Wed, 6 Aug 2025 14:53:29 +0000 Received: from MWH0EPF000971E7.namprd02.prod.outlook.com (2603:10b6:a03:3a1:cafe::eb) by SJ0PR03CA0382.outlook.office365.com (2603:10b6:a03:3a1::27) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9009.14 via Frontend Transport; Wed, 6 Aug 2025 14:53:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.25.218.37) smtp.mailfrom=agilent.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=agilent.com; Received-SPF: Pass (protection.outlook.com: domain of agilent.com designates 192.25.218.37 as permitted sender) receiver=protection.outlook.com; client-ip=192.25.218.37; helo=edgeappmail.agilent.com; pr=C Received: from edgeappmail.agilent.com (192.25.218.37) by MWH0EPF000971E7.mail.protection.outlook.com (10.167.243.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9009.8 via Frontend Transport; Wed, 6 Aug 2025 14:53:28 +0000 Received: from laplante-B650.lfs.agilent.com (192.25.126.5) by edgeappmail.agilent.com (192.25.218.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.57; Wed, 6 Aug 2025 08:53:18 -0600 From: To: CC: Chris Laplante Subject: [PATCH 2/3] event/runqueue: remove unused 'd' arg from check_for_interrupts Date: Wed, 6 Aug 2025 10:53:07 -0400 Message-ID: <20250806145308.2052128-2-chris.laplante@agilent.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250806145308.2052128-1-chris.laplante@agilent.com> References: <20250806145308.2052128-1-chris.laplante@agilent.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E7:EE_|CH3PR12MB9024:EE_ X-MS-Office365-Filtering-Correlation-Id: 888a017d-1294-446f-fdf1-08ddd4f90147 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: 9Q9lgqt8I9fEvRQtBssOUswa9aiIQuEpiEQSL2s+Qzi1vLHE9FN2duDA+WfBKvBE4Xvx0tiRx40+DEPP0/99jkq0wUfsolEwQA60UUu4vkigOweKtAinAmJlySFPsI6AMRtWFu1FH1Vxm2T6D6AmI9mb5Rf25jXx0zDhFhx60pVTtyRdJ/vdYU5vpyOlO4GCkyBia6A3X5izn+qtOIy+XNV27vsCFcNyFdcDnhPwqZYN5iSIIqw631/AdqgQQSpcpyT4LKYyCONxld25imk51Vil5rDZtwTf0HkWU4qYLNPIbHXWYy7Wfoky1eqCEsuWBsHXSZNtXt8Zm4ob4fN/2yPwheSsodnIui3cX21eprpsN9o7wyd5W9+4rL9W9PSBmgDB3li2z0mn6QRt6Wj9yYdQEQrrG9pUUtoMUy5d/2KV+MjPqc76TtlwVYNBhmsNo8Y+QhcAb8OpGdmWXVEAWp0G3mK/cHWdk63WH4OeVJo8lH/vLfH0C/GXl6xLGe1wJW24Z0cqv/FIesBqnUAdiJT49fVw42HwKcE+OFENU0S4i/nfewhcU0ciUgs2m9r0YWDL49DDtmGJ+cOjnMjsGw08uLIdPZZ54BI+QHCxa57iH5zCk60NiLkm7aNaXq+KUUNtXJjmZW8ZVbYkOHLJoaLrizF/47hDd4ZvqZP/iGbauPGIQ6AzhQQjJalytecXc/Oe7cB977k/q558Z/e68cx8s3yruGWYwnZIQ0cqUwbjqE4hD70dzHNW0L491/DdrXEngdZgwZD2L1deDxzN40/d9skID5c/IojFKMVIrY9eKs856Zpmn2e1/9RenemjKOGheMOGYNO0+siub+wJaQkB9QAKugtdvbpoWCajlc5LgpBkjnxgSftwJh1EzkTK6tHM6ynK7f7QJhWAdX7kYBHfmjZhgdxxKCzeDuR3QfrrpBil18mQRQXwydwfc7CTFhSezq3g4uqyPgkLQ/oZEaIKWRoBuJWTkYI9Tlo1OBqfS/CSocBo8y1HCO2YTthodkcYBtJfcUd64uaIWnhc1jYm1MnQuJVSMdVM52LNaVL27BOuAn5IRVvcQKQbvCFIt5fnqG8HN9tf1/UdCT6y0Aiu6TAv2Mk2haxu7/wjS8IBRpzlGw2wXjRR4zShPUsxhk5IPzdghMD2E6pN78sQ+n7fUrnHeW3HZSxzZDACIZqHPITrsCwcCawcPlLeTQo01SlGEpU9iUSf9zsQItMpIKzmdGJ99rLNgni+o/p5es3rBF6MGHxIET00trRMT4b26zUEGdEyOhQ6kWEBAVdeH2/rhUHFl2sta0QiwSI348+Bq6htdjHs/m+0FXyOXuZbLW/6ug+bU/x0Ya86RE0frBaAfutTW7Oy0Eb2n8vTHJ+/r0sSDSaNCLEN7OiE4bz3HOXADVem3UkzT6h7GwRS26S3lcLCbhlA9ENMgAtT4fYlI1fQLEcdQcX0cdsg1ODITmRanYBNpfpbbL2j2HghBn8dBphQNqOIVr8Aw105rihqzU7z8YN+/dUeT9NosP6g X-Forefront-Antispam-Report: CIP:192.25.218.37;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edgeappmail.agilent.com;PTR:wpcosapexchedg1.windmz.agilent.com;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: agilent.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2025 14:53:28.8815 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 888a017d-1294-446f-fdf1-08ddd4f90147 X-MS-Exchange-CrossTenant-Id: a9c0bc09-8b46-4206-9351-2ba12fb4a5c0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a9c0bc09-8b46-4206-9351-2ba12fb4a5c0;Ip=[192.25.218.37];Helo=[edgeappmail.agilent.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-MWH0EPF000971E7.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9024 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 06 Aug 2025 14:53:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/17841 From: Chris Laplante Signed-off-by: Chris Laplante --- lib/bb/event.py | 2 +- lib/bb/runqueue.py | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/bb/event.py b/lib/bb/event.py index 2256fed76..ddf1006c2 100644 --- a/lib/bb/event.py +++ b/lib/bb/event.py @@ -90,7 +90,7 @@ def disable_heartbeat(): # In long running code, this function should be called periodically # to check if we should exit due to an interuption (.e.g Ctrl+C from the UI) # -def check_for_interrupts(d): +def check_for_interrupts(): global _should_exit if _should_exit.is_set(): bb.warn("Exiting due to interrupt.") diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py index 80f3d3282..f37a0a706 100644 --- a/lib/bb/runqueue.py +++ b/lib/bb/runqueue.py @@ -678,7 +678,7 @@ class RunQueueData: self.init_progress_reporter.start() self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Step A - Work out a list of tasks to run # @@ -829,7 +829,7 @@ class RunQueueData: #self.dump_data() self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Resolve recursive 'recrdeptask' dependencies (Part B) # @@ -926,7 +926,7 @@ class RunQueueData: self.runtaskentries[tid].depends.difference_update(recursivetasksselfref) self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() #self.dump_data() @@ -1008,7 +1008,7 @@ class RunQueueData: mark_active(tid, 1) self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Step C - Prune all inactive tasks # @@ -1055,7 +1055,7 @@ class RunQueueData: bb.msg.fatal("RunQueue", "Could not find any tasks with the tasknames %s to run within the recipes of the taskgraphs of the targets %s" % (str(self.cooker.configuration.runall), str(self.targets))) self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Handle runonly if self.cooker.configuration.runonly: @@ -1096,7 +1096,7 @@ class RunQueueData: logger.verbose("Assign Weightings") self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Generate a list of reverse dependencies to ease future calculations for tid in self.runtaskentries: @@ -1104,7 +1104,7 @@ class RunQueueData: self.runtaskentries[dep].revdeps.add(tid) self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Identify tasks at the end of dependency chains # Error on circular dependency loops (length two) @@ -1121,14 +1121,14 @@ class RunQueueData: logger.verbose("Compute totals (have %s endpoint(s))", len(endpoints)) self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Calculate task weights # Check of higher length circular dependencies self.runq_weight = self.calculate_task_weights(endpoints) self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Sanity Check - Check for multiple tasks building the same provider for mc in self.dataCaches: @@ -1229,7 +1229,7 @@ class RunQueueData: self.init_progress_reporter.next_stage() self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Iterate over the task list looking for tasks with a 'setscene' function self.runq_setscene_tids = set() @@ -1242,7 +1242,7 @@ class RunQueueData: self.runq_setscene_tids.add(tid) self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Invalidate task if force mode active if self.cooker.configuration.force: @@ -1259,7 +1259,7 @@ class RunQueueData: invalidate_task(fn + ":" + st, True) self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() # Create and print to the logs a virtual/xxxx -> PN (fn) table for mc in taskData: @@ -1272,7 +1272,7 @@ class RunQueueData: bb.parse.siggen.tasks_resolved(virtmap, virtpnmap, self.dataCaches[mc]) self.init_progress_reporter.next_stage() - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() bb.parse.siggen.set_setscene_tasks(self.runq_setscene_tids) @@ -1296,7 +1296,7 @@ class RunQueueData: todeal.remove(tid) self.runtaskentries[tid].unihash = unihashes[tid] - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() if time.time() > (lasttime + 30): lasttime = time.time() @@ -1555,7 +1555,7 @@ class RunQueue: """ retval = True - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() if self.state is runQueuePrepare: # NOTE: if you add, remove or significantly refactor the stages of this @@ -2638,7 +2638,7 @@ class RunQueueExecute: next |= self.rqdata.runtaskentries[tid].revdeps total.remove(tid) next.intersection_update(total) - bb.event.check_for_interrupts(self.cooker.data) + bb.event.check_for_interrupts() if time.time() > (lasttime + 30): lasttime = time.time() From patchwork Wed Aug 6 14:53:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "chris.laplante@agilent.com" X-Patchwork-Id: 68151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1660BC87FCB for ; Wed, 6 Aug 2025 14:53:43 +0000 (UTC) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (NAM04-MW2-obe.outbound.protection.outlook.com [40.107.101.74]) by mx.groups.io with SMTP id smtpd.web11.27436.1754492016483151109 for ; Wed, 06 Aug 2025 07:53:36 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@agilent.com header.s=selector1 header.b=ysfn7bfV; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: agilent.com, ip: 40.107.101.74, mailfrom: chris.laplante@agilent.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Oe8kfioGZJfoaqw4geK1cXApprHLU8LMneuLeIVXA6yuiqbCzCEiaG8MPfhxBVYJ3Ekg4/zp/ArcXVIlfcUaNOr7OTdLUcBySccAAQEbdY9JeehTPCbOtY6vVoUkVYKkDyHxpZCtD/4ULv4sr74RBTDDH2wcdAxrfHlatMIsJte3QByLeOyb8UZkZFknrKC9UnxzKfVGQShZi4h2sNOLz3jBrNFsR0gP9pym64SN8qWXlfZUMLNacIczG/zdoqPg8yqNiFOXxO75K1G3CYNA4GiXCOGxt9HtHNh2zQ4Q/7S0ltJVQA/3rmakygujSujamw+ZrQDncICuF05OW4beBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gevecUNzUCCI7z9w6lo4Nb1kxmhnc8fAfQRm66MGkZE=; b=H9083Q08oWS0q8zRHvs852pjfyfB6+2UTt4ZWx3AmaKzUNn0+YCC76TZB5rQ8RNWIz8hQLs0T20BPlF/iXIL7APJX+Tu24xJMi+ZwjORVyUQsBpVScnuoIJF9cBeuq86hztV3A62P6a7SLJnEafI+eyoCLPvTCGqLsfIt9Q3OFYKp/iYp9abFVQRfUHe275Rnvd+CE1Tqj2PHtGDdPBcdo2zCvH80q1cT6QS1UTyAarft5c0Et3pFUKI7T+Y/G+nrB8aBZ4cXMjxyKwXi6ZMtUZ/6SP5GI5gyzFDJ+PReUOwIhtluhxBHDEIp8GpJkPrMNUsnwZQ1P+5lIDMqPOSIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.25.218.37) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=agilent.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=agilent.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agilent.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gevecUNzUCCI7z9w6lo4Nb1kxmhnc8fAfQRm66MGkZE=; b=ysfn7bfVl0sVZzp1lNFK5zZ9+YDGa20RE7JRBQQQFzNXhbKckbGAv7qfjtggCdiZvIA2haOn5xIwzS5baAoDGxQLpldCCKHC4m2tSjcloRIZkU4BKodXQAGe/CypFHgGxqvNeS8V2NTym6bgZlCMFbVfUO15omQvB9oEnxOAFlO/ZwcuIUjmxfF0aCJcdPLS7LQfEI1kAkGEpEb3GsP0ZpclNlebeMZzkxjLz/4BN6Wjno9MHMK3H1yLaWte8uVbZrEu9RVLBMlHLqfrnJ1toev1EF4LDIz3MHjHTgrbsUl8AQTw08yxWEbKGxs6D0hvN5O/bS57LTf+wgeaZP+GyA== Received: from SJ0PR03CA0369.namprd03.prod.outlook.com (2603:10b6:a03:3a1::14) by IA1PR12MB6481.namprd12.prod.outlook.com (2603:10b6:208:3aa::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9009.13; Wed, 6 Aug 2025 14:53:30 +0000 Received: from MWH0EPF000971E7.namprd02.prod.outlook.com (2603:10b6:a03:3a1:cafe::e) by SJ0PR03CA0369.outlook.office365.com (2603:10b6:a03:3a1::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8989.21 via Frontend Transport; Wed, 6 Aug 2025 14:53:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.25.218.37) smtp.mailfrom=agilent.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=agilent.com; Received-SPF: Pass (protection.outlook.com: domain of agilent.com designates 192.25.218.37 as permitted sender) receiver=protection.outlook.com; client-ip=192.25.218.37; helo=edgeappmail.agilent.com; pr=C Received: from edgeappmail.agilent.com (192.25.218.37) by MWH0EPF000971E7.mail.protection.outlook.com (10.167.243.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9009.8 via Frontend Transport; Wed, 6 Aug 2025 14:53:29 +0000 Received: from laplante-B650.lfs.agilent.com (192.25.126.5) by edgeappmail.agilent.com (192.25.218.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.57; Wed, 6 Aug 2025 08:53:19 -0600 From: To: CC: Chris Laplante Subject: [PATCH 3/3] runqueue: use enum to represent runQueue state to improve readability Date: Wed, 6 Aug 2025 10:53:08 -0400 Message-ID: <20250806145308.2052128-3-chris.laplante@agilent.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250806145308.2052128-1-chris.laplante@agilent.com> References: <20250806145308.2052128-1-chris.laplante@agilent.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E7:EE_|IA1PR12MB6481:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e29c46b-8cdc-4b41-02a6-08ddd4f901e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: YIP8MhkatG5Gy9WTBp2d9hkWi1peasVEQuV1qTm0dTnsUX3zIMQOiJ/BiTttpZ6E32lUqyB/bdo+XVP0olM2TbMF2A/adURAuXZzkpGO/ySBukfB0M26jOiWoAeq3rZu4kLCWnADoPkYAZqQBpFdklDVxRMAdBN9LDODgP6oAG7Mfhdn9iYMCSL+AKraqtbMx7UVsRB/LLrWbGTySAM4/Bzf7f07eSqmz/yPm0sk8VccRoj2q0c3SxE9jKwJvrD4pcgHe2tMgSKaCxoLI0CjLpmR1p02tGGbWa5yMr1ieA97UXmG/jkZP+gjP9tmZJnYVlmt044nXzTV7VXhazqahPAJVyBxAghF5XaX+m0MalTSer+nLlC8VyvKK0Gu/yCNOHwPU8RiP2FJEWZ5PBpQ5EVoYRAuMf2IxAywRJq/d+7DvPzzRUhl/Vfs91zP6lebcQY26Mws3YNfLplsOe9lJZJyhqlJgOBubFp3BATdcTVJMA+TpkbxTwvQQg0OQg9DDFLanwVLtLFBbE5ivu21YFjP0We/0rK1i74SQls1Gwe4lAHq6iJTnqFOlKmh/HtmDispq7x4jnEO8br5hbVzWApAZ3iwHwazbusn+eRG78qAShA0i076SwNhESnRgL/EyirxgCbPpa2jEOrG5mWFn6464kd5HMSfUTVuZvXRhqVpC0xQ4vrDIJQdW/PcJ4N4MbgaeJmiMMgAVZWNKoFQuLQiYVBZZaQ18lDzBYl7sk93wSkbi/xdVo+hF7zH8gfxJpgbyw7l/xiX2/ACOWt4IIRQ8joy5mXyIkYK88+TIntepuNxdQ+Jv3mlg5iT5LPRDvk8CbsQsZ/J1uOSNI6s/YCiUi8SBACBZ5k6QyfFb8jIE0/7mK2YEj8O/3LIbDoCcR1aOH0g2mZ1AqhjX9ytebXgB2W6Ehx7j9tIzWe5KBFjWDBYo6AUCHjRVmijmmDKSQ0v8fOsPG7JyESEiECLAvlXrSFhbYX34BPcdSAZmxJYHCgdnG6bRy9uvEEYGwx29NARGxz1RUEmZQvpiuCtBt5GdNosoAB7Hq6u8qXG9ifHI27R/rgKX0sG+URWPFYv1HFRTBeH7DbG5x0WW9a/79n4clg5kiHZ0JBq9qTaGvVx3bM4nsmwtIyHEBQkFuxn+yOmt+nDPfcxaiAe2LKh2PCItfJK+1UmJWM/UgndTM/U7CrCBHoWPplwquPEu2FtPGLKP0Zyt4EMoueKjd9UHLE7w8M2OfdXK77wrZll3be4gEbxFfSNU4ObhgosSlBCxv8BbRA52YC/ZsbBMVUsg7TrWUYlefNStgp4+L9eW11eULgUlxE9w8nPsD/ye8O8XrPezb7ZdP7CWA1UZ7ugNm5Fqk9Zev2apeBL7XY9Jw+DexUwdECe4L6a/o5uZxFB1tbu0BDv/xjpS48BkKyZ0YKZ41umNT6fiA4FwetUUCCsxwlc9Jsz2QkxVHAMEVJBtHDjmbRRV27GBxIMYwdKYNGdtEAsJUyd1ur+/aiwRgbSL3VARBcLvii8mIHDFkWO X-Forefront-Antispam-Report: CIP:192.25.218.37;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edgeappmail.agilent.com;PTR:wpcosapexchedg1.windmz.agilent.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: agilent.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2025 14:53:29.8971 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e29c46b-8cdc-4b41-02a6-08ddd4f901e3 X-MS-Exchange-CrossTenant-Id: a9c0bc09-8b46-4206-9351-2ba12fb4a5c0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a9c0bc09-8b46-4206-9351-2ba12fb4a5c0;Ip=[192.25.218.37];Helo=[edgeappmail.agilent.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-MWH0EPF000971E7.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6481 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 06 Aug 2025 14:53:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/17842 From: Chris Laplante Signed-off-by: Chris Laplante --- lib/bb/runqueue.py | 90 +++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py index f37a0a706..63d4edd89 100644 --- a/lib/bb/runqueue.py +++ b/lib/bb/runqueue.py @@ -10,6 +10,7 @@ Handles preparation and execution of a queue of tasks # import copy +import enum import os import sys import stat @@ -125,15 +126,16 @@ class RunQueueStats: def updateActiveSetscene(self, active): self.setscene_active = active -# These values indicate the next step due to be run in the -# runQueue state machine -runQueuePrepare = 2 -runQueueSceneInit = 3 -runQueueDumpSigs = 4 -runQueueRunning = 6 -runQueueFailed = 7 -runQueueCleanUp = 8 -runQueueComplete = 9 + +# Indicates the next step due to run in the runQueue state machine +class RunQueueState(enum.Enum): + PREPARE = 0 + SCENE_INIT = 1 + DUMP_SIGS = 2 + RUNNING = 3 + FAILED = 4 + CLEAN_UP = 5 + COMPLETE = 6 class RunQueueScheduler(object): """ @@ -1337,13 +1339,13 @@ class RunQueue: self.hashvalidate = cfgData.getVar("BB_HASHCHECK_FUNCTION") or None self.depvalidate = cfgData.getVar("BB_SETSCENE_DEPVALID") or None - self.state = runQueuePrepare + self.state = RunQueueState.PREPARE # For disk space monitor # Invoked at regular time intervals via the bitbake heartbeat event # while the build is running. We generate a unique name for the handler # here, just in case that there ever is more than one RunQueue instance, - # start the handler when reaching runQueueSceneInit, and stop it when + # start the handler when reaching RunQueueState.SCENE_INIT, and stop it when # done with the build. self.dm = monitordisk.diskMonitor(cfgData) self.dm_event_handler_name = '_bb_diskmonitor_' + str(id(self)) @@ -1557,7 +1559,7 @@ class RunQueue: retval = True bb.event.check_for_interrupts() - if self.state is runQueuePrepare: + if self.state == RunQueueState.PREPARE: # NOTE: if you add, remove or significantly refactor the stages of this # process then you should recalculate the weightings here. This is quite # easy to do - just change the next line temporarily to pass debug=True as @@ -1568,12 +1570,12 @@ class RunQueue: "Initialising tasks", [43, 967, 4, 3, 1, 5, 3, 7, 13, 1, 2, 1, 1, 246, 35, 1, 38, 1, 35, 2, 338, 204, 142, 3, 3, 37, 244]) if self.rqdata.prepare() == 0: - self.state = runQueueComplete + self.state = RunQueueState.COMPLETE else: - self.state = runQueueSceneInit + self.state = RunQueueState.SCENE_INIT bb.parse.siggen.save_unitaskhashes() - if self.state is runQueueSceneInit: + if self.state == RunQueueState.SCENE_INIT: self.rqdata.init_progress_reporter.next_stage() # we are ready to run, emit dependency info to any UI or class which @@ -1584,7 +1586,7 @@ class RunQueue: if not self.dm_event_handler_registered: res = bb.event.register(self.dm_event_handler_name, - lambda x, y: self.dm.check(self) if self.state in [runQueueRunning, runQueueCleanUp] else False, + lambda x, y: self.dm.check(self) if self.state in [RunQueueState.RUNNING, RunQueueState.CLEAN_UP] else False, ('bb.event.HeartbeatEvent',), data=self.cfgData) self.dm_event_handler_registered = True @@ -1596,17 +1598,17 @@ class RunQueue: self.rqdata.init_progress_reporter.finish() if 'printdiff' in dumpsigs: self.invalidtasks_dump = self.print_diffscenetasks() - self.state = runQueueDumpSigs + self.state = RunQueueState.DUMP_SIGS - if self.state is runQueueDumpSigs: + if self.state == RunQueueState.DUMP_SIGS: dumpsigs = self.cooker.configuration.dump_signatures retval = self.dump_signatures(dumpsigs) if retval is False: if 'printdiff' in dumpsigs: self.write_diffscenetasks(self.invalidtasks_dump) - self.state = runQueueComplete + self.state = RunQueueState.COMPLETE - if self.state is runQueueSceneInit: + if self.state == RunQueueState.SCENE_INIT: self.start_worker(self.rqexe) self.rqdata.init_progress_reporter.finish() @@ -1619,15 +1621,15 @@ class RunQueue: self.rqexe.tasks_notcovered.add(tid) self.rqexe.sqdone = True logger.info('Executing Tasks') - self.state = runQueueRunning + self.state = RunQueueState.RUNNING - if self.state is runQueueRunning: + if self.state == RunQueueState.RUNNING: retval = self.rqexe.execute() - if self.state is runQueueCleanUp: + if self.state == RunQueueState.CLEAN_UP: retval = self.rqexe.finish() - build_done = self.state is runQueueComplete or self.state is runQueueFailed + build_done = self.state in [RunQueueState.COMPLETE, RunQueueState.FAILED] if build_done and self.dm_event_handler_registered: bb.event.remove(self.dm_event_handler_name, None, data=self.cfgData) @@ -1643,10 +1645,10 @@ class RunQueue: # Let's avoid the word "failed" if nothing actually did logger.info("Tasks Summary: Attempted %d tasks of which %d didn't need to be rerun and all succeeded.", self.rqexe.stats.completed, self.rqexe.stats.skipped) - if self.state is runQueueFailed: + if self.state == RunQueueState.FAILED: raise bb.runqueue.TaskFailure(self.rqexe.failed_tids) - if self.state is runQueueComplete: + if self.state == RunQueueState.COMPLETE: # All done return False @@ -1666,7 +1668,7 @@ class RunQueue: self.teardown_workers() except: pass - self.state = runQueueComplete + self.state = RunQueueState.COMPLETE raise except Exception as err: logger.exception("An uncaught exception occurred in runqueue") @@ -1674,12 +1676,12 @@ class RunQueue: self.teardown_workers() except: pass - self.state = runQueueComplete + self.state = RunQueueState.COMPLETE raise def finish_runqueue(self, now = False): if not self.rqexe: - self.state = runQueueComplete + self.state = RunQueueState.COMPLETE return if now: @@ -2002,14 +2004,14 @@ class RunQueueExecute: pass if self.failed_tids: - self.rq.state = runQueueFailed + self.rq.state = RunQueueState.FAILED return - self.rq.state = runQueueComplete + self.rq.state = RunQueueState.COMPLETE return def finish(self): - self.rq.state = runQueueCleanUp + self.rq.state = RunQueueState.CLEAN_UP active = self.stats.active + len(self.sq_live) if active > 0: @@ -2018,10 +2020,10 @@ class RunQueueExecute: return self.rq.active_fds() if self.failed_tids: - self.rq.state = runQueueFailed + self.rq.state = RunQueueState.FAILED return True - self.rq.state = runQueueComplete + self.rq.state = RunQueueState.COMPLETE return True # Used by setscene only @@ -2140,7 +2142,7 @@ class RunQueueExecute: bb.event.fire(runQueueTaskFailed(task, self.stats, exitcode, self.rq, fakeroot_log=("".join(fakeroot_log) or None)), self.cfgData) if self.rqdata.taskData[''].halt: - self.rq.state = runQueueCleanUp + self.rq.state = RunQueueState.CLEAN_UP def task_skip(self, task, reason): self.runq_running.add(task) @@ -2334,17 +2336,17 @@ class RunQueueExecute: err = self.summarise_scenequeue_errors() if err: - self.rq.state = runQueueFailed + self.rq.state = RunQueueState.FAILED return True if self.cooker.configuration.setsceneonly: - self.rq.state = runQueueComplete + self.rq.state = RunQueueState.COMPLETE return True self.sqdone = True if self.stats.total == 0: # nothing to do - self.rq.state = runQueueComplete + self.rq.state = RunQueueState.COMPLETE return True if self.cooker.configuration.setsceneonly: @@ -2411,7 +2413,7 @@ class RunQueueExecute: self.rq.start_fakeworker(self, mc) except OSError as exc: logger.critical("Failed to spawn fakeroot worker to run %s: %s" % (task, str(exc))) - self.rq.state = runQueueFailed + self.rq.state = RunQueueState.FAILED self.stats.taskFailed() return True RunQueue.send_pickled_data(self.rq.fakeworker[mc].process, runtask, "runtask") @@ -2439,7 +2441,7 @@ class RunQueueExecute: return True if self.failed_tids: - self.rq.state = runQueueFailed + self.rq.state = RunQueueState.FAILED return True # Sanity Checks @@ -2456,9 +2458,9 @@ class RunQueueExecute: err = True if err: - self.rq.state = runQueueFailed + self.rq.state = RunQueueState.FAILED else: - self.rq.state = runQueueComplete + self.rq.state = RunQueueState.COMPLETE return True @@ -2688,7 +2690,7 @@ class RunQueueExecute: if dep in self.runq_complete and dep not in self.runq_tasksrun: bb.error("Task %s marked as completed but now needing to rerun? Halting build." % dep) self.failed_tids.append(tid) - self.rq.state = runQueueCleanUp + self.rq.state = RunQueueState.CLEAN_UP return if dep not in self.runq_complete: @@ -2823,7 +2825,7 @@ class RunQueueExecute: pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn] if not check_setscene_enforce_ignore_tasks(pn, taskname, self.rqdata.setscene_ignore_tasks): logger.error('Task %s.%s failed' % (pn, taskname + "_setscene")) - self.rq.state = runQueueCleanUp + self.rq.state = RunQueueState.CLEAN_UP def sq_task_complete(self, task): bb.event.fire(sceneQueueTaskCompleted(task, self.stats, self.rq), self.cfgData)