Skip to content

Frontend: use preferred path spellings for paths #81103

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

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

Conversation

compnerd
Copy link
Member

Convert paths to the preferred spelling before passing it to the SourceManager to ensure that we have the canonical spelling. This is important as a path with a non-canonical path separator would otherwise fail to be looked up in the source manager buffer.

Convert paths to the preferred spelling before passing it to the
SourceManager to ensure that we have the canonical spelling. This is
important as a path with a non-canonical path separator would otherwise
fail to be looked up in the source manager buffer.
@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd
Copy link
Member Author

@swift-ci please smoke test macOS platform

@compnerd
Copy link
Member Author

CC: @j-hui

Copy link
Contributor

@j-hui j-hui left a comment

Choose a reason for hiding this comment

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

Thanks for getting around to this. I think this is the right thing to do here (and avoids the lifetime issues I encountered in #80564).

However, I'm not convinced that this will close #81012 just yet because it only canonicalizes the path separators from -verify-additional-file. My logging showed that the paths from -verify-additional-file and from the capture error both have inconsistent path separators:

# .---command stderr------------
# | Got additional file: [[42]]::C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\foreign-reference/Inputs/inheritance.h
# | Captured error in [[2]]::C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\foreign-reference/Inputs\inheritance.h: 125
…

So, this patch should fix the problem for bufID [[42]] here, but not bufID [[2]].

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