Skip to content

Commit

Permalink
Add Bzlmod support
Browse files Browse the repository at this point in the history
Introduce Bzlmod support for TCMalloc.

Co-developed-by: Keith Smiley <[email protected]>
[elver: Add missing dependencies, license headers]
Closes: #230
PiperOrigin-RevId: 641923318
Change-Id: I3d681f72d0b514ee06a3c546b0c8242ee71964c6
  • Loading branch information
melver authored and copybara-github committed Jun 10, 2024
1 parent e73c0b2 commit b4cf584
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Bazel
bazel-*
bazel-*
MODULE.bazel.lock
13 changes: 13 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 The TCMalloc 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
#
# https://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.
30 changes: 30 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2024 The TCMalloc 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
#
# https://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(
name = "tcmalloc",
version = "0",
compatibility_level = 0,
repo_name = "com_google_tcmalloc",
)

bazel_dep(name = "abseil-cpp", version = "20240116.2", repo_name = "com_google_absl")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "google_benchmark", version = "1.8.3", repo_name = "com_github_google_benchmark")
bazel_dep(name = "googletest", version = "1.13.0", repo_name = "com_google_googletest")
bazel_dep(name = "protobuf", version = "26.0", repo_name = "com_google_protobuf")
bazel_dep(name = "re2", version = "2024-02-01", repo_name = "com_googlesource_code_re2")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_fuzzing", version = "0.5.1")
bazel_dep(name = "rules_proto", version = "4.0.0")
25 changes: 25 additions & 0 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 The TCMalloc 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
#
# https://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.

# See MODULE.bazel for external dependencies setup.

# Having both WORKSPACE and MODULE.bazel specify dependencies is brittle.
# fuzztest is not yet available via Bazel registry, but should be soon:
# https://github.com/bazelbuild/bazel-central-registry/issues/1391
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_google_fuzztest",
strip_prefix = "fuzztest-7e084905bce6ffa97b58cf8e8945e5cea2348a5a",
url = "https://github.com/google/fuzztest/archive/7e084905bce6ffa97b58cf8e8945e5cea2348a5a.zip",
)

0 comments on commit b4cf584

Please sign in to comment.