Skip to content

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

Merged

Conversation

davidungar
Copy link
Contributor

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.

@davidungar
Copy link
Contributor Author

@swift-ci please smoke test

@davidungar
Copy link
Contributor Author

@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.

Copy link
Contributor

@jrose-apple jrose-apple left a 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 &&
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.)

@jrose-apple
Copy link
Contributor

cc @dabelknap

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