From d533d8d2aec03274c99a378dad45d9fca49fb0c5 Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Fri, 10 Feb 2023 18:46:53 -0800 Subject: [PATCH] fix: always include files from the same workspace as the build target in `copy_to_directory` Fixes #359. This updates the `copy_to_directory` tool to accept a workspace name representing the workspace of the target it is executing under. Any files in this workspace are automatically included, regardless of the `include_external_repositories` option. This makes it support usage within an external target (such as `@wksp//:dir`). --- lib/private/copy_to_directory.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/copy_to_directory.bzl b/lib/private/copy_to_directory.bzl index 7b4ff5c7b..838fcf719 100644 --- a/lib/private/copy_to_directory.bzl +++ b/lib/private/copy_to_directory.bzl @@ -82,7 +82,7 @@ Globs are supported (see rule docstring above). Files from external repositories are only copied into the output directory if the external repository they come from matches one of the external repository patterns -specified. +specified or if they are in the same external repository as this target. When copied from an external repository, the file path in the output directory defaults to the file's path within the external repository. The external repository @@ -840,7 +840,7 @@ def copy_to_directory_bin_action( inputs = file_inputs + [config_file], outputs = [dst], executable = copy_to_directory_bin, - arguments = [config_file.path], + arguments = [config_file.path, ctx.label.workspace_name], mnemonic = "CopyToDirectory", progress_message = "Copying files to directory %s" % _progress_path(dst), execution_requirements = override_execution_requirements or execution_requirements_for_copy(ctx),