Using Bzlmod with Bazel 6:
- Enable with
common --enable_bzlmod
in.bazelrc
. - Add to your
MODULE.bazel
file:
bazel_dep(name = "aspect_bazel_lib", version = "2.20.0")
Read more about bzlmod: https://blog.aspect.dev/bzlmod
Using WORKSPACE
Paste this snippet into your WORKSPACE
file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_bazel_lib",
sha256 = "3522895fa13b97e8b27e3b642045682aa4233ae1a6b278aad6a3b483501dc9f2",
strip_prefix = "bazel-lib-2.20.0",
url = "https://github.com/bazel-contrib/bazel-lib/releases/download/v2.20.0/bazel-lib-v2.20.0.tar.gz",
)
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "aspect_bazel_lib_register_toolchains")
# Required bazel-lib dependencies
aspect_bazel_lib_dependencies()
# Required rules_shell dependencies
load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")
rules_shell_dependencies()
rules_shell_toolchains()
# Register bazel-lib toolchains
aspect_bazel_lib_register_toolchains()
# Create the host platform repository transitively required by bazel-lib
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@platforms//host:extension.bzl", "host_platform_repo")
maybe(
host_platform_repo,
name = "host_platform",
)
What's Changed
- fix: write_source_file on Windows when workspace is on different drive than the bazel user folder by @malkia in #1121
- fix: Wrap reference to @platforms in Label() by @EdSchouten in #1120
- feat: support $< in expand_variables by @longlho in #1122
- chore(deps): upgrade bsdtar to 3.8.1 by @alexeagle in #1126
New Contributors
- @malkia made their first contribution in #1121
- @EdSchouten made their first contribution in #1120
- @longlho made their first contribution in #1122
Full Changelog: v2.19.4...v2.20.0