Skip to content

PackageLoading: correct relative path construction #5501

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

We would construct a RelativePath without rooting it, which would then
be normalized and thus cause problems. Alter the path to validate the
path is relative and then construct the AbsolutePath by rooting the
relative path.

We would construct a `RelativePath` without rooting it, which would then
be normalized and thus cause problems.  Alter the path to validate the
path is relative and then construct the `AbsolutePath` by rooting the
relative path.
@compnerd
Copy link
Member Author

@swift-ci please smoke test

let subpath = try RelativePath(validating: value)
guard targetRoot.appending(subpath).isDescendantOfOrEqual(to: packagePath) else {
throw ModuleError.invalidHeaderSearchPath(subpath.pathString)
_ = try RelativePath(validating: value)
Copy link
Contributor

@tomerd tomerd May 13, 2022

Choose a reason for hiding this comment

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

same comment as https://github.com/apple/swift-package-manager/pull/5484/files#r870728183

this change is too subtle and likely to be reverted by future maintainers as the intuitive thing to do is to not ignore the relative path returned by the constructor. we really do need to address the underlying issue first.

@tomerd tomerd added the windows label Jun 2, 2022
@tomerd
Copy link
Contributor

tomerd commented Apr 17, 2023

@compnerd can this be closed given #5910?

@compnerd
Copy link
Member Author

Yeah, I think that we can close this PR, I checked the current PackageLoading test failures - they seem to be related to path normalisation rather than relative path construction. Thanks for the reminder!

@compnerd compnerd closed this Apr 18, 2023
@compnerd compnerd deleted the nth-root-of-unity branch April 18, 2023 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants