Using Bzlmod
Add to your MODULE.bazel file:
bazel_dep(name = "bazel_lib", version = "0.1.0")Using WORKSPACE (deprecated)
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_lib",
sha256 = "67a14f455af2f987393caf83705419ea473fa8837c6b023aefbbbcf2160d7b8d",
strip_prefix = "bazel-lib-0.1.0",
url = "https://github.com/bazel-contrib/bazel-lib/releases/download/v0.1.0/bazel-lib-v0.1.0.tar.gz",
)
load("@bazel_lib//lib:repositories.bzl", "bazel_lib_dependencies", "bazel_lib_register_toolchains")
# Required bazel-lib dependencies
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
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
New Contributors
Full Changelog: https://github.com/Snowflake-Labs/bazel-lib/commits/v0.1.0