Add the error handling to cover the case that current_dir is not exist. Cc: Liming Gao <liming....@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong....@intel.com> --- BaseTools/Source/Python/AutoGen/GenMake.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 882a635..cd6944e 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -602,10 +602,12 @@ cleanlib: current_dir = self.Macros["WORKSPACE"] found = False while not found and os.sep in package_rel_dir: index = package_rel_dir.index(os.sep) current_dir = mws.join(current_dir, package_rel_dir[:index]) + if not os.path.exists(current_dir): + EdkLogger.error("build", AUTOGEN_ERROR, "Package directory %s is not exist" %current_dir, ExtraData="[%s]" % str(self._AutoGenObject.MetaFile)) for fl in os.listdir(current_dir): if fl.endswith('.dec'): found = True break package_rel_dir = package_rel_dir[index + 1:] -- 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel