Debian Codegraph @

bazel/dependency_imports.bzl

raw
1 load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
2 load("@com_envoyproxy_protoc_gen_validate//bazel:repositories.bzl", "pgv_dependencies")
3 load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
4 load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
5 load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
6 load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
7
8 # go version for rules_go
9 GO_VERSION = "1.24.6"
10
11 # Python version for rules_python
12 PYTHON_VERSION = "3.12"
13
14 def xds_dependency_imports(go_version = GO_VERSION):
15 protobuf_deps()
16 go_rules_dependencies()
17 go_register_toolchains(go_version = go_version)
18 gazelle_dependencies(go_sdk = "go_sdk")
19 pgv_dependencies()
20
21 # Initialize rules_python for WORKSPACE mode
22 py_repositories()
23 python_register_toolchains(
24 name = "python_%s" % PYTHON_VERSION,
25 python_version = PYTHON_VERSION,
26 )
27
28 # Needed for grpc's @com_github_grpc_grpc//bazel:python_rules.bzl
29 # Used in place of calling grpc_deps() because it needs to be called before
30 # loading `grpc_extra_deps.bzl` - which is not allowed in a method def context.
31 native.bind(
32 name = "protocol_compiler",
33 actual = "@com_google_protobuf//:protoc",
34 )
35
36 switched_rules_by_language(
37 name = "com_google_googleapis_imports",
38 cc = True,
39 go = True,
40 python = True,
41 grpc = True,
42 )
43
44 # These dependencies, like most of the Go in this repository, exist only for the API.
45 # These repos also have transient dependencies - `build_external` allows them to use them.
46 # TODO(phlax): remove `build_external` and pin all transients
47 go_repository(
48 name = "org_golang_x_mod",
49 importpath = "golang.org/x/mod",
50 sum = "h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=",
51 version = "v0.15.0",
52 build_external = "external",
53 )
54 go_repository(
55 name = "org_golang_x_tools",
56 importpath = "golang.org/x/tools",
57 sum = "h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=",
58 version = "v0.17.0",
59 # Using vendored mode to avoid having to resolve all transitive dependencies manually
60 build_external = "vendored",
61 build_directives = [
62 "gazelle:resolve go golang.org/x/mod/semver @org_golang_x_mod//semver:go_default_library",
63 "gazelle:resolve go golang.org/x/mod/module @org_golang_x_mod//module:go_default_library",
64 ],
65 )
66 go_repository(
67 name = "com_github_iancoleman_strcase",
68 importpath = "github.com/iancoleman/strcase",
69 sum = "h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=",
70 version = "v0.3.0",
71 build_external = "external",
72 )
73 go_repository(
74 name = "org_golang_x_net",
75 importpath = "golang.org/x/net",
76 sum = "h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=",
77 version = "v0.34.0",
78 build_external = "external",
79 )
80 go_repository(
81 name = "org_golang_x_text",
82 importpath = "golang.org/x/text",
83 sum = "h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=",
84 version = "v0.21.0",
85 build_external = "external",
86 )
87 go_repository(
88 name = "com_github_spf13_afero",
89 importpath = "github.com/spf13/afero",
90 sum = "h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=",
91 version = "v1.10.0",
92 build_external = "external",
93 )
94 go_repository(
95 name = "com_github_lyft_protoc_gen_star_v2",
96 importpath = "github.com/lyft/protoc-gen-star/v2",
97 sum = "h1:sIXJOMrYnQZJu7OB7ANSF4MYri2fTEGIsRLz6LwI4xE=",
98 version = "v2.0.4-0.20230330145011-496ad1ac90a4",
99 build_external = "external",
100 build_directives = [
101 "gazelle:resolve go golang.org/x/tools/imports @org_golang_x_tools//imports:go_default_library",
102 ],
103 )
104 go_repository(
105 name = "org_golang_google_genproto_googleapis_api",
106 importpath = "google.golang.org/genproto/googleapis/api",
107 sum = "h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc=",
108 version = "v0.0.0-20240903143218-8af14fe29dc1",
109 build_external = "external",
110 )
111 go_repository(
112 name = "org_golang_google_genproto_googleapis_rpc",
113 importpath = "google.golang.org/genproto/googleapis/rpc",
114 sum = "h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=",
115 version = "v0.0.0-20240903143218-8af14fe29dc1",
116 build_external = "external",
117 )
118 go_repository(
119 name = "org_golang_google_protobuf",
120 importpath = "google.golang.org/protobuf",
121 sum = "h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=",
122 version = "v1.36.10",
123 build_external = "external",
124 )
125 go_repository(
126 name = "org_golang_google_grpc",
127 build_file_proto_mode = "disable",
128 importpath = "google.golang.org/grpc",
129 sum = "h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=",
130 version = "v1.68.0",
131 )
132
133 # Old name for backward compatibility.
134 # TODO(roth): Remove this once callers are migrated to the new name.
135 def udpa_dependency_imports(go_version = GO_VERSION):
136 xds_dependency_imports(go_version = go_version)