Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edk2_stuart_pr_eval: Improve robustness of path comparisons #346

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion edk2toolext/invocables/edk2_pr_eval.py
Expand Up @@ -17,6 +17,7 @@
import os
import logging
from io import StringIO
from pathlib import Path
from edk2toolext import edk2_logging
from edk2toolext.invocables.edk2_multipkg_aware_invocable import Edk2MultiPkgAwareInvocable
from edk2toolext.invocables.edk2_multipkg_aware_invocable import MultiPkgAwareSettingsInterface
Expand Down Expand Up @@ -267,6 +268,7 @@ def get_packages_to_build(self, possible_packages: list) -> dict:

# files are all the files changed edk2 workspace root relative path
changed_modules = self._get_unique_module_infs_changed(files)
changed_modules = [Path(m) for m in changed_modules]

# now check DSC
dsc = DscParser()
Expand All @@ -277,6 +279,7 @@ def get_packages_to_build(self, possible_packages: list) -> dict:
dsc.SetInputVars(PlatformDscInfo[1])
dsc.ParseFile(PlatformDscInfo[0])
allinfs = dsc.OtherMods + dsc.ThreeMods + dsc.SixMods + dsc.Libs # get list of all INF files
allinfs = [Path(i) for i in allinfs]

#
# Note: for now we assume that remaining_packages has only 1 package and that it corresponds
Expand All @@ -285,7 +288,7 @@ def get_packages_to_build(self, possible_packages: list) -> dict:
for p in remaining_packages[:]: # slice so we can delete as we go
for cm in changed_modules:
if cm in allinfs: # is the changed module listed in the DSC file?
packages_to_build[p] = f"Policy 4 - Package Dsc depends on {cm}"
packages_to_build[p] = f"Policy 4 - Package Dsc depends on {str(cm)}"
remaining_packages.remove(p) # remove from remaining packages
break

Expand Down