public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* edk2/basetools python package build is failing.
@ 2023-03-07  9:39 Jain, Vikas
  2023-03-08  7:22 ` Jain, Vikas
  0 siblings, 1 reply; 2+ messages in thread
From: Jain, Vikas @ 2023-03-07  9:39 UTC (permalink / raw)
  To: discuss@edk2.groups.io, devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]

Hi All,

I am trying to build edk2/basetools python package but it is failing with the below error, looks like there is some problem with environment setup.
Can some one please suggest a way to build it?

Repo Link: https://github.com/tianocore/edk2-basetools
Steps to build:

  1.  Run pip install -e . (you might need do this from an admin prompt in windows)
  2.  Run edk2_build to make sure it works
Error Log:

[root@master-node edk2basetools]# edk2_build
Build environment: Linux-4.18.0-408.el8.x86_64-x86_64-with-glibc2.28
Build start time: 15:08:33, Mar.07 2023



edk2_build...
: error C0DE: Unknown fatal error when processing []

(Please send email to devel@edk2.groups.io<mailto:devel@edk2.groups.io> for help, attaching following call stack trace!)

(Python 3.9.16 on linux) Traceback (most recent call last):
  File "/root/edk2-basetools/edk2-basetools/edk2basetools/build/build.py", line 2648, in Main
    CheckEnvVariable()
  File "/root/edk2-basetools/edk2-basetools/edk2basetools/build/build.py", line 127, in CheckEnvVariable
    os.environ["EDK_TOOLS_PATH"] = os.path.normcase(os.environ["EDK_TOOLS_PATH"])
  File "/usr/lib64/python3.9/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'EDK_TOOLS_PATH'


- Failed -
Build end time: 15:08:33, Mar.07 2023
Build total time: 00:00:00

[root@master-node edk2basetools]#

Thanks for looking into it.

Regards,
Vikas

[-- Attachment #2: Type: text/html, Size: 6733 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: edk2/basetools python package build is failing.
  2023-03-07  9:39 edk2/basetools python package build is failing Jain, Vikas
@ 2023-03-08  7:22 ` Jain, Vikas
  0 siblings, 0 replies; 2+ messages in thread
From: Jain, Vikas @ 2023-03-08  7:22 UTC (permalink / raw)
  To: discuss@edk2.groups.io, devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 2731 bytes --]

Hi All,

Did any one faced same issue earlier?
Can you please suggest a way to build python package for edk2 basetolls. I am working a small application which I can use to read the capsule file data using python package.
Below is the sample code which I want to use:

import efilib
import struct

def dump_hii_knobs(capsule_path):
    with open(capsule_path, 'rb') as f:
        data = f.read()

    image = efilib.FirmwareVolume(data)

    hii_handles = []
    for section in image.get_sections():
        if section.type == efilib.SECTION_GUID_DEFINED:
            if section.guid == efilib.HII_DATABASE_GUID:
                hii_handles.append(struct.unpack("<Q", section.body[:8])[0])

    for handle in hii_handles:
        hii_db = efilib.HIIDatabase(image, handle)
        print(f"Knobs for handle 0x{handle:x}:")
        for knob in hii_db.get_knobs():
            print(f"\t{knob.guid}, {knob.name}, {knob.type}, {knob.default}, {knob.current}")

if __name__ == '__main__':
    capsule_path = '/path/to/capsule.cap'
    dump_hii_knobs(capsule_path)

Regards,
Vikas



From: Jain, Vikas
Sent: Tuesday, March 7, 2023 3:10 PM
To: discuss@edk2.groups.io; devel@edk2.groups.io
Subject: edk2/basetools python package build is failing.

Hi All,

I am trying to build edk2/basetools python package but it is failing with the below error, looks like there is some problem with environment setup.
Can some one please suggest a way to build it?

Repo Link: https://github.com/tianocore/edk2-basetools
Steps to build:

  1.  Run pip install -e . (you might need do this from an admin prompt in windows)
  2.  Run edk2_build to make sure it works
Error Log:

[root@master-node edk2basetools]# edk2_build
Build environment: Linux-4.18.0-408.el8.x86_64-x86_64-with-glibc2.28
Build start time: 15:08:33, Mar.07 2023



edk2_build...
: error C0DE: Unknown fatal error when processing []

(Please send email to devel@edk2.groups.io<mailto:devel@edk2.groups.io> for help, attaching following call stack trace!)

(Python 3.9.16 on linux) Traceback (most recent call last):
  File "/root/edk2-basetools/edk2-basetools/edk2basetools/build/build.py", line 2648, in Main
    CheckEnvVariable()
  File "/root/edk2-basetools/edk2-basetools/edk2basetools/build/build.py", line 127, in CheckEnvVariable
    os.environ["EDK_TOOLS_PATH"] = os.path.normcase(os.environ["EDK_TOOLS_PATH"])
  File "/usr/lib64/python3.9/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'EDK_TOOLS_PATH'


- Failed -
Build end time: 15:08:33, Mar.07 2023
Build total time: 00:00:00

[root@master-node edk2basetools]#

Thanks for looking into it.

Regards,
Vikas

[-- Attachment #2: Type: text/html, Size: 11082 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-08  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-07  9:39 edk2/basetools python package build is failing Jain, Vikas
2023-03-08  7:22 ` Jain, Vikas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox