From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 50C7574003A for ; Wed, 19 Jun 2024 07:54:36 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=2h0kHu4Jzdwc0iNhcTq1/jUUOO34N6cJ0i39OXWR72o=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1718783676; v=1; b=KrMElwTw51CzHiG/HbveK1joOXLOPLP1uUydKGYm+ck33t80G6T7sDj8dpjlACg57rQxBaaK KAO1OpDemBLAzIa5rvCKWE2NKuWriYkGT68vKjE8Ex3jZeIi15lQPr+X0o365FD4VK0RBwHwQnV 97S4lFSDv6vbOTe947sPTSTrMGShvwT/thL4mPYMws66eGXo3IkQN8xSvgwcr/uJfDDMf6fCU5c kwJ3hE+FMJOFlujf7vey2uJxbV0uzeAngJ6G3X4w3DenWj6jxBxQB9NAjX/oAiguPDpbwXtWDAJ pmOB4zmUUjZ2VBo3VG8sB/l8e9vgttJk/55ntUter+Aug== X-Received: by 127.0.0.2 with SMTP id 2LCeYY7687511xMDnzODhul0; Wed, 19 Jun 2024 00:54:34 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by mx.groups.io with SMTP id smtpd.web11.15496.1718783672457727732 for ; Wed, 19 Jun 2024 00:54:34 -0700 X-CSE-ConnectionGUID: hfhYR1OES1WsHcCYx1eSqw== X-CSE-MsgGUID: axFUhik8TkSrGy4ttaiyyQ== X-IronPort-AV: E=McAfee;i="6700,10204,11107"; a="15850608" X-IronPort-AV: E=Sophos;i="6.08,249,1712646000"; d="scan'208";a="15850608" X-Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2024 00:54:34 -0700 X-CSE-ConnectionGUID: OMTtDlQuSIy8lpfkwWAqww== X-CSE-MsgGUID: 5EBFo6dZTsGVHtaBgy2/uQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,249,1712646000"; d="scan'208";a="42310117" X-Received: from njayapra-mobl.gar.corp.intel.com ([10.247.242.185]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2024 00:54:33 -0700 From: "Jayaprakash, N" To: devel@edk2.groups.io Cc: Jayaprakash N , Rebecca Cran , Michael D Kinney Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc : update build and packaging scripts to take EDK2_LIBC_PATH Date: Wed, 19 Jun 2024 13:22:43 +0530 Message-ID: <20240619075421.1345-2-n.jayaprakash@intel.com> In-Reply-To: <20240619075421.1345-1-n.jayaprakash@intel.com> References: <20240619075421.1345-1-n.jayaprakash@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 19 Jun 2024 00:54:34 -0700 Resent-From: n.jayaprakash@intel.com Reply-To: devel@edk2.groups.io,n.jayaprakash@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NBJbYABcsKuZ9jVq3QijcPjex7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=KrMElwTw; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4791 This commit adds necessary changes to build and packaging scripts to take path to edk2-libc through an environment variable. It also updates the build and packaging instructions in GCCCompilationBKMs.rst file and Py368ReadMe.txt files. The Python368.inf file is also updated to take EDK2_LIBC_PATH instead of the current WORKSPACE path in the CC flags. Cc: Rebecca Cran Cc: Michael D Kinney Cc: Jayaprakash N Signed-off-by: Jayaprakash N --- .../Python-3.6.8/GCCCompilationBKMs.rst | 21 +++++++++++------ .../Python/Python-3.6.8/Py368ReadMe.txt | 22 ++++++++++++++++-- .../Python/Python-3.6.8/Python368.inf | 6 ++--- .../Python/Python-3.6.8/create_python_pkg.bat | 21 ++++++++++++++--- .../Python/Python-3.6.8/create_python_pkg.sh | 23 ++++++++++++++++--- 5 files changed, 75 insertions(+), 18 deletions(-) diff --git a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst index 0574977..667b408 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst +++ b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst @@ -136,17 +136,17 @@ Now clone the edk2-libc git repo by following / executing the below commands:: bash$ cd ~/src bash$ git clone https://github.com/tianocore/edk2-libc.git - bash$ export PACKAGES_PATH=$HOME/src/edk2:$HOME/src/edk2-libc +Set the PACKAGES_PATH and EDK2_LIBC_PATH using the commands below:: + + bash$ export PACKAGES_PATH=$HOME/src/edk2:$HOME/src/edk2-libc + bash$ export EDK2_LIBC_PATH=$HOME/src/edk2-libc Verify that you can build the hello world application from AppPkg under edk2-libc by running the following commands Build hello.inf from edk2-libc applications:: - $bash build -p AppPkg/AppPkg.dsc -m AppPkg/Applications/Hello/Hello.inf - -Copy the contents of edk2-libc to edk2 folder:: + $bash build -p ../edk2-libc/AppPkg/AppPkg.dsc -m ../edk2-libc/AppPkg/Applications/Hello/Hello.inf - bash$ cp -rf ~/src/edk2-libc/* ~/src/edk2/ 2.5. Build Python Interpreter using GCC ---------------------------------------- @@ -156,7 +156,8 @@ Execute the below command to build the X64 version of the Python 3.6.8 interpret bash$ cd AppPkg/Applications/Python/Python-3.6.8/ bash$ python srcprep.py bash$ cd ~/src/edk2 - bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc -m AppPkg/Applications/Python/Python-3.6.8/Python368.inf -D BUILD_PYTHON368 + bash$ build -a X64 -b RELEASE -p ../edk2-libc/AppPkg/AppPkg.dsc \ + -m ../edk2-libc/AppPkg/Applications/Python/Python-3.6.8/Python368.inf -D BUILD_PYTHON368 or bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc -D BUILD_PYTHON368 @@ -166,7 +167,13 @@ Execute the below command to build the X64 version of the Python 3.6.8 interpret To create an usable Python UEFI package with all the dependencies from the build environment, you can use the bash shell script create_python_pkg.sh available under /AppPkg/Applications/Python/Python-3.6.8 -folder. +folder. Ensure that EDK2_LIBC_PATH environment variable to edk2-libc folder path. + +Ensure that EDK2_LIBC_PATH environment variable to edk2-libc folder path:: + + bash$ echo $EDK2_LIBC_PATH + +The environment variable should be set to the folder path for the edk2-libc cloned repo. Use the following commands to create Python UEFI package:: diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt index 91f4c24..8a0b3fe 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt +++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt @@ -68,7 +68,24 @@ and that you can successfully build packages within that distribution. gc itertools math _operator time - C. Build AppPkg using the standard "build" command: + C. Set the PACKAGES_PATH and EDK2_LIBC_PATH environment variables to + the right values. PACKAGES_PATH should be set to the folder path of + edk2 and edk2-libc folders. EDK2_LIBC_PATH should be set to the + folder path of edk2-libc. + Use the below provided commands as reference to set the environment + variables to the corresponding values + + set PACKAGES_PATH=;; + set EDK2_LIBC_PATH= + + where, + should be replaced with the absolute path to + edk2 folder on your development system. + + should be replaced with the absolute path + to edk2-libc folder on your development system. + + D. Build AppPkg using the standard "build" command: For example, to build Python for an X64 CPU architecture: build -a X64 -p AppPkg\AppPkg.dsc -D BUILD_PYTHON368 @@ -115,7 +132,8 @@ system as follows: A script, create_python_pkg.bat , is provided which facilitates the population of the target EFI package. Execute this script from within the AppPkg/Applications/Python/Python-3.6.8 directory, providing the Tool Chain, Target - Build and destination directory which is the path to the destination directory. + Build and destination directory which is the path to the destination directory. + Ensure that EDK2_LIBC_PATH environment variable has been set to edk2-libc folder path. The appropriate contents of the AppPkg/Applications/Python/Python-3.6.8/Lib and Python.efi Application from Build/AppPkg/RELEASE_VS2017/X64/ will be ^^^^^^^^^^^^^^ diff --git a/AppPkg/Applications/Python/Python-3.6.8/Python368.inf b/AppPkg/Applications/Python/Python-3.6.8/Python368.inf index fe42fb4..ffd802c 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/Python368.inf +++ b/AppPkg/Applications/Python/Python-3.6.8/Python368.inf @@ -1,7 +1,7 @@ ## @file # Python368.inf # -# Copyright (c) 2011-2021, Intel Corporation. All rights reserved.
+# Copyright (c) 2011-2024, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -275,8 +275,8 @@ Modules/zlib PyMod-$(PYTHON_VERSION)/Modules/cpu_gcc.s | GCC # [BuildOptions] - MSFT:*_*_*_CC_FLAGS = /GL- /Oi- /wd4018 /wd4054 /wd4055 /wd4101 /wd4131 /wd4152 /wd4204 /wd4210 /wd4244 /wd4267 /wd4305 /wd4310 /wd4389 /wd4701 /wd4702 /wd4706 /wd4456 /wd4312 /wd4457 /wd4459 /wd4474 /wd4476 /I$(WORKSPACE)\AppPkg\Applications\Python\Python-3.6.8\Include /DHAVE_MEMMOVE /DUSE_PYEXPAT_CAPI /DXML_STATIC -D UEFI /WX- /DXML_POOR_ENTROPY /DUEFI_C_SOURCE - GCC:*_*_*_CC_FLAGS = -Wno-unused-function -Wno-format -Wno-error -fno-strict-aliasing -I$(WORKSPACE)/AppPkg/Applications/Python/Python-3.6.8/Include -DHAVE_MEMMOVE -DUSE_PYEXPAT_CAPI -DXML_STATIC -DXML_POOR_ENTROPY + MSFT:*_*_*_CC_FLAGS = /GL- /Oi- /wd4018 /wd4054 /wd4055 /wd4101 /wd4131 /wd4152 /wd4204 /wd4210 /wd4244 /wd4267 /wd4305 /wd4310 /wd4389 /wd4701 /wd4702 /wd4706 /wd4456 /wd4312 /wd4457 /wd4459 /wd4474 /wd4476 /I$(EDK2_LIBC_PATH)\AppPkg\Applications\Python\Python-3.6.8\Include /DHAVE_MEMMOVE /DUSE_PYEXPAT_CAPI /DXML_STATIC -D UEFI /WX- /DXML_POOR_ENTROPY /DUEFI_C_SOURCE + GCC:*_*_*_CC_FLAGS = -Wno-unused-function -Wno-format -Wno-error -fno-strict-aliasing -I$(EDK2_LIBC_PATH)/AppPkg/Applications/Python/Python-3.6.8/Include -DHAVE_MEMMOVE -DUSE_PYEXPAT_CAPI -DXML_STATIC -DXML_POOR_ENTROPY [BuildOptions.IA32] MSFT:*_*_*_CC_FLAGS = /DUEFI_MSVC_32 diff --git a/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.bat b/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.bat index 32044d2..2682ac6 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.bat +++ b/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.bat @@ -27,7 +27,22 @@ echo. goto :eof :continue -cd ..\..\..\..\ +echo current working directory %CD% +echo changing working directory to workspace %WORKSPACE% +cd %WORKSPACE% +dir + +if "%EDK2_LIBC_PATH%" == "" ( + echo Warning: EDK2_LIBC_PATH environment variable is not set + echo It should be set to edk2-libc folder path. + echo. + echo Assuming that edk2-libc contents are copied to edk2 folder + echo at compilation time, setting this variable to edk2 path. + set EDK2_LIBC_PATH=%WORKSPACE% +) + +echo edk2 libc path %EDK2_LIBC_PATH% + if not exist Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python.efi ( goto error ) @@ -43,8 +58,8 @@ if not exist %OUT_FOLDER%\EFI\StdLib\lib\python36.8 ( if not exist %OUT_FOLDER%\EFI\StdLib\etc ( mkdir %OUT_FOLDER%\EFI\StdLib\etc ) -xcopy AppPkg\Applications\Python\Python-3.6.8\Lib\* %OUT_FOLDER%\EFI\StdLib\lib\python36.8\ /Y /S /I -xcopy StdLib\Efi\StdLib\etc\* %OUT_FOLDER%\EFI\StdLib\etc\ /Y /S /I +xcopy %EDK2_LIBC_PATH%\AppPkg\Applications\Python\Python-3.6.8\Lib\* %OUT_FOLDER%\EFI\StdLib\lib\python36.8\ /Y /S /I +xcopy %EDK2_LIBC_PATH%\StdLib\Efi\StdLib\etc\* %OUT_FOLDER%\EFI\StdLib\etc\ /Y /S /I echo. if not x%OUT_FOLDER::=%==x%OUT_FOLDER% ( diff --git a/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh b/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh index 4a3a1e5..323d846 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh +++ b/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh @@ -59,7 +59,24 @@ then exit fi -cd ../../../../ +echo current working directory `pwd` +echo changing working directory to $WORKSPACE +cd $WORKSPACE +ls + +# check if the EDK2_LIBC_PATH environment variable set or not +if [ -z $EDK2_LIBC_PATH ] +then + echo Warning: EDK2_LIBC_PATH environment variable is not set + echo It should be set to edk2-libc folder path. + echo. + echo Assuming that edk2-libc contents are copied to edk2 folder + echo at compilation time, setting this variable to edk2 path. + export EDK2_LIBC_PATH=$WORKSPACE +fi + +echo edk2 libc path $EDK2_LIBC_PATH + PYTHON_BIN="Build/AppPkg/$TARGET"_"$TOOL_CHAIN_TAG/$ARCH/Python.efi" if [ ! -f $PYTHON_BIN ] then @@ -86,8 +103,8 @@ then mkdir -p $OUT_FOLDER/EFI/StdLib/etc fi -cp -rf AppPkg/Applications/Python/Python-3.6.8/Lib/* $OUT_FOLDER/EFI/StdLib/lib/python36.8/ -cp -rf StdLib/Efi/StdLib/etc/* $OUT_FOLDER/EFI/StdLib/etc/ +cp -rf $EDK2_LIBC_PATH/AppPkg/Applications/Python/Python-3.6.8/Lib/* $OUT_FOLDER/EFI/StdLib/lib/python36.8/ +cp -rf $EDK2_LIBC_PATH/StdLib/Efi/StdLib/etc/* $OUT_FOLDER/EFI/StdLib/etc/ if [ ${OUT_FOLDER:0:1} == "/" ] then -- 2.45.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119631): https://edk2.groups.io/g/devel/message/119631 Mute This Topic: https://groups.io/mt/106756612/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-