diff options
Diffstat (limited to 'rules/private/write_file_private.bzl')
-rw-r--r-- | rules/private/write_file_private.bzl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rules/private/write_file_private.bzl b/rules/private/write_file_private.bzl index ac8ce9c..cdb37c8 100644 --- a/rules/private/write_file_private.bzl +++ b/rules/private/write_file_private.bzl @@ -37,7 +37,10 @@ def _common_impl(ctx, is_windows, is_executable): if is_executable: return [DefaultInfo(files = files, runfiles = runfiles, executable = ctx.outputs.out)] else: - return [DefaultInfo(files = files, runfiles = runfiles)] + # Do not include the copied file into the default runfiles of the + # target, but ensure that it is picked up by native rule's data + # attribute despite https://github.com/bazelbuild/bazel/issues/15043. + return [DefaultInfo(files = files, data_runfiles = runfiles)] def _impl(ctx): return _common_impl(ctx, ctx.attr.is_windows, False) @@ -85,7 +88,7 @@ def write_file( sources. newline: one of ["auto", "unix", "windows"]: line endings to use. "auto" for platform-determined, "unix" for LF, and "windows" for CRLF. - **kwargs: further keyword arguments, e.g. <code>visibility</code> + **kwargs: further keyword arguments, e.g. `visibility` """ if is_executable: _write_xfile( |