diff --git a/.gitignore b/.gitignore index d3967d0e3..3ce881718 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ # Bazel -bazel-* \ No newline at end of file +bazel-* +MODULE.bazel.lock diff --git a/BUILD b/BUILD new file mode 100644 index 000000000..9061795cc --- /dev/null +++ b/BUILD @@ -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. diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 000000000..a2843f809 --- /dev/null +++ b/MODULE.bazel @@ -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") diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod new file mode 100644 index 000000000..61cc1ca5e --- /dev/null +++ b/WORKSPACE.bzlmod @@ -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", +)