From cfd73e0065f523e1d56bb32b5c9d48e162c903f8 Mon Sep 17 00:00:00 2001 From: Bob Feng Date: Mon, 1 Jun 2020 14:40:10 +0800 Subject: [PATCH] BaseTools: Warn user the file not found issue instead of break build. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2770 The Trim.py would break the build process when the file not found issue occures, however sometimes we do not care about this issue. This patch changes the error with warning in order to solve this kind of break. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen Reviewed-by: Bob Feng --- BaseTools/Source/Python/Trim/Trim.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python/Trim/Trim.py index c5638376e4..776474b203 100644 --- a/BaseTools/Source/Python/Trim/Trim.py +++ b/BaseTools/Source/Python/Trim/Trim.py @@ -281,9 +281,11 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None, Inclu F = File.readlines() break else: - EdkLogger.error("Trim", "Failed to find include file %s" % Source) + EdkLogger.warn("Trim", "Failed to find include file %s" % Source) + return [] except: - EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source) + EdkLogger.warn("Trim", FILE_OPEN_FAILURE, ExtraData=Source) + return [] # avoid A "include" B and B "include" A -- 2.39.2