github.com/bazelbuild/rules_go@v0.47.2-0.20240515105122-e7ddb9ea474e/WORKSPACE (about)

     1  workspace(name = "io_bazel_rules_go")
     2  
     3  load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
     4  load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
     5  
     6  # Required by toolchains_protoc.
     7  http_archive(
     8      name = "platforms",
     9      sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee",
    10      urls = [
    11          "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz",
    12          "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz",
    13      ],
    14  )
    15  
    16  # The non-polyfill version of this is needed by rules_proto below.
    17  http_archive(
    18      name = "bazel_features",
    19      sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
    20      strip_prefix = "bazel_features-1.9.1",
    21      url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
    22  )
    23  
    24  load("@bazel_features//:deps.bzl", "bazel_features_deps")
    25  
    26  bazel_features_deps()
    27  
    28  go_rules_dependencies()
    29  
    30  go_register_toolchains(version = "1.21.8")
    31  
    32  http_archive(
    33      name = "rules_proto",
    34      sha256 = "303e86e722a520f6f326a50b41cfc16b98fe6d1955ce46642a5b7a67c11c0f5d",
    35      strip_prefix = "rules_proto-6.0.0",
    36      url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.0/rules_proto-6.0.0.tar.gz",
    37  )
    38  
    39  load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")
    40  
    41  rules_proto_dependencies()
    42  
    43  load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")
    44  
    45  rules_proto_toolchains()
    46  
    47  http_archive(
    48      name = "toolchains_protoc",
    49      sha256 = "1f3cd768bbb92164952301228bac5e5079743843488598f2b17fecd41163cadb",
    50      strip_prefix = "toolchains_protoc-0.2.4",
    51      url = "https://github.com/aspect-build/toolchains_protoc/releases/download/v0.2.4/toolchains_protoc-v0.2.4.tar.gz",
    52  )
    53  
    54  load("@toolchains_protoc//protoc:toolchain.bzl", "protoc_toolchains")
    55  
    56  protoc_toolchains(
    57      name = "protoc_toolchains",
    58      version = "v25.3",
    59  )
    60  
    61  http_archive(
    62      name = "com_google_protobuf",
    63      sha256 = "75be42bd736f4df6d702a0e4e4d30de9ee40eac024c4b845d17ae4cc831fe4ae",
    64      strip_prefix = "protobuf-21.7",
    65      # latest available in BCR, as of 2022-09-30
    66      urls = [
    67          "https://github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz",
    68          "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz",
    69      ],
    70  )
    71  
    72  load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
    73  
    74  protobuf_deps()
    75  
    76  # Used by //tests:buildifier_test.
    77  http_archive(
    78      name = "com_github_bazelbuild_buildtools",
    79      sha256 = "05c3c3602d25aeda1e9dbc91d3b66e624c1f9fdadf273e5480b489e744ca7269",
    80      strip_prefix = "buildtools-6.4.0",
    81      # latest, as of 2023-11-17
    82      urls = ["https://github.com/bazelbuild/buildtools/archive/refs/tags/v6.4.0.tar.gz"],
    83  )
    84  
    85  # For manual testing against an LLVM toolchain.
    86  # Use --crosstool_top=@llvm_toolchain//:toolchain
    87  http_archive(
    88      name = "com_grail_bazel_toolchain",
    89      sha256 = "fb762268ca70ced1a0f65d24f92cd881098afd34990ae5767df0ab325217620e",
    90      strip_prefix = "toolchains_llvm-0.4.4",
    91      urls = ["https://github.com/bazel-contrib/toolchains_llvm/archive/0.4.4.tar.gz"],
    92  )
    93  
    94  load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
    95  
    96  llvm_toolchain(
    97      name = "llvm_toolchain",
    98      llvm_version = "8.0.0",
    99  )
   100  
   101  http_archive(
   102      name = "bazelci_rules",
   103      sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e",
   104      strip_prefix = "bazelci_rules-1.0.0",
   105      url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz",
   106  )
   107  
   108  load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig")
   109  
   110  # Creates a default toolchain config for RBE.
   111  # Use this as is if you are using the rbe_ubuntu16_04 container,
   112  # otherwise refer to RBE docs.
   113  rbe_preconfig(
   114      name = "buildkite_config",
   115      toolchain = "ubuntu1804-bazel-java11",
   116  )
   117  
   118  # Needed for tests and tools
   119  load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
   120  
   121  bazel_skylib_workspace()
   122  
   123  http_archive(
   124      name = "bazel_gazelle",
   125      sha256 = "75df288c4b31c81eb50f51e2e14f4763cb7548daae126817247064637fd9ea62",
   126      urls = [
   127          "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz",
   128          "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz",
   129      ],
   130  )
   131  
   132  load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
   133  
   134  gazelle_dependencies()
   135  
   136  go_repository(
   137      name = "com_github_google_go_github_v36",
   138      importpath = "github.com/google/go-github/v36",
   139      sum = "h1:ndCzM616/oijwufI7nBRa+5eZHLldT+4yIB68ib5ogs=",
   140      version = "v36.0.0",
   141  )
   142  
   143  go_repository(
   144      name = "com_github_google_go_querystring",
   145      importpath = "github.com/google/go-querystring",
   146      sum = "h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=",
   147      version = "v1.1.0",
   148  )
   149  
   150  go_repository(
   151      name = "org_golang_x_mod",
   152      importpath = "golang.org/x/mod",
   153      sum = "h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=",
   154      version = "v0.9.0",
   155  )
   156  
   157  go_repository(
   158      name = "org_golang_x_sync",
   159      importpath = "golang.org/x/sync",
   160      sum = "h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=",
   161      version = "v0.1.0",
   162  )
   163  
   164  go_repository(
   165      name = "org_golang_x_oauth2",
   166      importpath = "golang.org/x/oauth2",
   167      sum = "h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw=",
   168      version = "v0.6.0",
   169  )
   170  
   171  http_archive(
   172      name = "googleapis",
   173      sha256 = "9d1a930e767c93c825398b8f8692eca3fe353b9aaadedfbcf1fca2282c85df88",
   174      strip_prefix = "googleapis-64926d52febbf298cb82a8f472ade4a3969ba922",
   175      urls = [
   176          "https://github.com/googleapis/googleapis/archive/64926d52febbf298cb82a8f472ade4a3969ba922.zip",
   177      ],
   178  )
   179  
   180  go_repository(
   181      name = "org_golang_google_genproto",
   182      build_extra_args = ["-exclude=vendor"],
   183      build_file_generation = "on",
   184      build_file_proto_mode = "disable_global",
   185      importpath = "google.golang.org/genproto",
   186      sum = "h1:S9GbmC1iCgvbLyAokVCwiO6tVIrU9Y7c5oMx1V/ki/Y=",
   187      version = "v0.0.0-20221024183307-1bc688fe9f3e",
   188  )
   189  
   190  # TODO(sluongng): Gazelle v0.25.0 switched to static dependency resolution which cause
   191  # build files generation in external dependencies to wrongly resolve these repositories.
   192  # We should investigate in Gazelle why this happen and fix it.
   193  # For now, use manual mapping as a workaround.
   194  #
   195  # gazelle:repository go_repository name=org_golang_x_tools   importpath=golang.org/x/tools
   196  # gazelle:repository go_repository name=org_golang_x_text    importpath=golang.org/x/text
   197  # gazelle:repository go_repository name=org_golang_x_xerrors importpath=golang.org/x/xerrors
   198  # gazelle:repository go_repository name=org_golang_x_net     importpath=golang.org/x/net
   199  # gazelle:repository go_repository name=org_golang_x_sys     importpath=golang.org/x/sys
   200  # gazelle:repository go_repository name=org_golang_x_crypto  importpath=golang.org/x/crypto
   201  
   202  load("@io_bazel_rules_go//tests/legacy/test_chdir:remote.bzl", "test_chdir_remote")
   203  
   204  test_chdir_remote()
   205  
   206  load("@io_bazel_rules_go//tests/integration/popular_repos:popular_repos.bzl", "popular_repos")
   207  
   208  popular_repos()
   209  
   210  load("@io_bazel_rules_go//tests:grpc_repos.bzl", "grpc_dependencies")
   211  
   212  grpc_dependencies()
   213  
   214  local_repository(
   215      name = "runfiles_remote_test",
   216      path = "tests/core/runfiles/runfiles_remote_test",
   217  )
   218  
   219  # For API doc generation
   220  # This is a dev dependency, users should not need to install it
   221  # so we declare it in the WORKSPACE
   222  http_archive(
   223      name = "io_bazel_stardoc",
   224      sha256 = "3fd8fec4ddec3c670bd810904e2e33170bedfe12f90adf943508184be458c8bb",
   225      urls = [
   226          "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz",
   227          "https://github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz",
   228      ],
   229  )
   230  
   231  load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")
   232  
   233  stardoc_repositories()
   234  
   235  # For testing objc_library interop, users should not need to install it
   236  http_archive(
   237      name = "build_bazel_apple_support",
   238      sha256 = "100d12617a84ebc7ee7a10ecf3b3e2fdadaebc167ad93a21f820a6cb60158ead",
   239      url = "https://github.com/bazelbuild/apple_support/releases/download/1.12.0/apple_support.1.12.0.tar.gz",
   240  )
   241  
   242  load(
   243      "@build_bazel_apple_support//lib:repositories.bzl",
   244      "apple_support_dependencies",
   245  )
   246  
   247  apple_support_dependencies()
   248  
   249  load("@googleapis//:repository_rules.bzl", "switched_rules_by_language")
   250  
   251  switched_rules_by_language(
   252      name = "com_google_googleapis_imports",
   253  )
   254  
   255  # For testing the compatibility with a hermetic cc toolchain. Users should not have to enable it.
   256  http_archive(
   257      name = "hermetic_cc_toolchain",
   258      sha256 = "bd2234acd0837251361be3270d7d3ce599b418be123d902d84762302e31a3014",
   259      strip_prefix = "hermetic_cc_toolchain-13c904dce0cb9b6d07f0d557e6ce3cf7013a562e",
   260      urls = ["https://github.com/uber/hermetic_cc_toolchain/archive/13c904dce0cb9b6d07f0d557e6ce3cf7013a562e.zip"],
   261  )
   262  
   263  load("@hermetic_cc_toolchain//toolchain:defs.bzl", zig_toolchains = "toolchains")
   264  
   265  zig_toolchains(
   266      host_platform_sha256 = {
   267          "linux-aarch64": "12be476ed53c219507e77737dbb7f2a77b280760b8acbc6ba2eaaeb42b7d145e",
   268          "linux-x86_64": "1b1c115c4ccbdc215cc3b07833c7957336d9f5fff816f97e5cafee556a9d8be8",
   269          "macos-aarch64": "3943612c560dd066fba5698968317a146a0f585f6cdaa1e7c1df86685c7c4eaf",
   270          "macos-x86_64": "0c89e5d934ecbf9f4d2dea6e3b8dfcc548a3d4184a856178b3db74e361031a2b",
   271      },
   272      version = "0.11.0-dev.3886+0c1bfe271",
   273  )