From nobody Mon Feb 9 16:35:23 2026 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-