Skip to content

Commit edef3d6

Browse files
authored
Merge pull request #34271 from drodriguez/windows-long-tmp-path
[windows] Provide %long-tmp in Windows for extended length temp paths.
2 parents c9115dc + b047f9e commit edef3d6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

test/Misc/stats_dir_profiler.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
// RUN: %empty-directory(%t/stats-entities)
44
// RUN: %target-swiftc_driver -o %t/main -module-name main -stats-output-dir %t/stats-events %s -profile-stats-events
55
// RUN: %target-swiftc_driver -o %t/main -module-name main -stats-output-dir %t/stats-entities %s -profile-stats-entities
6-
// RUN: %FileCheck -check-prefix=EVENTS -input-file %t/stats-events/*.dir/Time.User.events %s
7-
// RUN: %FileCheck -check-prefix=ENTITIES -input-file %t/stats-entities/*.dir/Time.User.entities %s
6+
7+
// Need to use %long-tmp because in Windows the * may expand to a path longer
8+
// than 260 characters.
9+
// RUN: %FileCheck -check-prefix=EVENTS -input-file %long-tmp/stats-events/*.dir/Time.User.events %s
10+
// RUN: %FileCheck -check-prefix=ENTITIES -input-file %long-tmp/stats-entities/*.dir/Time.User.entities %s
811

912
// EVENTS: {{perform-sema;.*;typecheck-decl.* [0-9]+}}
1013
// ENTITIES: {{perform-sema;.*;TypeCheckFunctionBodyRequest bar\(\);typecheck-stmt.* [0-9]+}}

test/lit.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,8 +2074,12 @@ config.substitutions.append(('%add_num_extra_inhabitants', add_num_extra_inhabit
20742074

20752075
if kIsWindows:
20762076
config.substitutions.append( ('%diff', 'diff --strip-trailing-cr') )
2077+
# Use instead of %t when the possible temporal path (and suffix) might end
2078+
# up being longer than 260 characters in Windows machines.
2079+
config.substitutions.append( ('%long-tmp', '\\\\?\\%t') )
20772080
else:
20782081
config.substitutions.append( ('%diff', 'diff') )
2082+
config.substitutions.append( ('%long-tmp', '%t') )
20792083

20802084
visual_studio_version = os.environ.get('VisualStudioVersion')
20812085
if kIsWindows and visual_studio_version:

0 commit comments

Comments
 (0)