Skip to content

Commit

Permalink
fix: always include files from the same workspace as the build target…
Browse files Browse the repository at this point in the history
… in `copy_to_directory`

Fixes bazel-contrib#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`).
  • Loading branch information
dgp1130 committed Oct 10, 2023
1 parent 8b06f31 commit d533d8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/copy_to_directory.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit d533d8d

Please sign in to comment.