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 B3EEBD81164 for ; Fri, 14 Jun 2024 17:03:05 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Wo8neHacFhvjlv/4K64ZzcL2T7Q0Srm6KARUUdAkM7A=; 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=1718384585; v=1; b=gd8VqOGeKwcxiJa4Zcx/xX+Q7q0NIoysm2u0S5i2FNLmkj6BvtWNk+TriVVvtIebRQiv0sMy FrIeqXh5SypW4lEiUoA6SlU4JskxGUaNZEtSoAu/CB7CGgs8GWLRzG2bUO3Vy1w2I7ehMuAnU26 M4xSPSfzkWTfomt7dPJFirP2YzggXYMnh1KCXGyndE4YBfIHDpJr/iJkzpHWTPcdlK48PcFX6L6 Xw5tReHGywhtynmdSdkjaFR3VAw68MpuaEtvzjFNAYl7WpoQtjf1+PoWCFDclq/BbdllwCDJFNP n8JWcHw3vRy4yYz1ylophwnFyUosZmYCD65qILv8plimg== X-Received: by 127.0.0.2 with SMTP id TT1SYY7687511xasZ4K5CDXl; Fri, 14 Jun 2024 10:03:04 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mx.groups.io with SMTP id smtpd.web10.544.1718384582003481109 for ; Fri, 14 Jun 2024 10:03:03 -0700 X-CSE-ConnectionGUID: 7qA1XUjmSVaHbdBDGC0UMw== X-CSE-MsgGUID: +CErshkiRbmTq3WsVVgU7w== X-IronPort-AV: E=McAfee;i="6700,10204,11103"; a="15509515" X-IronPort-AV: E=Sophos;i="6.08,238,1712646000"; d="scan'208";a="15509515" X-Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 10:03:03 -0700 X-CSE-ConnectionGUID: Ix/8bb8jS9CNV/h6hg3EMQ== X-CSE-MsgGUID: cqEOYxv8QPGCnNTxk02eEg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,238,1712646000"; d="scan'208";a="40660711" X-Received: from njayapra-mobl.gar.corp.intel.com ([10.247.135.165]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 10:03:01 -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 : add github actions workflow to build PyUEFI using VS2019 Date: Fri, 14 Jun 2024 22:31:31 +0530 Message-ID: <20240614170247.1201-2-n.jayaprakash@intel.com> In-Reply-To: <20240614170247.1201-1-n.jayaprakash@intel.com> References: <20240614170247.1201-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: Fri, 14 Jun 2024 10:03:03 -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: pgGE4HrA4cUeFhsezwFwcKVxx7686176AA= 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=gd8VqOGe; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4788 This commit adds github actions workflow to build python uefi interpreter with visual studio 2019 tool chain. The build-python-uefi-vs.yaml file under .github/workflows implements the build action for building the pyuefi interpreter with VS2019 tool chain. There is also a supporting python script under .github/scripts folder which is used to uncomment the python uefi related .inf file in AppPkg.dsc file. Cc: Rebecca Cran Cc: Michael D Kinney Cc: Jayaprakash N Signed-off-by: Jayaprakash N --- .github/scripts/enable_pyuefi_apppkg.py | 31 ++++++++ .github/workflows/build-python-uefi-vs.yaml | 84 +++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 .github/scripts/enable_pyuefi_apppkg.py create mode 100644 .github/workflows/build-python-uefi-vs.yaml diff --git a/.github/scripts/enable_pyuefi_apppkg.py b/.github/scripts/enable_pyuefi_apppkg.py new file mode 100644 index 0000000..37b9e0a --- /dev/null +++ b/.github/scripts/enable_pyuefi_apppkg.py @@ -0,0 +1,31 @@ +'''Script to enable the build of python UEFI interpreter + in AppPkg.dsc file +''' +import os + + +script_path = os.path.abspath(__file__) +script_dir = os.path.dirname(script_path) + +# path to the AppPkg.dsc file +path_to_AppPkg_dsc = os.path.join(script_dir, '..', '..', 'edk2', 'AppPkg', 'AppPkg.dsc') +print('Path to AppPkg dsc file : ', path_to_AppPkg_dsc) + +# Check if the file exists +if not os.path.isfile(path_to_AppPkg_dsc): + print(f"The file {path_to_AppPkg_dsc} does not exist.") +else: + # Read the content of the file + with open(path_to_AppPkg_dsc, 'r') as file: + lines = file.readlines() + + # Uncomment the line containing "Python368.inf" + with open(path_to_AppPkg_dsc, 'w') as file: + for line in lines: + if 'Python368.inf' in line and line.strip().startswith('#'): + # Uncomment the line + file.write(line.lstrip('#')) + else: + file.write(line) + + print(f"The file {path_to_AppPkg_dsc} has been updated.") diff --git a/.github/workflows/build-python-uefi-vs.yaml b/.github/workflows/build-python-uefi-vs.yaml new file mode 100644 index 0000000..aa5c317 --- /dev/null +++ b/.github/workflows/build-python-uefi-vs.yaml @@ -0,0 +1,84 @@ +name: Build Python Interpreter for UEFI using VS2019 + +on: [push, pull_request] + +jobs: + build: + runs-on: windows-2019 + env: + NASM_PREFIX: "C:\\Program Files\\NASM\\" + defaults: + run: + shell: cmd + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install NASM + run: choco install nasm + + - name: VSWhere + run: | + "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" + + - name: Setup environment for Visual Studio 2019 Build Tools + run: | + "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x86 + set + + - name: Clone EDK2 + run: | + git clone https://github.com/tianocore/edk2.git" + cd edk2 + git submodule update --init + + - name: Copy edk2-libc contents to edk2 + run: | + dir + cmd /c xcopy /E /I /Y AppPkg edk2\AppPkg + cmd /c xcopy /E /I /Y StdLib edk2\StdLib + cmd /c xcopy /E /I /Y StdLibPrivateInternalFiles edk2\StdLibPrivateInternalFiles + + - name: Build EDK2 Base Tools + run: | + cd edk2 + dir + edksetup.bat ForceRebuild + + - name: Enable python368.inf file in AppPkg.dsc + run: | + cd .github\scripts + dir + python enable_pyuefi_apppkg.py + + - name: Build Python UEFI + run: | + cd edk2 + call edksetup.bat + cd AppPkg\Applications\Python\Python-3.6.8\ + python srcprep.py + cd ..\..\..\..\..\ + build -t VS2019 -a X64 -b RELEASE -p AppPkg\AppPkg.dsc + + - name: Create Python UEFI package + run: | + dir + cd edk2\AppPkg\Applications\Python\Python-3.6.8\ + dir + call create_python_pkg.bat VS2019 RELEASE X64 myUEFIPy + + - name: List build artifacts + run: | + dir /S edk2\myUEFIPy + + - name: Upload build output as artifact + uses: actions/upload-artifact@v4 + with: + name: myUEFIPy-build-VS2019-output + path: edk2\myUEFIPy\**\* -- 2.45.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119578): https://edk2.groups.io/g/devel/message/119578 Mute This Topic: https://groups.io/mt/106674325/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-