From 25c8e336873063a818030d93f38736d5a242ee30 Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Mon, 21 Aug 2023 11:11:26 -0400 Subject: [PATCH] Use llvm's abs_path_preserve_drive --- test/lit.cfg | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/test/lit.cfg b/test/lit.cfg index 8cb040a0dc255..045db7a578bc4 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -2672,13 +2672,6 @@ if hasattr(config, 'target_link_sdk_future_version'): config.substitutions.append(('%target-link-sdk-future-version', config.target_link_sdk_future_version)) -def realpath(path): - if not kIsWindows: - return os.path.realpath(path) - else: - # For Windows, we don't expand substitute drives due to MAX_PATH limitations, matching what the llvm lit does. - return os.path.abspath(path) - run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitize SOURCE_DIR=%s --use-filecheck %s %s' % ( shell_quote(sys.executable), shell_quote(config.PathSanitizingFileCheck), @@ -2688,8 +2681,8 @@ run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitiz # we provide we use realpath here. Because PathSanitizingFileCheck only # understands sanitize patterns with forward slashes, and realpath normalizes # the slashes, we have to replace them back to forward slashes. - shell_quote(realpath(swift_obj_root).replace("\\", "/")), - shell_quote(realpath(config.swift_src_root).replace("\\", "/")), + shell_quote(lit.util.abs_path_preserve_drive(swift_obj_root).replace("\\", "/")), + shell_quote(lit.util.abs_path_preserve_drive(config.swift_src_root).replace("\\", "/")), shell_quote(config.filecheck), '--enable-windows-compatibility' if kIsWindows else '')