diff --git a/.bazelrc b/.bazelrc index 814163970..d0e6bf169 100644 --- a/.bazelrc +++ b/.bazelrc @@ -2,6 +2,9 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. +# Enable Bzlmod. This will be the default eventually... +build --enable_bzlmod + # Abseil requires C++14 at minimum. # Previously, the flag was set via `BAZEL_CXXOPTS`. On macOS, we also had to set # `BAZEL_USE_CPP_ONLY_TOOLCHAIN` since Bazel wouldn't respect the former without diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 000000000..5585c64ab --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,24 @@ +# Copyright 2009 The RE2 Authors. All Rights Reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# Bazel (http://bazel.build/) MODULE file for RE2. + +module( + name = "re2", + version = "2023-08-01", + compatibility_level = 11, +) + +bazel_dep(name = "platforms", version = "0.0.7") +bazel_dep(name = "rules_cc", version = "0.0.8") +bazel_dep(name = "abseil-cpp", version = "20230125.1", repo_name = "com_google_absl") +bazel_dep(name = "google_benchmark", version = "1.8.2", repo_name = "com_github_google_benchmark") +bazel_dep(name = "googletest", version = "1.12.1", repo_name = "com_google_googletest") +bazel_dep(name = "rules_python", version = "0.24.0") +bazel_dep(name = "abseil-py", version = "1.4.0", repo_name = "io_abseil_py") +bazel_dep(name = "pybind11_bazel", version = "2.11.1") + +python_configure = use_extension("@pybind11_bazel//:python_configure.bzl", "extension") +python_configure.toolchain(python_version = "3") # ignored when non-root module +use_repo(python_configure, "local_config_python", "pybind11") diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index bf67dc4ee..fa514a877 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -5,61 +5,3 @@ # Bazel (http://bazel.build/) WORKSPACE file for RE2. workspace(name = "com_googlesource_code_re2") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "com_google_absl", - strip_prefix = "abseil-cpp-master", - urls = ["https://github.com/abseil/abseil-cpp/archive/master.zip"], -) - -http_archive( - name = "bazel_skylib", - strip_prefix = "bazel-skylib-main", - urls = ["https://github.com/bazelbuild/bazel-skylib/archive/main.zip"], -) - -http_archive( - name = "com_github_google_benchmark", - strip_prefix = "benchmark-main", - urls = ["https://github.com/google/benchmark/archive/main.zip"], -) - -http_archive( - name = "com_google_googletest", - strip_prefix = "googletest-main", - urls = ["https://github.com/google/googletest/archive/main.zip"], -) - -http_archive( - name = "rules_python", - strip_prefix = "rules_python-main", - urls = ["https://github.com/bazelbuild/rules_python/archive/main.zip"], -) - -http_archive( - name = "io_abseil_py", - strip_prefix = "abseil-py-main", - urls = ["https://github.com/abseil/abseil-py/archive/main.zip"], -) - -http_archive( - name = "pybind11_bazel", - strip_prefix = "pybind11_bazel-master", - urls = ["https://github.com/pybind/pybind11_bazel/archive/master.zip"], -) - -http_archive( - name = "pybind11", - build_file = "@pybind11_bazel//:pybind11.BUILD", - strip_prefix = "pybind11-master", - urls = ["https://github.com/pybind/pybind11/archive/master.zip"], -) - -load("@pybind11_bazel//:python_configure.bzl", "python_configure") - -python_configure( - name = "local_config_python", - python_version = "3", -)