Skip to content
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

Recover functionality of passing down unrecognized frontend-only options #1290

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

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Feb 15, 2023

Once '-e' got introduced, we started failing to detect when the driver was specified a frontend-only option and passing it down to the frontend, if such frontend-only option started with '-e...'. This is because we do a prefix match on the options trie and treat an unrecognized suffix as the argument to it, and later detect whether or not such an option is recognized.

We can restore the functionality for flags that the driver is aware of as being frontend-only flags, by not skipping such flags when constructing the trie and detecting them explicitly (.noDriver) and processing them as any other unknown flag to be checked whether or not it can be passed down to the frontend.

And reword the diagnostic a bit to indicate to the user that -Xfrontend can get rid of the warning.

Once '-e' got introduced, we started failing to detect when the driver was specified a frontend-only option and passing it down to the frontend, if such frontend-only option started with '-e...'. This is because we do a prefix match on the options trie and treat an unrecognized suffix as the argument to it, and later detect whether or not such an option is recognized.

We can restore the functionality for flags that the driver is aware of as being frontend-only flags, by not skipping such flags when constructing the trie and detecting them explicitly (`.noDriver`) and processing them as any other unknown flag to be checked whether or not it can be passed down to the frontend.

And reword the diagnostic a bit to indicate to the user that `-Xfrontend` can get rid of the warning.
@artemcm
Copy link
Contributor Author

artemcm commented Feb 15, 2023

@swift-ci test

@artemcm artemcm requested a review from owenv February 20, 2023 17:46
@owenv
Copy link
Collaborator

owenv commented Feb 20, 2023

Let's say there's a driver flag called -do-something and a frontend flag -do-somethingwithfrontend. Would this change cause -do-somethingwithfrontend to get parsed incorrectly if -do-something supported a joined argument? I know it seems unlikely, but also hard to debug if it ever happens

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.

None yet

2 participants