Skip to content

Allow a build system to use standardized paths while indexstore-db return realpaths #2033

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
Mar 5, 2025

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Mar 4, 2025

On Darwin platforms, this fixes the following problem: indexstore-db by itself returns realpaths but the build system might be using standardized Darwin paths (eg. realpath is /private/tmp but the standardized path is /tmp). Because of this, when inferring the main file for a file, we might get a URI that the build system doesn’t know about. To fix this, if the realpath that indexstore-db returns could not be found in the build system's source files but the standardized path is part of the source files, use the standardized path instead.

…turn realpaths

On Darwin platforms, this fixes the following problem: indexstore-db by itself returns realpaths but the build system might be using standardized Darwin paths (eg. realpath is `/private/tmp` but the standardized path is `/tmp`). Because of this, when inferring the main file for a file, we might get a URI that the build system doesn’t know about. To fix this, if the realpath that indexstore-db returns could not be found in the build system's source files but the standardized path is part of the source files, use the standardized path instead.
@ahoppen ahoppen requested review from bnbarham and hamishknight March 4, 2025 05:16
@ahoppen
Copy link
Member Author

ahoppen commented Mar 4, 2025

@swift-ci Please test

@ahoppen ahoppen merged commit d696a94 into swiftlang:main Mar 5, 2025
3 checks passed
@ahoppen ahoppen deleted the standardized-file-paths branch March 5, 2025 00:34
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.

2 participants