Skip to content

Commit

Permalink
chore(bazel): add MODULE.bazel files for bzlmod
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 committed Mar 1, 2024
1 parent 6fb29c6 commit e5b7d04
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
common --enable_bzlmod
13 changes: 13 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module(
name = "envoy_build_tools",
version = "",
)

bazel_dep(name = "bazel_skylib", version = "1.3.0")
# -- bazel_dep definitions -- #

non_module_deps = use_extension("//:non_module_deps.bzl", "non_module_deps")
use_repo(non_module_deps, "bazel_toolchains")

bazel_toolchains_ext = use_extension("//:bazel_toolchains_ext.bzl", "bazel_toolchains_ext")
use_repo(bazel_toolchains_ext, "rbe_default")
Empty file added WORKSPACE.bzlmod
Empty file.
6 changes: 6 additions & 0 deletions bazel_toolchains_ext.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
load("@bazel_toolchains//repositories:repositories.bzl","repositories")

def _bazel_toolchains_ext_impl(ctx):
repositories()

bazel_toolchains_ext = module_extension(implementation = _bazel_toolchains_ext_impl)
11 changes: 11 additions & 0 deletions non_module_deps.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

def _non_module_deps_impl(ctx):
http_archive(
name = "bazel_toolchains",
sha256 = "02e4f3744f1ce3f6e711e261fd322916ddd18cccd38026352f7a4c0351dbda19",
strip_prefix = "bazel-toolchains-5.1.2",
urls = ["https://github.com/bazelbuild/bazel-toolchains/archive/refs/tags/v5.1.2.tar.gz"],
)

non_module_deps = module_extension(implementation = _non_module_deps_impl)

0 comments on commit e5b7d04

Please sign in to comment.