xref: /aosp_15_r20/external/tensorflow/third_party/absl/workspace.bzl (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1"""Provides the repository macro to import absl."""
2
3load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
4
5def repo():
6    """Imports absl."""
7
8    # Attention: tools parse and update these lines.
9    # LINT.IfChange
10    ABSL_COMMIT = "273292d1cfc0a94a65082ee350509af1d113344d"
11    ABSL_SHA256 = "94aef187f688665dc299d09286bfa0d22c4ecb86a80b156dff6aabadc5a5c26d"
12    # LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/abseil-cpp.cmake)
13
14    SYS_DIRS = [
15        "algorithm",
16        "base",
17        "cleanup",
18        "container",
19        "debugging",
20        "flags",
21        "functional",
22        "hash",
23        "memory",
24        "meta",
25        "numeric",
26        "random",
27        "status",
28        "strings",
29        "synchronization",
30        "time",
31        "types",
32        "utility",
33    ]
34    SYS_LINKS = {
35        "//third_party/absl:system.absl.{name}.BUILD".format(name = n): "absl/{name}/BUILD.bazel".format(name = n)
36        for n in SYS_DIRS
37    }
38
39    tf_http_archive(
40        name = "com_google_absl",
41        sha256 = ABSL_SHA256,
42        build_file = "//third_party/absl:com_google_absl.BUILD",
43        system_build_file = "//third_party/absl:system.BUILD",
44        system_link_files = SYS_LINKS,
45        # TODO(b/234139015): Remove the patch when https://github.com/abseil/abseil-cpp/issues/326 is resolved
46        patch_file = ["//third_party/absl:com_google_absl_fix_mac_and_nvcc_build.patch"],
47        strip_prefix = "abseil-cpp-{commit}".format(commit = ABSL_COMMIT),
48        urls = tf_mirror_urls("https://github.com/abseil/abseil-cpp/archive/{commit}.tar.gz".format(commit = ABSL_COMMIT)),
49    )
50