Skip to content

Preserve relative ordering in ParsedOptions.arguments(for options:) #232

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
Aug 30, 2020

Conversation

owenv
Copy link
Contributor

@owenv owenv commented Aug 30, 2020

Another small bugfix: according to swiftlang/swift#8134, the relative ordering of "-F" and "-Fsystem" search paths needs to be preserved in frontend invocations. Instead of introducing a special case, I just changed the behavior of ParsedOptions.arguments(for options:) since it shouldn't be that expensive to always sort the options and I'm guessing this isn't the only case where it could end up mattering for correctness.

This is significant in at least one case (-F/-Fsystem ordering needs to be preserved),
and isn't that expensive, so always preserve the ordering to ensure more predictable behavior
@owenv
Copy link
Contributor Author

owenv commented Aug 30, 2020

@swift-ci test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Very nice catch. The ordering here is indeed important, since it can affect which modules get found.

@owenv owenv merged commit 2db7080 into swiftlang:master Aug 30, 2020
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