Skip to content

Commit

Permalink
Switch to rules_pkg for pkg_tar rules
Browse files Browse the repository at this point in the history
Summary:
`pkg_tar` is deprecated from `bazel_tools` and they suggest we switch
to `rules_pkg` instead. This is one of the changes needed to unblock upgrade to
Bazel 6.0

Test Plan:
All builds and tests should continue to work. Yaml packaging still
works.

Reviewers: zasgar, michelle, jamesbartlett, #third_party_approvers

Reviewed By: zasgar, #third_party_approvers

Signed-off-by: Vihang Mehta <[email protected]>

Differential Revision: https://phab.corp.pixielabs.ai/D12638

GitOrigin-RevId: b122ac522bef433fafd017a6bc02f7d299ea49b5
  • Loading branch information
vihangm authored and copybaranaut committed Dec 22, 2022
1 parent 4ac47cc commit 3f3aeef
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 9 deletions.
4 changes: 4 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ load("@ubuntu_package_deps//:requirements.bzl", ubuntu_packages_install_deps = "

ubuntu_packages_install_deps()

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

rules_pkg_dependencies()

# The docker images can't be loaded until all pip_deps are satisfied.
pl_container_images()

Expand Down
1 change: 1 addition & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def _pl_deps():
_bazel_repo("io_bazel_rules_closure")
_bazel_repo("io_bazel_rules_docker", patches = ["//bazel/external:rules_docker.patch"], patch_args = ["-p1"])
_bazel_repo("rules_python")
_bazel_repo("rules_pkg")
_bazel_repo("com_github_bazelbuild_buildtools")
_bazel_repo("com_google_googleapis")
_bazel_repo("com_github_fmeum_rules_meta")
Expand Down
7 changes: 7 additions & 0 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,13 @@ REPOSITORY_LOCATIONS = dict(
sha256 = "2cd77de091e5376afaf9cc391c15f093ebd0105192373b334f0a855d89092ad5",
strip_prefix = "rules_jvm_external-4.2",
),
rules_pkg = dict(
sha256 = "eea0f59c28a9241156a47d7a8e32db9122f3d50b505fae0f33de6ce4d9b61834",
urls = [
"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",
],
),
unix_cc_toolchain_config = dict(
sha256 = "2c1d60ef4d586909f138c28409780e102e2ebd619e7d462ded26dce43a8f9ffb",
urls = [
Expand Down
2 changes: 1 addition & 1 deletion demos/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#
# SPDX-License-Identifier: Apache-2.0

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@px//demos:demo_upload.bzl", "demo_upload")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

pkg_tar(
name = "px-finagle",
Expand Down
4 changes: 2 additions & 2 deletions k8s/operator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#
# SPDX-License-Identifier: Apache-2.0

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
load("@io_bazel_rules_docker//contrib:push-all.bzl", "container_push")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("//bazel:images.bzl", "image_map_with_bundle_version")

package(default_visibility = ["//visibility:public"])
Expand Down Expand Up @@ -76,7 +76,7 @@ pkg_tar(
"helm/templates/*_*.yaml",
],
) + [
"helm/crds",
"helm/crds/olm_crd.yaml",
":vizier_crd_yaml",
],
package_dir = "/yamls",
Expand Down
2 changes: 1 addition & 1 deletion k8s/vizier/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# SPDX-License-Identifier: Apache-2.0

load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
load("@io_bazel_rules_docker//contrib:push-all.bzl", "container_push")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("//bazel:images.bzl", "generate_vizier_metadata_persist_yamls", "generate_vizier_yamls", "image_map_with_bundle_version")

package(default_visibility = ["//visibility:public"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#
# SPDX-License-Identifier: Apache-2.0

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@io_bazel_rules_docker//contrib:passwd.bzl", "passwd_entry", "passwd_file")
load("@io_bazel_rules_docker//java:image.bzl", "java_image")
load("@rules_java//java:defs.bzl", "java_binary")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

package(default_visibility = ["//src/stirling:__subpackages__"])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#
# SPDX-License-Identifier: Apache-2.0

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_layer")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

package(default_visibility = ["//src/stirling:__subpackages__"])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#
# SPDX-License-Identifier: Apache-2.0

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_layer")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

package(default_visibility = ["//src/stirling:__subpackages__"])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#
# SPDX-License-Identifier: Apache-2.0

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_layer")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

package(default_visibility = ["//src/stirling:__subpackages__"])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
#
# SPDX-License-Identifier: Apache-2.0

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@io_bazel_rules_docker//java:image.bzl", "DEFAULT_JAVA_BASE")
load("@io_bazel_rules_docker//scala:image.bzl", "scala_image")
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_binary", "scala_library")
load("@io_bazel_rules_scala//thrift:thrift.bzl", "thrift_library")
load("@io_bazel_rules_scala//twitter_scrooge:twitter_scrooge.bzl", "scrooge_scala_library")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("//bazel/external/ubuntu_packages:packages.bzl", "packages")

package(default_visibility = ["//src/stirling:__subpackages__"])
Expand Down

0 comments on commit 3f3aeef

Please sign in to comment.