File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Sources/_InternalTestSupport Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,15 @@ public func testWithTemporaryDirectory<Result>(
9797 . replacing ( " ) " , with: " " )
9898 . replacing ( " . " , with: " " )
9999 . replacing ( " : " , with: " _ " )
100- return try await withTemporaryDirectory ( prefix: " spm-tests- \( cleanedFunction) " ) { tmpDirPath in
100+
101+ // Use shorter prefix on Windows to avoid MAX_PATH issues
102+ #if os(Windows)
103+ let prefix = " spm- \( abs ( cleanedFunction. hashValue) ) "
104+ #else
105+ let prefix = " spm-tests- \( cleanedFunction) "
106+ #endif
107+
108+ return try await withTemporaryDirectory ( prefix: prefix) { tmpDirPath in
101109 defer {
102110 // Unblock and remove the tmp dir on deinit.
103111 try ? localFileSystem. chmod ( . userWritable, path: tmpDirPath, options: [ . recursive] )
You can’t perform that action at this time.
0 commit comments