Skip to content

Add -scanner-prefix-map-paths option and fix multiArg option parsing #1949

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

sina-mahdavi
Copy link

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.
This also fixes the parsing of .multiArg options in OptionParsing.swift so that their corresponding arguments are not added to the general inputs list and are attached to their option correctly.

Corresponding PR on Swift: swiftlang/swift#82745

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.

Thanks for handling this.

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.

Test looks good. Some more comments.

@sina-mahdavi sina-mahdavi force-pushed the sina-mahdavi/new-scanner-prefix-map-option branch from 7236a5a to bdbdd6b Compare July 9, 2025 20:32
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.

LGTM with one small comment.

We can't merge this till landing the swift compiler change.

@cachemeifyoucan
Copy link
Contributor

@swift-ci please test

@sina-mahdavi
Copy link
Author

LGTM with one small comment.

We can't merge this till landing the swift compiler change.

Thank you! Also, should I squash my commits into one before merging?

@sina-mahdavi
Copy link
Author

@swift-ci please test

@cachemeifyoucan
Copy link
Contributor

Thank you! Also, should I squash my commits into one before merging?

Yes. Please never push individual review feedback fixes to any repositories. You can either use squash and merge or manually update the PR with a merged commit.

@sina-mahdavi sina-mahdavi force-pushed the sina-mahdavi/new-scanner-prefix-map-option branch from c5b2bea to 0876a15 Compare July 10, 2025 21:57
@sina-mahdavi
Copy link
Author

@swift-ci please test

@sina-mahdavi
Copy link
Author

@swift-ci please test Windows platform

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