Skip to content

Commit

Permalink
Migrate to Bzlmod.
Browse files Browse the repository at this point in the history
This updates Bazel to 6.4.0.
  • Loading branch information
SanjayVas committed Dec 6, 2023
1 parent 1f5411f commit 209f173
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 29 deletions.
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Enable Bzlmod.
common --enable_bzlmod
# TODO(@SanjayVas): Update this when the repo has been moved to the WFA org.
common --registry=https://raw.githubusercontent.com/SanjayVas/bazel-registry/main/
common --registry=https://bcr.bazel.build

# Use clang as C++ compiler.
build --repo_env='CC=clang'

Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.0
6.4.0
65 changes: 65 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
module(
name = "any-sketch",
repo_name = "any_sketch",
)

BORINGSSL_VERSION = "0.0.0-20230215-5c22014"

bazel_dep(
name = "rules_cc",
version = "0.0.9",
)
bazel_dep(
name = "rules_proto",
version = "5.3.0-21.7",
)
bazel_dep(
name = "abseil-cpp",
version = "20230802.0",
repo_name = "com_google_absl",
)
bazel_dep(
name = "googletest",
version = "1.14.0",
repo_name = "com_google_googletest",
)
bazel_dep(
name = "glog",
version = "0.6.0",
repo_name = "com_github_google_glog",
)
bazel_dep(
name = "boringssl",
version = BORINGSSL_VERSION,
)
single_version_override(
module_name = "boringssl",
version = BORINGSSL_VERSION,
)

bazel_dep(
name = "common-cpp",
version = "0.11.0-rc1",
repo_name = "wfa_common_cpp",
)

non_module_deps = use_extension("//build:non_module_deps.bzl", "non_module_deps")
use_repo(non_module_deps, "com_google_private_join_and_compute")

# Transitive dependencies for private-join-and-compute.
bazel_dep(
name = "grpc",
version = "1.48.1",
repo_name = "com_github_grpc_grpc",
)
bazel_dep(
name = "protobuf",
version = "21.7",
repo_name = "com_google_protobuf",
)

# TODO(bazelbuild/bazel-central-registry#1180): Remove when fixed.
single_version_override(
module_name = "rules_go",
version = "0.43.0",
)
31 changes: 3 additions & 28 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
workspace(name = "any_sketch")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Common-cpp
http_archive(
name = "wfa_common_cpp",
sha256 = "dc0c388a8cc3ea36b189edd76efba50aebdc457b4662ed2fbca510a05cffb5ee",
strip_prefix = "common-cpp-0.10.2",
url = "https://github.com/world-federation-of-advertisers/common-cpp/archive/v0.10.2.tar.gz",
)

load("@wfa_common_cpp//build:common_cpp_repositories.bzl", "common_cpp_repositories")

common_cpp_repositories()

load("@wfa_common_cpp//build:common_cpp_deps.bzl", "common_cpp_deps")
# This file marks the root of the Bazel workspace.
# See MODULE.bazel for external dependencies setup.

common_cpp_deps()

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")

# Includes boringssl, com_google_absl, and other dependencies.
grpc_deps()

load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")

# Loads transitive dependencies of GRPC.
grpc_extra_deps()
workspace(name = "any_sketch")
Empty file added build/BUILD.bazel
Empty file.
34 changes: 34 additions & 0 deletions build/non_module_deps.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2023 The Cross-Media Measurement Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Module extension for non-module dependencies."""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

def _non_module_deps_impl(
# buildifier: disable=unused-variable
mctx):
http_archive(
name = "com_google_private_join_and_compute",
urls = [
# 2023-07-30
"https://github.com/google/private-join-and-compute/archive/f77f26fab7f37e5e1e2d43250662c0281bd7fa4a.tar.gz",
],
strip_prefix = "private-join-and-compute-f77f26fab7f37e5e1e2d43250662c0281bd7fa4a",
sha256 = "18d617a5a66710728f562031c026cf6202d675e222852eaca60d529469464238",
)

non_module_deps = module_extension(
implementation = _non_module_deps_impl,
)
1 change: 1 addition & 0 deletions src/main/cc/any_sketch/crypto/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ cc_binary(
srcs = ["key_combiner_main.cc"],
deps = [
":sketch_encrypter",
"@com_github_google_glog//:glog",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/flags:parse",
"@com_google_absl//absl/strings",
Expand Down

0 comments on commit 209f173

Please sign in to comment.