@@ -2672,6 +2672,13 @@ if hasattr(config, 'target_link_sdk_future_version'):
2672
2672
config .substitutions .append (('%target-link-sdk-future-version' ,
2673
2673
config .target_link_sdk_future_version ))
2674
2674
2675
+ def realpath (path ):
2676
+ if not kIsWindows :
2677
+ return os .path .realpath (path )
2678
+ else :
2679
+ # For Windows, we don't expand substitute drives due to MAX_PATH limitations, matching what the llvm lit does.
2680
+ return os .path .abspath (path )
2681
+
2675
2682
run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitize SOURCE_DIR=%s --use-filecheck %s %s' % (
2676
2683
shell_quote (sys .executable ),
2677
2684
shell_quote (config .PathSanitizingFileCheck ),
@@ -2681,8 +2688,8 @@ run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitiz
2681
2688
# we provide we use realpath here. Because PathSanitizingFileCheck only
2682
2689
# understands sanitize patterns with forward slashes, and realpath normalizes
2683
2690
# the slashes, we have to replace them back to forward slashes.
2684
- shell_quote (os . path . realpath (swift_obj_root ).replace ("\\ " , "/" )),
2685
- shell_quote (os . path . realpath (config .swift_src_root ).replace ("\\ " , "/" )),
2691
+ shell_quote (realpath (swift_obj_root ).replace ("\\ " , "/" )),
2692
+ shell_quote (realpath (config .swift_src_root ).replace ("\\ " , "/" )),
2686
2693
shell_quote (config .filecheck ),
2687
2694
'--enable-windows-compatibility' if kIsWindows else '' )
2688
2695
0 commit comments