Skip to content

[Driver/SourceKit] Handle filelist driver args in getSingleFrontendInvocationFromDriverArguments #32281

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

nathawes
Copy link
Contributor

@nathawes nathawes commented Jun 9, 2020

getSingleFrontendInvocationFromDriverArguments is set up to never produce file lists in the output frontend arguments (since none of its clients care about command line argument limits), but since the driver proper accepts file lists as input arguments it seems like this function should handle them too.

This was causing the sourcekitd stress tester (which passes whatever the build gives to the driver through to sourcekitd verbatim) to report failures that didn't reproduce in Xcode (which seems to never include file lists when computing the arguments to pass through to sourcekitd).

@nathawes
Copy link
Contributor Author

nathawes commented Jun 9, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - ab56ee9b76b9e2bc1106e25762ce845d1cd90af7

@nathawes
Copy link
Contributor Author

@swift-ci please test OS X Platform

@nathawes
Copy link
Contributor Author

@swift-ci please test Linux

@nathawes nathawes requested a review from benlangmuir June 10, 2020 17:08
@nathawes nathawes marked this pull request as ready for review June 10, 2020 17:09
@@ -27,9 +29,21 @@ bool swift::driver::getSingleFrontendInvocationFromDriverArguments(
ArrayRef<const char *> Argv, DiagnosticEngine &Diags,
llvm::function_ref<bool(ArrayRef<const char *> FrontendArgs)> Action,
bool ForceNoOutputs) {

// Expand any file list args.
SmallVector<const char *, 256> ExpandedArgv(Argv.begin(), Argv.end());
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't need two SmallVectors here; can we just use "Args"?

…vocationFromDriverArguments

getSingleFrontendInvocationFromDriverArguments is set up to never produce file
lists in the output frontend arguments, but since the driver accepts file lists
as input arguments, this should too.
@nathawes nathawes force-pushed the handle-filelists-in-sourcekit-driver-args branch from ab56ee9 to 50dc7d8 Compare June 10, 2020 17:51
@nathawes
Copy link
Contributor Author

@swift-ci please test

@nathawes nathawes requested a review from benlangmuir June 10, 2020 17:51
@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - ab56ee9b76b9e2bc1106e25762ce845d1cd90af7

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - ab56ee9b76b9e2bc1106e25762ce845d1cd90af7

@nathawes nathawes merged commit f89e213 into swiftlang:master Jun 11, 2020
@nathawes nathawes deleted the handle-filelists-in-sourcekit-driver-args branch June 11, 2020 00:39
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