Skip to content

Commit

Permalink
[Build] Update rules_pkg to 0.8. Also add tree inclusion patch
Browse files Browse the repository at this point in the history
  • Loading branch information
AutomatedTester committed Dec 7, 2022
1 parent dd080a1 commit 104b7b9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
11 changes: 9 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,17 @@ rules_closure_toolchains()

http_archive(
name = "rules_pkg",
sha256 = "451e08a4d78988c06fa3f9306ec813b836b1d076d0f055595444ba4ff22b867f",
patch_args = [
"-p1",
],
patches = [
"//py:rules_pkg_tree.patch",
],
urls = [
"https://github.com/bazelbuild/rules_pkg/releases/download/0.7.1/rules_pkg-0.7.1.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.8.0/rules_pkg-0.8.0.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.8.0/rules_pkg-0.8.0.tar.gz",
],
sha256 = "eea0f59c28a9241156a47d7a8e32db9122f3d50b505fae0f33de6ce4d9b61834",
)

load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
Expand Down
16 changes: 16 additions & 0 deletions py/rules_pkg_tree.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/pkg/private/tar/build_tar.py b/pkg/private/tar/build_tar.py
index ab16610d..b6b75bd7 100644
--- a/pkg/private/tar/build_tar.py
+++ b/pkg/private/tar/build_tar.py
@@ -309,7 +309,10 @@ def add_manifest_entry(self, entry_list, file_attributes):
elif entry.entry_type == manifest.ENTRY_IS_EMPTY_FILE:
self.add_empty_file(entry.dest, **attrs)
else:
- self.add_file(entry.src, entry.dest, **attrs)
+ if os.path.isdir(entry.src):
+ self.add_tree(entry.src, entry.dest, **attrs)
+ else:
+ self.add_file(entry.src, entry.dest, **attrs)


def main():

0 comments on commit 104b7b9

Please sign in to comment.