Closed
Description
2025-05-01T15:00:18.097Z] TSCBasic/Path.swift:969: Assertion failed
[2025-05-01T15:00:18.097Z]
[2025-05-01T15:00:18.097Z] Current stack trace:
[2025-05-01T15:00:18.097Z]
When creating an absolute path by appending a relative path the appending method is used for Windows.
/// Initializes the AbsolutePath by concatenating a relative path to an
/// existing absolute path, and renormalizing if necessary.
public init(_ absPath: AbsolutePath, _ relPath: RelativePath) {
self.init(absPath._impl.appending(relativePath: relPath._impl))
}
This in turn calls a windows API that will canonicalize the path adding the \?\ prefix for long path support
func appending(relativePath: Self) -> Self {
var result: PWSTR?
_ = self.string.withCString(encodedAs: UTF16.self) { root in
relativePath.string.withCString(encodedAs: UTF16.self) { path in
PathAllocCombine(root, path, ULONG(PATHCCH_ALLOW_LONG_PATHS.rawValue), &result)
}
}
defer { LocalFree(result) }
return Self(string: String(decodingCString: result!, as: UTF16.self))
}
The Assert compares the path to the non prefixed path and will fail.
Metadata
Metadata
Assignees
Labels
No labels