Skip to content

PackageLoading: enable the manifest VFS on Windows #6693

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

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

compnerd
Copy link
Member

Ensure that the path string is escaped when emitting the paths. The VFS paths are serialised as either JSON or YAML, both of which require the path string be escaped.

Ensure that the path string is escaped when emitting the paths. The VFS
paths are serialised as either JSON or YAML, both of which require the
path string be escaped.
@compnerd
Copy link
Member Author

@swift-ci please smoke test

@tomerd
Copy link
Contributor

tomerd commented Jul 10, 2023

this seems fine to me, although the increased usage of _nativePathString is a growing concern

@tomerd
Copy link
Contributor

tomerd commented Jul 10, 2023

@neonichu?

@compnerd
Copy link
Member Author

this seems fine to me, although the increased usage of _nativePathString is a growing concern

Would you prefer a different name and function composition? The default string representation uses / for separators which is part of the problem. We should use \ always - which then needs to be escaped. We could have path.native().escaped() if that is better (as a follow up).

@tomerd
Copy link
Contributor

tomerd commented Jul 11, 2023

not concerned about the name, concerned about the need to rely on platform specific representation

@neonichu
Copy link
Contributor

I think it's correct for this to rely on platform-specific representation, because that's what the Swift compiler expects. If we want our output to be something different, we would have to change what the compiler expects as input.

@tomerd
Copy link
Contributor

tomerd commented Jul 11, 2023

okay! lets do that

@compnerd compnerd merged commit 4d26a9a into swiftlang:main Jul 11, 2023
@compnerd compnerd deleted the escaping-trick branch July 11, 2023 14:26
@compnerd
Copy link
Member Author

It might be interesting to change the compiler to take an encoding which doesn't require escaping, but that is beyond the scope of this change. I think that we could do something like INI files for the VFS definition that could then be re-encoded to JSON or YAML as the LLVM layer doesn't accept anything but those two encodings and would require the transliteration (I'm not sure if upstream would be too happy about adding yet another file format to support) and the VFS needs to be wired up that layer. Ultimately, the strings need to be escaped and the platform specific path representation is mandatory when interacting with other tools.

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