Skip to content

Commit 4880ab4

Browse files
committed
Swift: use weakly_canonical instead of canonical
`weakly_canonical` will resolve as much as possible in the path, and not return an error if it can't resolve everything (for example due to a non existant file). In any case in case of problems with the file we will see an error when actually using the resolved path. This tunes down some unhelpful log messages.
1 parent a74247e commit 4880ab4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

swift/extractor/infra/file/Path.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ std::filesystem::path resolvePath(const std::filesystem::path& path) {
2121
std::filesystem::path ret = {};
2222
static const auto canonicalize = shouldCanonicalize();
2323
if (canonicalize) {
24-
ret = std::filesystem::canonical(path, ec);
24+
ret = std::filesystem::weakly_canonical(path, ec);
2525
} else {
2626
ret = std::filesystem::absolute(path, ec);
2727
}

0 commit comments

Comments
 (0)