Skip to content

Commit de423df

Browse files
committed
Does this work?
1 parent 70d46da commit de423df

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Platforms/QemuSbsaPkg/PlatformBuild.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,27 @@ def SetPlatformEnvAfterTarget(self):
321321
return 0
322322

323323
def PlatformPreBuild(self):
324+
need_setup = False
325+
# Check to see if the poetry for TFA is setup, if not, do it.
326+
outstream = StringIO()
327+
328+
# If we are not in a virtual environment, we can build the firmware directly.
329+
ret = RunCmd("poetry", "env list --full-path", workingdir=self.env.GetValue("ARM_TFA_PATH"), outstream=outstream, environ=cached_enivron)
330+
if ret != 0:
331+
# it is not setup
332+
need_setup = True
333+
elif outstream.getvalue() == "":
334+
# it is not setup
335+
need_setup = True
336+
337+
need_setup = True
338+
339+
if need_setup:
340+
# okay, need to install it
341+
ret = RunCmd("poetry", "--verbose install", workingdir=self.env.GetValue("ARM_TFA_PATH"), environ=cached_enivron)
342+
if ret != 0:
343+
return ret
344+
324345
return 0
325346

326347
#

0 commit comments

Comments
 (0)