xref: /aosp_15_r20/external/bazelbuild-rules_go/WORKSPACE (revision 9bb1b549b6a84214c53be0924760be030e66b93a)
1workspace(name = "io_bazel_rules_go")
2
3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
5
6go_rules_dependencies()
7
8go_register_toolchains(version = "1.20.2")
9
10http_archive(
11    name = "com_google_protobuf",
12    sha256 = "75be42bd736f4df6d702a0e4e4d30de9ee40eac024c4b845d17ae4cc831fe4ae",
13    strip_prefix = "protobuf-21.7",
14    # latest available in BCR, as of 2022-09-30
15    urls = [
16        "https://github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz",
17        "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz",
18    ],
19)
20
21load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
22
23protobuf_deps()
24
25load("@io_bazel_rules_go//extras:embed_data_deps.bzl", "go_embed_data_dependencies")
26
27go_embed_data_dependencies()
28
29# Used by //tests:buildifier_test.
30http_archive(
31    name = "com_github_bazelbuild_buildtools",
32    sha256 = "ca524d4df8c91838b9e80543832cf54d945e8045f6a2b9db1a1d02eec20e8b8c",
33    strip_prefix = "buildtools-6.0.1",
34    # latest, as of 2023-03-27
35    urls = ["https://github.com/bazelbuild/buildtools/archive/refs/tags/6.0.1.tar.gz"],
36)
37
38# For manual testing against an LLVM toolchain.
39# Use --crosstool_top=@llvm_toolchain//:toolchain
40http_archive(
41    name = "com_grail_bazel_toolchain",
42    sha256 = "d312c8e3a19ff843fce3065bb9ff40964401e8525674c842a5724b939cb6e1ac",
43    strip_prefix = "bazel-toolchain-0.4.4",
44    urls = ["https://github.com/grailbio/bazel-toolchain/archive/0.4.4.tar.gz"],
45)
46
47load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
48
49llvm_toolchain(
50    name = "llvm_toolchain",
51    llvm_version = "8.0.0",
52)
53
54http_archive(
55    name = "bazelci_rules",
56    sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e",
57    strip_prefix = "bazelci_rules-1.0.0",
58    url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz",
59)
60
61load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig")
62
63# Creates a default toolchain config for RBE.
64# Use this as is if you are using the rbe_ubuntu16_04 container,
65# otherwise refer to RBE docs.
66rbe_preconfig(
67    name = "buildkite_config",
68    toolchain = "ubuntu1804-bazel-java11",
69)
70
71# Needed for tests and tools
72load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
73
74bazel_skylib_workspace()
75
76http_archive(
77    name = "bazel_gazelle",
78    sha256 = "727f3e4edd96ea20c29e8c2ca9e8d2af724d8c7778e7923a854b2c80952bc405",
79    urls = [
80        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz",
81        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz",
82    ],
83)
84
85load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
86
87go_repository(
88    name = "com_github_google_go_github_v36",
89    importpath = "github.com/google/go-github/v36",
90    sum = "h1:ndCzM616/oijwufI7nBRa+5eZHLldT+4yIB68ib5ogs=",
91    version = "v36.0.0",
92)
93
94go_repository(
95    name = "com_github_google_go_querystring",
96    importpath = "github.com/google/go-querystring",
97    sum = "h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=",
98    version = "v1.1.0",
99)
100
101go_repository(
102    name = "org_golang_x_mod",
103    importpath = "golang.org/x/mod",
104    sum = "h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=",
105    version = "v0.9.0",
106)
107
108go_repository(
109    name = "org_golang_x_sync",
110    importpath = "golang.org/x/sync",
111    sum = "h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=",
112    version = "v0.1.0",
113)
114
115go_repository(
116    name = "org_golang_x_oauth2",
117    importpath = "golang.org/x/oauth2",
118    sum = "h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw=",
119    version = "v0.6.0",
120)
121
122# TODO(sluongng): Gazelle v0.25.0 switched to static dependency resolution which cause
123# build files generation in external dependencies to wrongly resolve these repositories.
124# We should investigate in Gazelle why this happen and fix it.
125# For now, use manual mapping as a workaround.
126#
127# gazelle:repository go_repository name=org_golang_x_tools   importpath=golang.org/x/tools
128# gazelle:repository go_repository name=org_golang_x_text    importpath=golang.org/x/text
129# gazelle:repository go_repository name=org_golang_x_xerrors importpath=golang.org/x/xerrors
130# gazelle:repository go_repository name=org_golang_x_net     importpath=golang.org/x/net
131# gazelle:repository go_repository name=org_golang_x_sys     importpath=golang.org/x/sys
132# gazelle:repository go_repository name=org_golang_x_crypto  importpath=golang.org/x/crypto
133
134load("@io_bazel_rules_go//tests/legacy/test_chdir:remote.bzl", "test_chdir_remote")
135
136test_chdir_remote()
137
138load("@io_bazel_rules_go//tests/integration/popular_repos:popular_repos.bzl", "popular_repos")
139
140popular_repos()
141
142load("@io_bazel_rules_go//tests:grpc_repos.bzl", "grpc_dependencies")
143
144grpc_dependencies()
145
146gazelle_dependencies()
147
148local_repository(
149    name = "runfiles_remote_test",
150    path = "tests/core/runfiles/runfiles_remote_test",
151)
152
153# For API doc generation
154# This is a dev dependency, users should not need to install it
155# so we declare it in the WORKSPACE
156http_archive(
157    name = "io_bazel_stardoc",
158    sha256 = "3fd8fec4ddec3c670bd810904e2e33170bedfe12f90adf943508184be458c8bb",
159    urls = [
160        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz",
161        "https://github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz",
162    ],
163)
164
165load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")
166
167stardoc_repositories()
168
169# For testing objc_library interop, users should not need to install it
170http_archive(
171    name = "build_bazel_apple_support",
172    sha256 = "77a121a0f5d4cd88824429464ad2bfb54bdc8a3bccdb4d31a6c846003a3f5e44",
173    url = "https://github.com/bazelbuild/apple_support/releases/download/1.4.1/apple_support.1.4.1.tar.gz",
174)
175
176load(
177    "@build_bazel_apple_support//lib:repositories.bzl",
178    "apple_support_dependencies",
179)
180
181apple_support_dependencies()
182