Skip to content

Commit 6f60ca6

Browse files
authored
Resolve poetry failure on a secondary repo (#1132)
## Description This change intends to setup poetry environments for the TFA build process. - [ ] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? ## How This Was Tested This change is tested locally. ## Integration Instructions N/A
1 parent 7ea80f7 commit 6f60ca6

File tree

9 files changed

+41
-38
lines changed

9 files changed

+41
-38
lines changed

.azurepipelines/Platform-Build-GCC5.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ jobs:
3636
BuildTarget: "DEBUG"
3737
BuildExtraTag: ""
3838
BuildExtraStep:
39-
- script: sudo apt-get install -y libssl-dev clang llvm lld device-tree-compiler
39+
- script: |
40+
sudo apt-get update -qq
41+
sudo apt-get install -y libssl-dev clang llvm lld device-tree-compiler
4042
displayName: Install openssl
4143
- template: Steps/RustSetupSteps.yml@mu_devops
42-
Run: false
44+
Run: true
4345
RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE"
4446
BuildArtifactsBinary: |
4547
**/QEMU_EFI.fd
@@ -53,10 +55,12 @@ jobs:
5355
BuildTarget: "RELEASE"
5456
BuildExtraTag: ""
5557
BuildExtraStep:
56-
- script: sudo apt-get install -y libssl-dev clang llvm lld device-tree-compiler
58+
- script: |
59+
sudo apt-get update -qq
60+
sudo apt-get install -y libssl-dev clang llvm lld device-tree-compiler
5761
displayName: Install openssl
5862
- template: Steps/RustSetupSteps.yml@mu_devops
59-
Run: false
63+
Run: true
6064
RunFlags: "SHUTDOWN_AFTER_RUN=TRUE QEMU_HEADLESS=TRUE EMPTY_DRIVE=TRUE TEST_REGEX=*TestApp*.efi RUN_TESTS=TRUE"
6165
BuildArtifactsBinary: |
6266
**/QEMU_EFI.fd

.azurepipelines/Platform-Build-Job.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ jobs:
6666

6767
variables:
6868
- name: Run
69+
${{ if EndsWith(item.Key, 'CODE_COVERAGE') }}:
70+
value: false
71+
${{ elseif or(eq(item.Value.Run, true), eq(parameters.os_type, 'Linux')) }}:
72+
value: true
73+
${{ else }}:
6974
value: false
7075

7176
${{ if and(ne(parameters.container_image, ''), ne(item.Value.SelfHostAgent, true)) }}:
@@ -168,6 +173,14 @@ jobs:
168173
itemPattern: '**/*.efi'
169174
targetPath: 'Build/${{ item.Value.BuildPackage }}/${{ item.Value.BuildTarget }}_$(tool_chain_tag)/X64/'
170175

176+
# Run
177+
- task: CmdLine@2
178+
displayName: Run to Shell
179+
inputs:
180+
script: stuart_build -c ${{ item.Value.BuildFile }} TOOL_CHAIN_TAG=$(tool_chain_tag) TARGET=${{ item.Value.BuildTarget }} ${{ item.Value.BuildFlags }} ${{ item.Value.RunFlags }} --FlashOnly
181+
condition: and(gt(variables.pkg_count, 0), succeeded())
182+
timeoutInMinutes: ${{ parameters.run_timeout }}
183+
171184
# Copy build logs to the artifact staging directory
172185
- template: Steps/CommonLogCopyAndPublish.yml@mu_devops
173186
parameters:

.azurepipelines/Ubuntu-GCC5.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ extends:
2828
do_pr_eval: true
2929
container_build: true
3030
os_type: Linux
31-
rust_build: true
3231
extra_cargo_steps:
3332
- script: pip install -r pip-requirements.txt --upgrade
3433
displayName: Install and Upgrade pip Modules

.azurepipelines/Windows-VS.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ extends:
2727
do_non_ci_setup: true
2828
do_pr_eval: true
2929
os_type: Windows_NT
30-
rust_build: true
3130
extra_cargo_steps:
3231
- script: pip install -r pip-requirements.txt --upgrade
3332
displayName: Install and Upgrade pip Modules

.pytool/CISettings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def SetTargets(self, list_of_requested_target):
108108

109109
def GetActiveScopes(self):
110110
''' return tuple containing scopes that should be active for this process '''
111-
scopes = ("cibuild", "edk2-build", "host-based-test", "rust-ci")
111+
scopes = ("cibuild", "edk2-build", "host-based-test")
112112

113113
self.ActualToolChainTag = shell_environment.GetBuildVars().GetValue("TOOL_CHAIN_TAG", "")
114114

Platforms/QemuSbsaPkg/PlatformBuild.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class CommonPlatform():
4646
PackagesSupported = ("QemuSbsaPkg",)
4747
ArchSupported = ("AARCH64",)
4848
TargetsSupported = ("DEBUG", "RELEASE", "NOOPT")
49-
Scopes = ('qemu', 'qemusbsa', 'edk2-build', 'cibuild', 'configdata', 'rust-ci')
49+
Scopes = ('qemu', 'qemusbsa', 'edk2-build', 'cibuild', 'configdata')
5050
WorkspaceRoot = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
5151
PackagesPath = (
5252
"Platforms",
@@ -98,6 +98,7 @@ def GetRequiredSubmodules(self):
9898
RequiredSubmodule("Features/DEBUGGER", True),
9999
RequiredSubmodule("Features/DFCI", True),
100100
RequiredSubmodule("Features/CONFIG", True),
101+
RequiredSubmodule("Features/FFA", True),
101102
]
102103

103104
def SetArchitectures(self, list_of_requested_architectures):
@@ -321,9 +322,6 @@ def SetPlatformEnvAfterTarget(self):
321322

322323
return 0
323324

324-
def PlatformPreBuild(self):
325-
return 0
326-
327325
#
328326
# Copy a file into the designated region of target FD.
329327
#
@@ -433,17 +431,6 @@ def PlatformPostBuild(self):
433431
logging.error("Virtual environment not found")
434432
return -1
435433

436-
outstream = StringIO()
437-
# If we are not in a virtual environment, we can build the firmware directly.
438-
ret = RunCmd("poetry", "env list --full-path", workingdir=self.env.GetValue("ARM_TFA_PATH"), outstream=outstream, environ=cached_enivron)
439-
if ret != 0:
440-
return ret
441-
442-
# Grab the last line, which is the virtual environment path.
443-
logging.info(f"Virtual environment path: {outstream.getvalue().strip().split('\n')}")
444-
virt_path = outstream.getvalue().strip().split('\n')[-1]
445-
virt_cmd = "source " + virt_path + "/bin/activate"
446-
447434
# Second, put together the command to build the firmware.
448435
cmd = "make"
449436
if self.env.GetValue("TOOL_CHAIN_TAG") == "CLANGPDB":
@@ -468,13 +455,11 @@ def PlatformPostBuild(self):
468455
temp_bash = os.path.join(self.env.GetValue("BUILD_OUTPUT_BASE"), "temp.sh")
469456
with open(temp_bash, "w") as f:
470457
f.write("#!/bin/bash\n")
471-
f.write(f"{virt_cmd}\n")
458+
f.write("poetry --verbose install\n")
459+
f.write("poetry env activate\n")
460+
f.write("poetry show\n")
461+
f.write("pip3 install fdt\n") # why is this still needed?
472462
f.write(f"{cmd} {args}\n")
473-
if virtual_env != "":
474-
# If we were in a virtual environment, we need to reactivate it after the build.
475-
f.write(f"source {virtual_env}\n")
476-
else:
477-
f.write("deactivate\n")
478463

479464
# Fifth, run the temp bash file to build the firmware.
480465
ret = RunCmd("bash", temp_bash, workingdir=self.env.GetValue("ARM_TFA_PATH"), environ=cached_enivron)

Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@
497497
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
498498
HobPrintLib|MdeModulePkg/Library/HobPrintLib/HobPrintLib.inf
499499
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
500+
TimerLib|FfaFeaturePkg/Library/ArmArchTimerLibEx/ArmArchTimerLibEx.inf
500501

501502
ArmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
502503
StandaloneMmCoreEntryPoint|ArmPkg/Library/ArmStandaloneMmCoreEntryPoint/ArmStandaloneMmCoreEntryPoint.inf
@@ -515,7 +516,7 @@
515516
RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
516517
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
517518
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
518-
TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
519+
TimerLib|FfaFeaturePkg/Library/ArmArchTimerLibEx/ArmArchTimerLibEx.inf
519520
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
520521
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
521522

@@ -1140,7 +1141,7 @@
11401141
MsWheaPkg/MsWheaReport/Dxe/MsWheaReportDxe.inf
11411142
MsCorePkg/MuVarPolicyFoundationDxe/MuVarPolicyFoundationDxe.inf
11421143
MsCorePkg/AcpiRGRT/AcpiRgrt.inf
1143-
MsCorePkg/HelloWorldRustDxe/HelloWorldRustDxe.inf
1144+
# MsCorePkg/HelloWorldRustDxe/HelloWorldRustDxe.inf
11441145

11451146
MsGraphicsPkg/PrintScreenLogger/PrintScreenLogger.inf
11461147
SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf
@@ -1241,7 +1242,7 @@
12411242
#
12421243
# HID Support
12431244
#
1244-
HidPkg/UefiHidDxe/UefiHidDxe.inf
1245+
# HidPkg/UefiHidDxe/UefiHidDxe.inf
12451246

12461247
#
12471248
# USB Support
@@ -1252,10 +1253,10 @@
12521253
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
12531254
MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
12541255
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
1255-
HidPkg/UsbHidDxe/UsbHidDxe.inf {
1256-
<LibraryClasses>
1257-
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
1258-
}
1256+
# HidPkg/UsbHidDxe/UsbHidDxe.inf {
1257+
# <LibraryClasses>
1258+
# UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
1259+
# }
12591260

12601261
#
12611262
# TPM2 support

Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,12 @@ READ_LOCK_STATUS = TRUE
411411
INF MsWheaPkg/MsWheaReport/Dxe/MsWheaReportDxe.inf
412412
INF MsCorePkg/MuVarPolicyFoundationDxe/MuVarPolicyFoundationDxe.inf
413413
INF MsCorePkg/LoadOptionVariablePolicyDxe/LoadOptionVariablePolicyDxe.inf
414-
INF HidPkg/UsbHidDxe/UsbHidDxe.inf
415-
INF HidPkg/UefiHidDxe/UefiHidDxe.inf
414+
# INF HidPkg/UsbHidDxe/UsbHidDxe.inf
415+
# INF HidPkg/UefiHidDxe/UefiHidDxe.inf
416416
INF MsGraphicsPkg/PrintScreenLogger/PrintScreenLogger.inf
417417
INF MsCorePkg/AcpiRGRT/AcpiRgrt.inf
418418
INF SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf
419-
INF MsCorePkg/HelloWorldRustDxe/HelloWorldRustDxe.inf
419+
# INF MsCorePkg/HelloWorldRustDxe/HelloWorldRustDxe.inf
420420
INF AdvLoggerPkg/Application/AdvancedLogDumper/AdvancedLogDumper.inf
421421

422422
#

pip-requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ xmlschema==3.4.2
1818
regex==2024.9.11
1919
pygount==1.8.0
2020
pywin32==306; sys_platform == 'win32'
21+
setuptools
22+
poetry

0 commit comments

Comments
 (0)