diff --git a/tools/worker/swift_runner.cc b/tools/worker/swift_runner.cc index cd6279913..eca0f2993 100644 --- a/tools/worker/swift_runner.cc +++ b/tools/worker/swift_runner.cc @@ -203,7 +203,11 @@ bool SwiftRunner::ProcessArgument( // Apply any other text substitutions needed in the argument (i.e., for // Apple toolchains). auto new_arg = arg; - changed = MakeSubstitutions(&new_arg, bazel_placeholder_substitutions_); + // Bazel doesn't quote arguments in multi-line params files, so we need to + // ensure that our defensive quoting kicks in if an argument contains a + // space, even if no other changes would have been made. + changed = MakeSubstitutions(&new_arg, bazel_placeholder_substitutions_) || + new_arg.find_first_of(' ') != std::string::npos; consumer(new_arg); }