Skip to content

Commit

Permalink
Update rules_pkg to the latest release. (#2125)
Browse files Browse the repository at this point in the history
  • Loading branch information
aiuto authored Jul 20, 2022
1 parent 3b5d2b7 commit 23cd893
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ rules, you can override the default `base="..."` attribute. Consider this
modified sample from the `distroless` repository:

```python
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

# Create a passwd file with a root and nonroot user and uid.
passwd_entry(
Expand Down
2 changes: 2 additions & 0 deletions repositories/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ repository.
"""

load(":go_repositories.bzl", "go_deps")
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")

# TODO: `go_repository_default_config` is only useful for working around
# https://github.com/bazelbuild/rules_docker/issues/1902 and could likely be
Expand All @@ -36,3 +37,4 @@ def deps(go_repository_default_config = "@//:WORKSPACE"):
go_repository_default_config (str, optional): A file used to determine the root of the workspace.
"""
go_deps(go_repository_default_config = go_repository_default_config)
rules_pkg_dependencies()
7 changes: 5 additions & 2 deletions repositories/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,11 @@ def repositories():
if "rules_pkg" not in excludes:
http_archive(
name = "rules_pkg",
sha256 = "aeca78988341a2ee1ba097641056d168320ecc51372ef7ff8e64b139516a4937",
urls = ["https://github.com/bazelbuild/rules_pkg/releases/download/0.2.6-1/rules_pkg-0.2.6.tar.gz"],
sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
],
)

native.register_toolchains(
Expand Down
2 changes: 1 addition & 1 deletion testdata/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
load("@io_bazel_rules_docker_pip_deps//:requirements.bzl", "requirement")
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("//cc:image.bzl", "cc_image")
load(
"//container:container.bzl",
Expand Down
8 changes: 4 additions & 4 deletions tests/container/image_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ def test_build_with_tag(self):
def test_with_passwd(self):
with TestImage('with_passwd') as img:
self.assertDigest(
img, '81420a14782ff8a0de928199d7e3e5bbf8684f02a977326b96d863329c97f055')
img, '802c8849a4a6b51024d5314a177ef2791f641ae601ee161a728734b4b16e30b2')
self.assertEqual(1, len(img.fs_layers()))
self.assertTopLayerContains(img, ['.', './etc', './etc/passwd'])
self.assertTopLayerContains(img, ['./etc', './etc/passwd'])

buf = BytesIO(img.blob(img.fs_layers()[0]))
with tarfile.open(fileobj=buf, mode='r') as layer:
Expand Down Expand Up @@ -532,9 +532,9 @@ def test_with_passwd_tar(self):
def test_with_group(self):
with TestImage('with_group') as img:
self.assertDigest(
img, '3abaf45eda502f6826f3745627c707cd0ac12536915fa8ed45883fe21aaac075')
img, '65c41a3d20558d04a8d6fd4a94b19a70c3ad711f150fed641735128e20df698a')
self.assertEqual(1, len(img.fs_layers()))
self.assertTopLayerContains(img, ['.', './etc', './etc/group'])
self.assertTopLayerContains(img, ['./etc', './etc/group'])

buf = BytesIO(img.blob(img.fs_layers()[0]))
with tarfile.open(fileobj=buf, mode='r') as layer:
Expand Down
2 changes: 1 addition & 1 deletion tests/container/testdata/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

package(default_visibility = ["//tests:__subpackages__"])

Expand Down
2 changes: 1 addition & 1 deletion tests/docker/toolchain_container/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("//contrib:test.bzl", "container_test")
load(
"//docker/toolchain_container:toolchain_container.bzl",
Expand Down

0 comments on commit 23cd893

Please sign in to comment.