Skip to content

Support VirtualPaths in ToolChain #77

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

Conversation

cltnschlosser
Copy link
Contributor

Fixes:
Swift(macosx-x86_64) :: Driver/driver-use-frontend.swift
Swift(macosx-x86_64) :: Driver/linker-rpath.swift

This should go in after #73 since it copies some extensions from there.

Copy link
Contributor

@zienag zienag left a comment

Choose a reason for hiding this comment

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

Looks good!

Btw, I think it looks more and more obvious that VirtualPath is not a silver bullet for all path operations. Most of operations with them are correct only for absolute or relative path, I wonder if it can be made more robust, but introducing another layer like VirtualPath.filesystemPath(.absolute(foobar)) is also not looking good. It is probably worth looking at use cases of stdin/out and temporary to see if there is some good way.
Also, it's a bit unfortunate that TCSBasic doesn't have ways to do operations with relative paths without resolving it to absolute path beforehand :(

@cltnschlosser
Copy link
Contributor Author

Looks good!

Btw, I think it looks more and more obvious that VirtualPath is not a silver bullet for all path operations. Most of operations with them are correct only for absolute or relative path, I wonder if it can be made more robust, but introducing another layer like VirtualPath.filesystemPath(.absolute(foobar)) is also not looking good. It is probably worth looking at use cases of stdin/out and temporary to see if there is some good way.
Also, it's a bit unfortunate that TCSBasic doesn't have ways to do operations with relative paths without resolving it to absolute path beforehand :(

Going to take a look at stdin, stdout, and temporary usages. Maybe we introduce another type for the ToolChain that only has Absolute and Relative paths.

case .standardInput, .standardOutput:
preconditionFailure("standardInput and standardOutput do not have a pathString")
case .temporary(let path):
return path.pathString
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This probably isn't correct. Given that this relative path doesn't contain the temporary directory.

@cltnschlosser
Copy link
Contributor Author

@zienag Curious about your thoughts on #83

@shahmishal shahmishal closed this Oct 5, 2020
@shahmishal
Copy link
Member

The Swift project moved the default branch to main and deleted master branch, so GitHub automatically closed the PR. Please re-create pull request with main branch.

More detail about the branch update - https://forums.swift.org/t/updating-branch-names/40412

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