Skip to content

Commit 714c8fc

Browse files
committed
Migrate to Bzlmod.
Change-Id: I1f656f81468e1fdd1812595aeaf0ed3367caa003 Reviewed-on: https://code-review.googlesource.com/c/re2/+/61670 Reviewed-by: Alex Chernyakhovsky <[email protected]> Reviewed-by: Paul Wankadia <[email protected]>
1 parent 9dc7ae7 commit 714c8fc

File tree

3 files changed

+27
-58
lines changed

3 files changed

+27
-58
lines changed

.bazelrc

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# Use of this source code is governed by a BSD-style
33
# license that can be found in the LICENSE file.
44

5+
# Enable Bzlmod. This will be the default eventually...
6+
build --enable_bzlmod
7+
58
# Abseil requires C++14 at minimum.
69
# Previously, the flag was set via `BAZEL_CXXOPTS`. On macOS, we also had to set
710
# `BAZEL_USE_CPP_ONLY_TOOLCHAIN` since Bazel wouldn't respect the former without

MODULE.bazel

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2009 The RE2 Authors. All Rights Reserved.
2+
# Use of this source code is governed by a BSD-style
3+
# license that can be found in the LICENSE file.
4+
5+
# Bazel (http://bazel.build/) MODULE file for RE2.
6+
7+
module(
8+
name = "re2",
9+
version = "2023-08-01",
10+
compatibility_level = 11,
11+
)
12+
13+
bazel_dep(name = "platforms", version = "0.0.7")
14+
bazel_dep(name = "rules_cc", version = "0.0.8")
15+
bazel_dep(name = "abseil-cpp", version = "20230125.1", repo_name = "com_google_absl")
16+
bazel_dep(name = "google_benchmark", version = "1.8.2", repo_name = "com_github_google_benchmark")
17+
bazel_dep(name = "googletest", version = "1.12.1", repo_name = "com_google_googletest")
18+
bazel_dep(name = "rules_python", version = "0.24.0")
19+
bazel_dep(name = "abseil-py", version = "1.4.0", repo_name = "io_abseil_py")
20+
bazel_dep(name = "pybind11_bazel", version = "2.11.1")
21+
22+
python_configure = use_extension("@pybind11_bazel//:python_configure.bzl", "extension")
23+
python_configure.toolchain(python_version = "3") # ignored when non-root module
24+
use_repo(python_configure, "local_config_python", "pybind11")

WORKSPACE.bazel

-58
Original file line numberDiff line numberDiff line change
@@ -5,61 +5,3 @@
55
# Bazel (http://bazel.build/) WORKSPACE file for RE2.
66

77
workspace(name = "com_googlesource_code_re2")
8-
9-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
10-
11-
http_archive(
12-
name = "com_google_absl",
13-
strip_prefix = "abseil-cpp-master",
14-
urls = ["https://github.com/abseil/abseil-cpp/archive/master.zip"],
15-
)
16-
17-
http_archive(
18-
name = "bazel_skylib",
19-
strip_prefix = "bazel-skylib-main",
20-
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/main.zip"],
21-
)
22-
23-
http_archive(
24-
name = "com_github_google_benchmark",
25-
strip_prefix = "benchmark-main",
26-
urls = ["https://github.com/google/benchmark/archive/main.zip"],
27-
)
28-
29-
http_archive(
30-
name = "com_google_googletest",
31-
strip_prefix = "googletest-main",
32-
urls = ["https://github.com/google/googletest/archive/main.zip"],
33-
)
34-
35-
http_archive(
36-
name = "rules_python",
37-
strip_prefix = "rules_python-main",
38-
urls = ["https://github.com/bazelbuild/rules_python/archive/main.zip"],
39-
)
40-
41-
http_archive(
42-
name = "io_abseil_py",
43-
strip_prefix = "abseil-py-main",
44-
urls = ["https://github.com/abseil/abseil-py/archive/main.zip"],
45-
)
46-
47-
http_archive(
48-
name = "pybind11_bazel",
49-
strip_prefix = "pybind11_bazel-master",
50-
urls = ["https://github.com/pybind/pybind11_bazel/archive/master.zip"],
51-
)
52-
53-
http_archive(
54-
name = "pybind11",
55-
build_file = "@pybind11_bazel//:pybind11.BUILD",
56-
strip_prefix = "pybind11-master",
57-
urls = ["https://github.com/pybind/pybind11/archive/master.zip"],
58-
)
59-
60-
load("@pybind11_bazel//:python_configure.bzl", "python_configure")
61-
62-
python_configure(
63-
name = "local_config_python",
64-
python_version = "3",
65-
)

0 commit comments

Comments
 (0)