Make output_file variable optional

Copybara Import from https://github.com/bazelbuild/rules_cc/pull/339

BEGIN_PUBLIC
Make output_file variable optional (#339)

There are use cases where callers attempt to get the command line flags
for something without having an output file, which makes any feature
that relies on this fail.

For example: https://github.com/bazel-contrib/rules_foreign_cc/blob/2dd6fe2aee33bf1a931ac18e5090c5476a229a02/foreign_cc/private/cc_toolchain_util.bzl#L250-L254

Currently this is unused directly but will be used in later changes and
must be optional to work correctly for this case.

Closes #339
END_PUBLIC

COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_cc/pull/339 from keith:ks/make-output_file-variable-optional 86ac5093e128f3f591ea42acae9f4a57bf0bd060
PiperOrigin-RevId: 721795506
Change-Id: I48f2580052d4f32f0c2c109a1e91758e934f1206
diff --git a/cc/toolchains/variables/BUILD b/cc/toolchains/variables/BUILD
index d650708..bb06770 100644
--- a/cc/toolchains/variables/BUILD
+++ b/cc/toolchains/variables/BUILD
@@ -325,7 +325,7 @@
         "//cc/toolchains/actions:compile_actions",
         "//cc/toolchains/actions:strip",
     ],
-    type = types.file,
+    type = types.option(types.file),
 )
 
 cc_variable(