Skip to content

[SourceKit] Recover if compiler arguments have errors #37512

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 2 commits into from
May 21, 2021

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 19, 2021

If the compiler arguments have errors in them (e.g. because a file with the same name is used twice), we can often still fulfill SourceKit requests because the compiler argument errors are only relevant for later stages of the compilation process.

Instead of bailing out early, do a best effort retrieving the compiler arguments that are valid and ignoring the errors.

Also add a test case that we can create a module if same filename is used twice and -experimental-allow-module-with-compiler-errors is passed

Fixes rdar://77618144

@ahoppen ahoppen requested a review from akyrtzi May 19, 2021 19:56
@ahoppen ahoppen marked this pull request as draft May 19, 2021 20:01
ahoppen added 2 commits May 19, 2021 22:25
…sed twice and `-experimental-allow-module-with-compiler-errors` is passed
If the compiler arguments have errors in them (e.g. because a file with the same name is used twice), we can often still fulfill SourceKit requests because the compiler argument errors are only relevant for later stages of the compilation process.

Instead of bailing out early, do a best effor retrieving the compiler arguments that are valid and ignoring the errors.

Fixes rdar://77618144
@ahoppen ahoppen force-pushed the pr/allow-driver-errors branch from fc1764f to 44f8e19 Compare May 19, 2021 20:35
@ahoppen ahoppen changed the title [SourceKit] Do a best effort fulfilling a request if compiler arguments have errors [SourceKit] Recover if compiler arguments have errors May 19, 2021
@ahoppen ahoppen marked this pull request as ready for review May 19, 2021 20:35
@ahoppen
Copy link
Member Author

ahoppen commented May 19, 2021

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 44f8e19

@ahoppen
Copy link
Member Author

ahoppen commented May 20, 2021

@swift-ci Please test Linux

@ahoppen ahoppen merged commit 285cea4 into swiftlang:main May 21, 2021
@ahoppen ahoppen deleted the pr/allow-driver-errors branch May 21, 2021 07:17
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.

3 participants