rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Handle Cargo.toml manifests that are symlinks

Open tmfink opened this issue 1 year ago • 1 comments

The canonicalize() function resolves symlinks, which would cause targets whose "Cargo.toml" is a symlink to be filtered out. This would cause cargo-fmt to print an error "Failed to find targets".

Resolves #6184

tmfink avatar Jun 07 '24 07:06 tmfink

To keep the logic more tolerant, I added an extra comparison of file paths without a call to canonicalize() and left the original canonicalize() comparison, but is the canonicalize() ever actually needed?

Do some platforms/OS/filesystems require canonicalize()? Perhaps Windows paths with backslashes?

tmfink avatar Jun 07 '24 07:06 tmfink