diff options
author | Kamal Marhubi <kamal@marhubi.com> | 2015-12-04 16:59:07 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2015-12-04 21:06:51 +0000 |
commit | 0e222581e674b0f7c186c4bc40be2af680e94643 (patch) | |
tree | 5ad198afcd208cdd841b65825e0cca7654fdc699 /tools/build_defs/docker/testdata | |
parent | df4194f47f2e1777301071b48dedf9a80b2264b8 (diff) |
docker_build: Properly handle / as data_path
The handling in _compute_data_path would incorrectly result in an empty
strip_prefix being passed to _dest_path. The outcome was all files would
end up at the top of directory, instead of nested according to the
repository structure.
This change brings the behavior in line with the documentation, which
states:
> This path can be absolute from the workspace root if starting with a
> `/` or relative to the rule's directory.
Fixes https://github.com/bazelbuild/bazel/issues/677
--
Change-Id: Ifdab97ed0e851cf6cabc7bd3206343766861b725
Reviewed-on: https://bazel-review.googlesource.com/#/c/2480
MOS_MIGRATED_REVID=109418486
Diffstat (limited to 'tools/build_defs/docker/testdata')
-rw-r--r-- | tools/build_defs/docker/testdata/BUILD | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/build_defs/docker/testdata/BUILD b/tools/build_defs/docker/testdata/BUILD index 88f248f1b2..c1d1896e50 100644 --- a/tools/build_defs/docker/testdata/BUILD +++ b/tools/build_defs/docker/testdata/BUILD @@ -39,6 +39,20 @@ docker_build( ) docker_build( + name = "absolute_data_path_image", + data_path = "/tools/build_defs", + files = ["//tools/build_defs/docker/testdata/test:test-data"], + mode = "0644", +) + +docker_build( + name = "root_data_path_image", + data_path = "/", + files = ["//tools/build_defs/docker/testdata/test:test-data"], + mode = "0644", +) + +docker_build( name = "gen_image", files = [":gen"], mode = "0644", |