Skip to content

Basic: use .standardizingPath instead of realpath #2288

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

Closed
wants to merge 1 commit into from

Conversation

compnerd
Copy link
Member

This Foundation extension provides the same behaviour but is portable
across different platforms.

@compnerd
Copy link
Member Author

@swift-ci please smoke test

This Foundation extension provides the same behaviour but is portable
across different platforms.
@compnerd
Copy link
Member Author

@swift-ci please smoke test

}

return path
return AbsolutePath(path.pathString.resolvingSymlinksInPath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand and support the motivation here, but I have some concerns about performance. For example, I think that the swift-corelibs-foundation implementation implements this by creating multiple URLs and breaking it into components. Would it be possible to conditionally keep the optimized implementation and use the more generic one only for platforms that don't support realpath()?

We should of course measure to see whether there's really a difference, but shouldn't make this change unless we know it doesn't slow down the current platforms.

Copy link
Contributor

@karwa karwa Sep 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a curious onlooker here, but the Foundation API does exactly what this one is supposed to do, and if there are more optimal ways to get the result, that should be a Foundation-level optimisation which would benefit everybody, right?

@compnerd
Copy link
Member Author

Obsoleted by swiftlang/swift-tools-support-core#114

@compnerd compnerd closed this Aug 20, 2020
@compnerd compnerd deleted the a-new-standard branch August 20, 2020 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants