public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jayaprakash, N" <n.jayaprakash@intel.com>
To: devel@edk2.groups.io
Cc: Jayaprakash N <n.jayaprakash@intel.com>,
	Rebecca Cran <rebecca@bsdio.com>,
	Michael D Kinney <michael.d.kinney@intel.com>
Subject: [edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc : add github actions workflow to build PyUEFI using gcc
Date: Mon,  1 Jul 2024 21:40:46 +0530	[thread overview]
Message-ID: <20240701161327.2168-2-n.jayaprakash@intel.com> (raw)
In-Reply-To: <20240701161327.2168-1-n.jayaprakash@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4794

This commit adds github actions workflow to build python uefi
interpreter with gcc tool chain on Ubuntu Linux system.
The build-python-uefi-gcc.yaml file under .github/workflows
implements the build action for building the pyuefi interpreter with
gcc tool chain.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jayaprakash N <n.jayaprakash@intel.com>
Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
---
 .github/workflows/build-python-uefi-gcc.yaml  | 69 +++++++++++++++++++
 .../Python/Python-3.6.8/create_python_pkg.sh  | 40 +++++------
 2 files changed, 89 insertions(+), 20 deletions(-)
 create mode 100644 .github/workflows/build-python-uefi-gcc.yaml

diff --git a/.github/workflows/build-python-uefi-gcc.yaml b/.github/workflows/build-python-uefi-gcc.yaml
new file mode 100644
index 0000000..f25fb02
--- /dev/null
+++ b/.github/workflows/build-python-uefi-gcc.yaml
@@ -0,0 +1,69 @@
+# GitHub actions workflow to build python uefi using gcc
+#
+# Copyright (c) 2023-2024, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+name: Build Python Interpreter for UEFI with GCC
+
+on: [push, pull_request]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout@v4
+
+    - name: Setup Python
+      uses: actions/setup-python@v5
+      with:
+        python-version: '3.x'
+
+    - name: Install dependencies
+      run: |
+        sudo apt-get update
+        sudo apt-get install -y build-essential uuid-dev iasl git nasm python3-distutils
+
+    - name: Clone EDK2
+      run: |
+        git clone https://github.com/tianocore/edk2.git
+        cd edk2
+        git submodule update --init
+
+    - name: Build EDK2 Base Tools
+      run: |
+        cd edk2
+        . edksetup.sh
+        make -C BaseTools
+
+    - name: Run srcprep.py
+      run: |
+        cd AppPkg/Applications/Python/Python-3.6.8/
+        python3 srcprep.py
+
+    - name: Build Python UEFI
+      run: |
+        export PACKAGES_PATH=`pwd`/edk2:`pwd`:
+        export EDK2_LIBC_PATH=`pwd`
+        cd edk2
+        . edksetup.sh
+        build -t GCC5 -a X64 -b RELEASE -p $EDK2_LIBC_PATH/AppPkg/AppPkg.dsc -D BUILD_PYTHON368
+
+    - name: Create PyUEFI package
+      run: |
+        export WORKSPACE=`pwd`/edk2
+        echo WORKSPACE is $WORKSPACE
+        export EDK2_LIBC_PATH=`pwd`
+        . AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh GCC5 RELEASE X64 myUEFIPy
+
+    - name: List build artifacts
+      run: |
+        ls -R edk2/myUEFIPy
+
+    - name: Upload build output as artifact
+      uses: actions/upload-artifact@v4
+      with:
+        name: myUEFIPy-build-gcc-output
+        path: edk2/myUEFIPy/**/*
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 c10ba03..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,24 +59,24 @@ then
    exit
 fi
 
-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
-
+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
@@ -103,8 +103,8 @@ then
     mkdir -p $OUT_FOLDER/EFI/StdLib/etc
 fi
 
-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/
+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 (#119743): https://edk2.groups.io/g/devel/message/119743
Mute This Topic: https://groups.io/mt/106982478/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-07-01 16:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 16:10 [edk2-devel] [edk2-libc Patch v2 0/1] add github actions workflow to build PyUEFI using gcc Jayaprakash, N
2024-07-01 16:10 ` Jayaprakash, N [this message]
2024-07-01 17:28 ` Michael D Kinney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240701161327.2168-2-n.jayaprakash@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox