-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add -driver-force-response-files to enable testing. #19313
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
Add -driver-force-response-files to enable testing. #19313
Conversation
@swift-ci please smoke test |
@jrose-apple I have a fix for the radar, but it is hard to test without being able to force response files, so I'm submitting this PR. The part I am unsure of is what to do if -driver-force-response-files is set on a platform that disallows response files. What I submitted will fail an assertion in that case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
assert((invocationInfo.allowsResponseFiles || !forceResponseFiles) && | ||
"Cannot force response file if platform does not allow it"); | ||
|
||
if (forceResponseFiles || (invocationInfo.allowsResponseFiles && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invocationInfo.allowsResponseFiles
should still guard the whole thing, since one swiftc invocation can invoke multiple tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean that if -driver-force-response-files is set on a platform that disallows them, you want the compiler just silently disregard the option? Or what do you want in that case? The current code is meant to fail an assertion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I misread the assertion, but the problem is that it's not a platform-by-platform decision; it's a tool-by-tool decision. You could easily have a platform where calling the frontend allows response files (all of them) but calling the linker does not.
Then again, since this is for testing purposes only, maybe the assertion is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Merged this a bit too quickly, let me know if you want a change. (I can't find the revert button, but can merge a fix.)
cc @dabelknap |
In preparation to land a fix and test for rdar://44142091, add a driver flag & test to force the use of response files. Fail an assertion if flag is set on a platform that does not allow response files.