Skip to content

Add -scanner-prefix-map-paths to the frontend #82745

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 2 commits into
base: main
Choose a base branch
from

Conversation

sina-mahdavi
Copy link
Contributor

@sina-mahdavi sina-mahdavi commented Jul 2, 2025

The current command-line option for specifying prefix mappings for the dependency scanner does not handle paths containing equal signs. This PR adds a new option -scanner-prefix-map-paths that has a multiArg format instead of being =-separated and fixes this issue. The old -scanner-prefix-map option is still preserved, but is made driver-only and gets translated to the new option format by the driver.

Corresponding PR on Swift-Driver: swiftlang/swift-driver#1949

Copy link
Contributor

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

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

Changes LGTM. I will expect test fixes and new tests to test the option.

@sina-mahdavi sina-mahdavi force-pushed the sina-mahdavi/new-scanner-prefix-map-option branch from a831621 to c5bbdbd Compare July 10, 2025 22:26
@sina-mahdavi
Copy link
Contributor Author

Changes LGTM. I will expect test fixes and new tests to test the option.

Do you have anything in mind that I need to write new tests for except modifying the old tests to use the new option instead? I made the old option driver-only and changed all of the old tests using it to use the new format so I think those should already be covering all of the code that has been modified.

Copy link
Contributor

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

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

I think the test should be fine now and the change LGTM.

@@ -288,6 +288,7 @@ def main():
"-scanner-prefix-map",
"-scanner-prefix-map-sdk",
"-scanner-prefix-map-toolchain",
"-scanner-prefix-map-paths",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't use this script at all but it seems this script doesn't accept multi arg option at all. I don't know if you want to fix this script in the same commit or just leave this out and do the fix in a follow up.

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