diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index d9895d51c8522..5538e19eb4191 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -72,6 +72,11 @@ std::optional 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) && diff --git a/test/SourceKit/Misc/rdar98880399.swift b/test/SourceKit/Misc/rdar98880399.swift new file mode 100644 index 0000000000000..541bfe797797a --- /dev/null +++ b/test/SourceKit/Misc/rdar98880399.swift @@ -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