Philipp Schrader | 0f5d250 | 2022-03-08 22:44:55 -0800 | [diff] [blame] | 1 | From d654cc64ae71366ea82ac492106e9b2c8fa532d5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Philipp Schrader <philipp.schrader@gmail.com> |
| 3 | Date: Thu, 10 Mar 2022 23:25:21 -0800 |
| 4 | Subject: [PATCH] Fix tree artifacts |
| 5 | |
| 6 | For some reason the upstream code strips the directory names from the |
| 7 | `babel()` rule that we use. This patch makes it so the directory is |
| 8 | not stripped. This makes runfiles layout in the tarball match the |
| 9 | runfiles layout in `bazel-bin`. |
| 10 | --- |
| 11 | pkg/pkg.bzl | 4 ++-- |
| 12 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 13 | |
| 14 | diff --git a/pkg/pkg.bzl b/pkg/pkg.bzl |
| 15 | index d7adbbc..a241b26 100644 |
| 16 | --- a/pkg/pkg.bzl |
| 17 | +++ b/pkg/pkg.bzl |
| 18 | @@ -157,8 +157,8 @@ def _pkg_tar_impl(ctx): |
| 19 | # Tree artifacts need a name, but the name is never really |
| 20 | # the important part. The likely behavior people want is |
| 21 | # just the content, so we strip the directory name. |
| 22 | - dest = "/".join(d_path.split("/")[0:-1]) |
| 23 | - add_tree_artifact(content_map, dest, f, src.label) |
| 24 | + #dest = "/".join(d_path.split("/")[0:-1]) |
| 25 | + add_tree_artifact(content_map, d_path, f, src.label) |
| 26 | else: |
| 27 | # Note: This extra remap is the bottleneck preventing this |
| 28 | # large block from being a utility method as shown below. |