[M] Change in code/re2[main]: Migrate to Bzlmod.

37 views
Skip to first unread message

Paul Wankadia (Gerrit)

unread,
Aug 11, 2023, 10:16:29 AM8/11/23
to Paul Wankadia, re2...@googlegroups.com

Paul Wankadia has uploaded this change for review.

View Change

Migrate to Bzlmod.

Change-Id: I1f656f81468e1fdd1812595aeaf0ed3367caa003
---
M .bazelrc
A MODULE.bazel
M WORKSPACE.bazel
3 files changed, 27 insertions(+), 58 deletions(-)

diff --git a/.bazelrc b/.bazelrc
index 8141639..d0e6bf1 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 0000000..5585c64
--- /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 bf67dc4..fa514a8 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",
-)

To view, visit change 61670. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: re2
Gerrit-Branch: main
Gerrit-Change-Id: I1f656f81468e1fdd1812595aeaf0ed3367caa003
Gerrit-Change-Number: 61670
Gerrit-PatchSet: 1
Gerrit-Owner: Paul Wankadia <jun...@google.com>

Alex Chernyakhovsky (Gerrit)

unread,
Aug 11, 2023, 10:17:36 AM8/11/23
to Paul Wankadia, Perry Lorier, Randall Bosetti, re2...@googlegroups.com

Attention is currently required from: Paul Wankadia.

Patch set 1:Code-Review +1

View Change

    To view, visit change 61670. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: re2
    Gerrit-Branch: main
    Gerrit-Change-Id: I1f656f81468e1fdd1812595aeaf0ed3367caa003
    Gerrit-Change-Number: 61670
    Gerrit-PatchSet: 1
    Gerrit-Owner: Paul Wankadia <jun...@google.com>
    Gerrit-Reviewer: Alex Chernyakhovsky <ache...@google.com>
    Gerrit-CC: Perry Lorier <per...@google.com>
    Gerrit-CC: Randall Bosetti <r...@google.com>
    Gerrit-Attention: Paul Wankadia <jun...@google.com>
    Gerrit-Comment-Date: Fri, 11 Aug 2023 14:17:31 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes

    Paul Wankadia (Gerrit)

    unread,
    Aug 11, 2023, 10:21:14 AM8/11/23
    to Paul Wankadia, Alex Chernyakhovsky, Perry Lorier, Randall Bosetti, re2...@googlegroups.com

    Attention is currently required from: Paul Wankadia.

    Patch set 1:Code-Review +2

    View Change

      To view, visit change 61670. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: re2
      Gerrit-Branch: main
      Gerrit-Change-Id: I1f656f81468e1fdd1812595aeaf0ed3367caa003
      Gerrit-Change-Number: 61670
      Gerrit-PatchSet: 1
      Gerrit-Owner: Paul Wankadia <jun...@google.com>
      Gerrit-Reviewer: Alex Chernyakhovsky <ache...@google.com>
      Gerrit-Reviewer: Paul Wankadia <jun...@google.com>
      Gerrit-CC: Perry Lorier <per...@google.com>
      Gerrit-CC: Randall Bosetti <r...@google.com>
      Gerrit-Attention: Paul Wankadia <jun...@google.com>
      Gerrit-Comment-Date: Fri, 11 Aug 2023 14:21:09 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes

      Paul Wankadia (Gerrit)

      unread,
      Aug 11, 2023, 10:21:21 AM8/11/23
      to Paul Wankadia, Alex Chernyakhovsky, Perry Lorier, Randall Bosetti, re2...@googlegroups.com

      Paul Wankadia submitted this change.

      View Change

      Approvals: Alex Chernyakhovsky: Looks good to me, but someone else must approve Paul Wankadia: Looks good to me, approved
      Migrate to Bzlmod.

      Change-Id: I1f656f81468e1fdd1812595aeaf0ed3367caa003
      Reviewed-on: https://code-review.googlesource.com/c/re2/+/61670
      Reviewed-by: Alex Chernyakhovsky <ache...@google.com>
      Reviewed-by: Paul Wankadia <jun...@google.com>

      To view, visit change 61670. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: merged
      Gerrit-Project: re2
      Gerrit-Branch: main
      Gerrit-Change-Id: I1f656f81468e1fdd1812595aeaf0ed3367caa003
      Gerrit-Change-Number: 61670
      Gerrit-PatchSet: 2
      Reply all
      Reply to author
      Forward
      0 new messages