From nobody Fri May 17 00:50:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104205+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104205+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1683401471; cv=none; d=zohomail.com; s=zohoarc; b=XoIvGWVwJB9UT1vuIzd9/BDjqw8ITa9yJ5UPFDfIVsKV1Y1FSuiQqtCIH3KHvtmIoPAYY65pfjg9/bRIJ/RhJKKJz6y1zXySlbrnByKvVZ7czTs1idHMdCKKoCY1m2ZxzALBGzLsZ4sO2zsmBPjakhKulgqB+VDiO0TkFtmMpyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683401471; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=r8r30Y85hcUGLJwXMnegjiv9M0Ts8c7d1rJ3mbykRnk=; b=b97SH6q8Em8sK6hki5Ai5/1nUrksyQVHIMD2JxjfrpA8e4rBrleknYRxaRgonJt6gxccyqC+jkF9bZwRpC//02i/V50COcWETAiS/GaFHrD24WmwJOGlKgHCLh9oYXXXpip3Ll5R65DvSgP2SOgfNLOGCtMFQ25qhMPfW3HDc30= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104205+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1683401471515120.60702452411442; Sat, 6 May 2023 12:31:11 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id LpT2YY1788612xwlbkYuHqvD; Sat, 06 May 2023 12:31:11 -0700 X-Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by mx.groups.io with SMTP id smtpd.web10.40786.1683401470616025277 for ; Sat, 06 May 2023 12:31:10 -0700 X-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 88C5632002D8; Sat, 6 May 2023 15:31:09 -0400 (EDT) X-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 06 May 2023 15:31:10 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefgedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeftvggs vggttggrucevrhgrnhcuoehrvggsvggttggrsegsshguihhordgtohhmqeenucggtffrrg htthgvrhhnpeegffeuueelvdeggfdvvdfgtedvudfhfeekudekieektddukeefteetieef vdelfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrvggsvggttggrsegsshguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 6 May 2023 15:31:08 -0400 (EDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Andrew Fish , Leif Lindholm , Michael D Kinney , Liming Gao , Bob Feng , Yuwei Chen Cc: Rebecca Cran Subject: [edk2-devel] [PATCH v3 1/4] BaseTools: Remove Python2/Python3 detection from toolset.bat Date: Sat, 6 May 2023 13:30:49 -0600 Message-Id: <20230506193052.1835-2-rebecca@bsdio.com> In-Reply-To: <20230506193052.1835-1-rebecca@bsdio.com> References: <20230506193052.1835-1-rebecca@bsdio.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@bsdio.com X-Gm-Message-State: 6FC5azQTf8UMeM53Zk8kBgbxx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683401471; bh=sS3hkPKEe//+4knAlIDhAQl7ppE2+3HWyh/NJ2gmL/0=; h=Cc:Date:From:Reply-To:Subject:To; b=w5szRYB474ZqgWKo35suIspnQHDxgoss42aBnYeGbJCqGWI4qAKc5e4rkFFaEzqRO8X t1j1+eg0GrzkO6JvJaU/I0n/lRFl8rHKvqleTnUcysSWFv5a9ee8xRE8syEysR4AeK8ZT +SdcEu1ULLB2fOfFpphUndQc78RtLnbqffE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683401473550100007 Content-Type: text/plain; charset="utf-8" Since Python3 is now required, we can remove the checks for PYTHON3_ENABLE and PYTHON3 and simplify the code in toolsetup.bat. Also, remove the leftover from when we supported freezing Python code. While here, fix a couple of typos and improve error messages. Signed-off-by: Rebecca Cran --- BaseTools/toolsetup.bat | 64 +++++--------------- 1 file changed, 16 insertions(+), 48 deletions(-) diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index 25d13d559cd6..3d13e9fad286 100755 --- a/BaseTools/toolsetup.bat +++ b/BaseTools/toolsetup.bat @@ -305,18 +305,8 @@ goto check_build_environment ) =20 :defined_python -if defined PYTHON_COMMAND if not defined PYTHON3_ENABLE ( - goto check_python_available -) -if defined PYTHON3_ENABLE ( - if "%PYTHON3_ENABLE%" EQU "TRUE" ( - set PYTHON_COMMAND=3Dpy -3 - goto check_python_available - ) else ( - goto check_python2 - ) -) -if not defined PYTHON_COMMAND if not defined PYTHON3_ENABLE ( + +if not defined PYTHON_COMMAND ( set PYTHON_COMMAND=3Dpy -3 py -3 %BASE_TOOLS_PATH%\Tests\PythonTest.py >PythonCheck.txt 2>&1 setlocal enabledelayedexpansion @@ -328,56 +318,40 @@ if not defined PYTHON_COMMAND if not defined PYTHON3_= ENABLE ( set PYTHON_COMMAND=3D echo. echo !!! ERROR !!! Binary python tools are missing. - echo PYTHON_COMMAND, PYTHON3_ENABLE or PYTHON_HOME - echo Environment variable is not set successfully. - echo They is required to build or execute the python tools. + echo PYTHON_COMMAND or PYTHON_HOME + echo Environment variable is not set correctly. + echo They are required to build or execute the python tools. echo. goto end - ) else ( - goto check_python2 ) - ) else ( - goto check_freezer_path ) ) =20 -:check_python2 endlocal + if defined PYTHON_HOME ( if EXIST "%PYTHON_HOME%" ( set PYTHON_COMMAND=3D%PYTHON_HOME%\python.exe - goto check_python_available + ) else ( + echo . + echo !!! ERROR !!! PYTHON_HOME=3D"%PYTHON_HOME%" does not exist. + echo . + goto end ) ) -if defined PYTHONHOME ( - if EXIST "%PYTHONHOME%" ( - set PYTHON_HOME=3D%PYTHONHOME% - set PYTHON_COMMAND=3D%PYTHON_HOME%\python.exe - goto check_python_available - ) -) -echo. -echo !!! ERROR !!! PYTHON_HOME is not defined or The value of this variab= le does not exist -echo. -goto end -:check_python_available + %PYTHON_COMMAND% %BASE_TOOLS_PATH%\Tests\PythonTest.py >PythonCheck.txt 2>= &1 setlocal enabledelayedexpansion set /p PythonCheck=3D<"PythonCheck.txt" del PythonCheck.txt if "!PythonCheck!" NEQ "TRUE" ( echo. - echo ! ERROR ! "%PYTHON_COMMAND%" is not installed or added to enviro= nment variables + echo ! ERROR ! PYTHON_COMMAND=3D"%PYTHON_COMMAND%" is not installed o= r added to environment variables echo. goto end - ) else ( - goto check_freezer_path - ) +) =20 - - -:check_freezer_path - endlocal +endlocal =20 %PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL if %ERRORLEVEL% EQU 0 ( @@ -404,13 +378,7 @@ goto end =20 :print_python_info echo PATH =3D %PATH% - if defined PYTHON3_ENABLE if "%PYTHON3_ENABLE%" EQU "TRUE" ( - echo PYTHON3_ENABLE =3D %PYTHON3_ENABLE% - echo PYTHON3 =3D %PYTHON_COMMAND% - ) else ( - echo PYTHON3_ENABLE =3D FALSE - echo PYTHON_COMMAND =3D %PYTHON_COMMAND% - ) + echo PYTHON_COMMAND =3D %PYTHON_COMMAND% echo PYTHONPATH =3D %PYTHONPATH% echo. =20 --=20 2.40.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104205): https://edk2.groups.io/g/devel/message/104205 Mute This Topic: https://groups.io/mt/98730532/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 00:50:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104206+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104206+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1683401473; cv=none; d=zohomail.com; s=zohoarc; b=OhE5KFhi2JKmx8s/VrjcxC0uGitgb5AAMWbBRCvvbseD2xLLt3ZcMI3buId7thHdqIjQkmHEE20J603YpYOPzJr9OPtXtnulyOPHV1tGpr+xIUV0q8zqMMzJlQt8jkfYl8r3+017HEXvrR48u2LOQktT7t12bkLyS7qiqpBXs78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683401473; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=3X57WbXRjw66OCdxns/zpo642APznYzJsq/aoQasZxk=; b=Pc2POcqZ52Mk9gmo7YCFs+UW9Z3Ly6g2I8UR9Jmu7UEWMocKaB2m+s5XcUZ89K6egNClA30KMzSZIt53EzjVriHdiXhFVHOhjpzVHFyFpaVRnUM6OBHmcUwv/Uc5cnv0sAYX5+k6pLgiNqzQ22r2iHYIwSMGLUnPJ7SzBgJSnTM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104206+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1683401473865404.4040958602335; Sat, 6 May 2023 12:31:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id xhr8YY1788612xVLxztebaCz; Sat, 06 May 2023 12:31:13 -0700 X-Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by mx.groups.io with SMTP id smtpd.web10.40788.1683401473081559847 for ; Sat, 06 May 2023 12:31:13 -0700 X-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 1062932000E5; Sat, 6 May 2023 15:31:11 -0400 (EDT) X-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 06 May 2023 15:31:12 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefgedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeftvggs vggttggrucevrhgrnhcuoehrvggsvggttggrsegsshguihhordgtohhmqeenucggtffrrg htthgvrhhnpeegffeuueelvdeggfdvvdfgtedvudfhfeekudekieektddukeefteetieef vdelfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrvggsvggttggrsegsshguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 6 May 2023 15:31:10 -0400 (EDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Andrew Fish , Leif Lindholm , Michael D Kinney , Liming Gao , Bob Feng , Yuwei Chen Cc: Rebecca Cran Subject: [edk2-devel] [PATCH v3 2/4] BaseTools: use threading.current_thread in NmakeSubdirs.py Date: Sat, 6 May 2023 13:30:50 -0600 Message-Id: <20230506193052.1835-3-rebecca@bsdio.com> In-Reply-To: <20230506193052.1835-1-rebecca@bsdio.com> References: <20230506193052.1835-1-rebecca@bsdio.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@bsdio.com X-Gm-Message-State: UA2H429cnuzzExCMWwrw2LWqx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683401473; bh=UWAStX5qI2iPvvqR0boI2rlB0QWaKLYx3AtA1wWxPw0=; h=Cc:Date:From:Reply-To:Subject:To; b=AKxtO9ksymG8Ua2/zgr/KUMIUsABvY+ZXrFiLHh5GS40LqYWPJMS7Iccd7Bic/ht1C8 VbSygGt1q69z3nm/NhbjAfaLq+3iVOZ/kRsVTAO/b8fMOlvXTBhMZT83fHR/+5uJ5uqp5 vRusI2IOJOwRYrNV6uB9CqbeMQy/TVkN14s= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683401475481100011 Content-Type: text/plain; charset="utf-8" threading.currentThread is a deprecated alias for threading.current_thread, and causes a warning to be displayed when it's called. Update NmakeSubdirs.py to use the latter method instead. Signed-off-by: Rebecca Cran --- BaseTools/Source/C/Makefiles/NmakeSubdirs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/C/Makefiles/NmakeSubdirs.py b/BaseTools/Sourc= e/C/Makefiles/NmakeSubdirs.py index 1f4a45004f4b..7860c040afa0 100644 --- a/BaseTools/Source/C/Makefiles/NmakeSubdirs.py +++ b/BaseTools/Source/C/Makefiles/NmakeSubdirs.py @@ -132,7 +132,7 @@ class ThreadControl(object): break =20 self.runningLock.acquire(True) - self.running.remove(threading.currentThread()) + self.running.remove(threading.current_thread()) self.runningLock.release() =20 def Run(): --=20 2.40.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104206): https://edk2.groups.io/g/devel/message/104206 Mute This Topic: https://groups.io/mt/98730533/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 00:50:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104207+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104207+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1683401476; cv=none; d=zohomail.com; s=zohoarc; b=a9ZZOjElY01vWfcIbcFR2XECWq8p/B5mqDI/lf+VtzZrQrRftYb7/Ol7rW723ulhPhG92yiBKaDGIoErXlMCL4Sfowc/vonYGsA/km0NxMlULyOQoFKbJL/Jbafz6TwSCa8IrfhpX+birYWYjW3mFRhR4ndKmH7KV3I5zb0YOYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683401476; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=U7E3R5X4uwiWRurm2DA9PFGFA0xkxvOewgPEZcuQNgg=; b=kPQgZevAxXNUgR8ou+iJtb80a/ciNPU6VH6IglqCMl4/sCKW9nFO2V8DWhWgDkEiPmBUXRENEX9JOZxzC4ioUbdBfgKZK5dvFKuZCkg/91AgfGl5nYP34F0kYa/wIIIBu5stBt8SNOMDIPkDzeIDo1tQHSBXVcUD2itrscVRn74= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104207+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1683401476367881.895659403386; Sat, 6 May 2023 12:31:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Mg76YY1788612xW5y07iLUwq; Sat, 06 May 2023 12:31:16 -0700 X-Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by mx.groups.io with SMTP id smtpd.web10.40790.1683401475462093446 for ; Sat, 06 May 2023 12:31:15 -0700 X-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 6C0F53200319; Sat, 6 May 2023 15:31:14 -0400 (EDT) X-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 06 May 2023 15:31:15 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefgedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeftvggs vggttggrucevrhgrnhcuoehrvggsvggttggrsegsshguihhordgtohhmqeenucggtffrrg htthgvrhhnpeegffeuueelvdeggfdvvdfgtedvudfhfeekudekieektddukeefteetieef vdelfeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrvggsvggttggrsegsshguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 6 May 2023 15:31:12 -0400 (EDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Andrew Fish , Leif Lindholm , Michael D Kinney , Liming Gao , Bob Feng , Yuwei Chen Cc: Rebecca Cran Subject: [edk2-devel] [PATCH v3 3/4] edksetup.bat: if toolsetup.bat fails, just exit Date: Sat, 6 May 2023 13:30:51 -0600 Message-Id: <20230506193052.1835-4-rebecca@bsdio.com> In-Reply-To: <20230506193052.1835-1-rebecca@bsdio.com> References: <20230506193052.1835-1-rebecca@bsdio.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@bsdio.com X-Gm-Message-State: wNarCfHkvCnsX2oz2Wv7Ibw6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683401476; bh=usJy4kOidwwMQXEwoZf74O9aMNsXY5M/hNwAuMabif4=; h=Cc:Date:From:Reply-To:Subject:To; b=XdfQl2y45quFKQrE1PxoWItiPJ+xiDClQ9ZjfR5m7qm7pCTkAHniEGgXsSu1t1LFQH2 /bhQlyT+dQS3QMqCVp1MV/iF20nz1mQqlZWk3nYam0RZBTw85fSblYlhdkOekKJzAdA9W 5C/JDjSnHpzdfIrQAj4juX9AI/PYL63dZ7U= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683401478267100001 Content-Type: text/plain; charset="utf-8" If toolsetup.bat fails (i.e. exits with a non-zero %ERRORLEVEL%), don't try and carry on but just quit. Signed-off-by: Rebecca Cran --- edksetup.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/edksetup.bat b/edksetup.bat index 2fdf130e00e2..71ceefb32742 100755 --- a/edksetup.bat +++ b/edksetup.bat @@ -86,6 +86,7 @@ if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=3D%E= DK_TOOLS_PATH% :checkBaseTools IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools call %EDK_TOOLS_PATH%\toolsetup.bat %* +if %ERRORLEVEL% NEQ 0 goto end if /I "%1"=3D=3D"Reconfig" shift goto check_NASM goto check_cygwin --=20 2.40.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104207): https://edk2.groups.io/g/devel/message/104207 Mute This Topic: https://groups.io/mt/98730538/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 00:50:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104208+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104208+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1683401479; cv=none; d=zohomail.com; s=zohoarc; b=oBem9rjhU3+x2MfO0bFDOlamvM8vkIMsSLNDWgc1ZUYyyvgLnC/4A4jsA9aFZkNvbqBuPLzU4AxVFKS+0wyt2vmZmHOE9TOK/JtZi7d4/jCzmObQ51ioIkae89KKCSQIpM8OwO/t3eIeE3uFNGYiutiyBIpMRiil/rUHINA4vQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683401479; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=VCl+gGRl5TjWmxKjHj0u2lwEbmEiyylC6BwPL7PfT4Y=; b=hdjbG2lVGI9hdngadEu0KGEdQqzK2LgZZykDsPjeXpUdDzVK5kC9vIoU4PF/fHK6GQow0Gcv8Y5jfDrtaIF+wGb6K2jU1rPO69N/Xnp3mmlRAUE1SiXxOqP24vY0zAuLvRHjiQdZZakbovkF8VgUKpXc3grWmDQvAee8S1Eas18= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104208+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1683401479723522.381791434166; Sat, 6 May 2023 12:31:19 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id yKF5YY1788612x2lXx5KdWIb; Sat, 06 May 2023 12:31:19 -0700 X-Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by mx.groups.io with SMTP id smtpd.web11.40882.1683401478869319049 for ; Sat, 06 May 2023 12:31:18 -0700 X-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D1F2A32002D8; Sat, 6 May 2023 15:31:17 -0400 (EDT) X-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 06 May 2023 15:31:18 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefgedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeftvggs vggttggrucevrhgrnhcuoehrvggsvggttggrsegsshguihhordgtohhmqeenucggtffrrg htthgvrhhnpefhtddthefhjedufeevtdeuheduvdeutefgieeufeejgffhvddtleeftedu tdfggfenucffohhmrghinhepphihthhhohhnrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprhgvsggvtggtrgessghsughiohdrtgho mh X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 6 May 2023 15:31:15 -0400 (EDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Andrew Fish , Leif Lindholm , Michael D Kinney , Liming Gao , Bob Feng , Yuwei Chen Cc: Rebecca Cran Subject: [edk2-devel] [PATCH v3 4/4] BaseTools: Update toolsetup.bat and Tests/PythonTest.py to check ver Date: Sat, 6 May 2023 13:30:52 -0600 Message-Id: <20230506193052.1835-5-rebecca@bsdio.com> In-Reply-To: <20230506193052.1835-1-rebecca@bsdio.com> References: <20230506193052.1835-1-rebecca@bsdio.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@bsdio.com X-Gm-Message-State: ZFfcBCLmnCbcdRXUxceSvB7Jx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683401479; bh=AY8rZMu3vaZ1Mh5HDFwATpgPU/8dWt3ju3jQ2P8EOWA=; h=Cc:Date:From:Reply-To:Subject:To; b=qJQDRGvskTvhbRxXv5d+cUGkE28mc8gtF3Gg+Ri7NbptyKcRRZHGmSdGGFA63I9Mqby npHghn5FtRpZEU6gDDiSH+OaH7wgnv2HbtjhG35N/0/6YZmGvMVsPY6VDwhgjjb9/5MPt UcKIhEONi7m6zqp9O3/SGXMvPW80NUE1vTE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683401480402100007 Content-Type: text/plain; charset="utf-8" Update toolsetup.bat and Tests/PythonTest.py to check if we're running a version of Python that's compatible with BaseTools and the Pip BaseTools. BaseTools uses syntax from Python 3.6 or newer, so set that as the minimum version EDK2 requires. Signed-off-by: Rebecca Cran --- BaseTools/Tests/PythonTest.py | 22 ++++++- BaseTools/toolsetup.bat | 61 +++++++++++--------- 2 files changed, 54 insertions(+), 29 deletions(-) diff --git a/BaseTools/Tests/PythonTest.py b/BaseTools/Tests/PythonTest.py index ec44c7947086..b87c78570eae 100644 --- a/BaseTools/Tests/PythonTest.py +++ b/BaseTools/Tests/PythonTest.py @@ -1,9 +1,27 @@ ## @file -# Test whether PYTHON_COMMAND is available +# Test whether PYTHON_COMMAND is available and the +# minimum Python version is installed. # # Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # =20 +import sys + if __name__ =3D=3D '__main__': - print('TRUE') + # Check if the major and minor versions required were specified. + if len(sys.argv) >=3D 3: + req_major_version =3D int(sys.argv[1]) + req_minor_version =3D int(sys.argv[2]) + else: + # If the minimum version wasn't specified on the command line, + # default to 3.6 because BaseTools uses syntax from PEP 526 + # (https://peps.python.org/pep-0526/) + req_major_version =3D 3 + req_minor_version =3D 6 + + if sys.version_info.major =3D=3D req_major_version and \ + sys.version_info.minor >=3D req_minor_version: + sys.exit(0) + else: + sys.exit(1) diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index 3d13e9fad286..dc6288effd7d 100755 --- a/BaseTools/toolsetup.bat +++ b/BaseTools/toolsetup.bat @@ -12,6 +12,8 @@ @echo off pushd . set SCRIPT_ERROR=3D0 +set PYTHON_VER_MAJOR=3D3 +set PYTHON_VER_MINOR=3D6 =20 @REM ############################################################## @REM # You should not have to modify anything below this line @@ -304,17 +306,19 @@ goto check_build_environment ) ) =20 -:defined_python +@REM Check Python environment =20 if not defined PYTHON_COMMAND ( set PYTHON_COMMAND=3Dpy -3 - py -3 %BASE_TOOLS_PATH%\Tests\PythonTest.py >PythonCheck.txt 2>&1 - setlocal enabledelayedexpansion - set /p PythonCheck=3D<"PythonCheck.txt" - del PythonCheck.txt - if "!PythonCheck!" NEQ "TRUE" ( + py -3 %BASE_TOOLS_PATH%\Tests\PythonTest.py %PYTHON_VER_MAJOR% %PYTHON_V= ER_MINOR% >NUL 2>NUL + if %ERRORLEVEL% EQU 1 ( + echo. + echo !!! ERROR !!! Python %PYTHON_VER_MAJOR%.%PYTHON_VER_MINOR% or new= er is required. + echo. + goto end + ) + if %ERRORLEVEL% NEQ 0 ( if not defined PYTHON_HOME if not defined PYTHONHOME ( - endlocal set PYTHON_COMMAND=3D echo. echo !!! ERROR !!! Binary python tools are missing. @@ -327,8 +331,6 @@ if not defined PYTHON_COMMAND ( ) ) =20 -endlocal - if defined PYTHON_HOME ( if EXIST "%PYTHON_HOME%" ( set PYTHON_COMMAND=3D%PYTHON_HOME%\python.exe @@ -340,27 +342,30 @@ if defined PYTHON_HOME ( ) ) =20 -%PYTHON_COMMAND% %BASE_TOOLS_PATH%\Tests\PythonTest.py >PythonCheck.txt 2>= &1 - setlocal enabledelayedexpansion - set /p PythonCheck=3D<"PythonCheck.txt" - del PythonCheck.txt - if "!PythonCheck!" NEQ "TRUE" ( - echo. - echo ! ERROR ! PYTHON_COMMAND=3D"%PYTHON_COMMAND%" is not installed o= r added to environment variables - echo. - goto end +%PYTHON_COMMAND% %BASE_TOOLS_PATH%\Tests\PythonTest.py %PYTHON_VER_MAJOR% = %PYTHON_VER_MINOR% >NUL 2>NUL +if %ERRORLEVEL% EQU 1 ( + echo. + echo !!! ERROR !!! Python %PYTHON_VER_MAJOR%.%PYTHON_VER_MINOR% or newer= is required. + echo. + goto end +) +if %ERRORLEVEL% NEQ 0 ( + echo. + echo !!! ERROR !!! PYTHON_COMMAND=3D"%PYTHON_COMMAND%" does not exist o= r is not a Python interpreter. + echo. + goto end ) =20 endlocal =20 - %PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL - if %ERRORLEVEL% EQU 0 ( - goto use_pip_basetools - ) else ( - REM reset ERRORLEVEL - type nul>nul - goto use_builtin_basetools - ) +%PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL +if %ERRORLEVEL% EQU 0 ( + goto use_pip_basetools +) else ( + REM reset ERRORLEVEL + type nul>nul + goto use_builtin_basetools +) =20 :use_builtin_basetools @echo Using EDK2 in-source Basetools @@ -444,5 +449,7 @@ set VS2019=3D set VS2017=3D set VS2015=3D set VSTool=3D +set PYTHON_VER_MAJOR=3D +set PYTHON_VER_MINOR=3D +set SCRIPT_ERROR=3D popd - --=20 2.40.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104208): https://edk2.groups.io/g/devel/message/104208 Mute This Topic: https://groups.io/mt/98730540/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-