From 179ab08237d10fa816389b395f2b6bd5325db3ef Mon Sep 17 00:00:00 2001 From: lihao <1453238523@qq.com> Date: Tue, 24 Jun 2025 00:33:24 +0800 Subject: [PATCH] cherry pick 0603 Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICH92U Signed-off-by: lihao Change-Id: Ic883b20718a4024206b67bee518d79e1da37718f --- ets2panda/driver/build_system/src/build/base_mode.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ets2panda/driver/build_system/src/build/base_mode.ts b/ets2panda/driver/build_system/src/build/base_mode.ts index c5282cded0..5862c017b1 100644 --- a/ets2panda/driver/build_system/src/build/base_mode.ts +++ b/ets2panda/driver/build_system/src/build/base_mode.ts @@ -558,7 +558,8 @@ export abstract class BaseMode { } this.entryFiles.forEach((file: string) => { for (const [packageName, moduleInfo] of this.moduleInfos) { - if (!file.startsWith(moduleInfo.moduleRootPath)) { + const relativePath = path.relative(moduleInfo.moduleRootPath, file); + if (relativePath.startsWith('..') || path.isAbsolute(relativePath)) { continue; } let filePathFromModuleRoot: string = path.relative(moduleInfo.moduleRootPath, file); -- Gitee