Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Cargo.toml manifests that are symlinks #6189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tmfink
Copy link
Contributor

@tmfink tmfink commented Jun 7, 2024

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

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 rust-lang#6184
@tmfink
Copy link
Contributor Author

tmfink commented Jun 7, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo fmt does not handle workspace member "Cargo.toml" being a symlink; gives error "Failed to find targets"
2 participants