Skip to content

[Driver] Avoid using response files for SourceKit #81555

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
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/Driver/ToolChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ std::optional<Job::ResponseFileInfo>
ToolChain::getResponseFileInfo(const Compilation &C, const char *executablePath,
const ToolChain::InvocationInfo &invocationInfo,
const ToolChain::JobContext &context) const {
// Never use a response file if this is a dummy driver for SourceKit, we
// just want the frontend arguments.
if (getDriver().isDummyDriverForFrontendInvocation())
return std::nullopt;

const bool forceResponseFiles =
C.getArgs().hasArg(options::OPT_driver_force_response_files);
assert((invocationInfo.allowsResponseFiles || !forceResponseFiles) &&
Expand Down
4 changes: 4 additions & 0 deletions test/SourceKit/Misc/rdar98880399.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Make sure we don't create any temporary files.
// RUN: %empty-directory(%t)
// RUN: env TMP=%t TMPDIR=%t %sourcekitd-test -req=open %s -- %s -driver-force-response-files
// RUN: not ls %t/* >/dev/null 2>&1