Releases: bazel-contrib/bazel-lib
v1.39.0
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 = "1.39.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 = "4d6010ca5e3bb4d7045b071205afa8db06ec11eb24de3f023d74d77cca765f66",
strip_prefix = "bazel-lib-1.39.0",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.39.0/bazel-lib-v1.39.0.tar.gz",
)
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
Optional toolchains:
# Register the following toolchain to use jq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")
register_jq_toolchains()
# Register the following toolchain to use yq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_yq_toolchains")
register_yq_toolchains()
What's Changed
Full Changelog: v1.38.1...v1.39.0
v2.0.1
🎉 Welcome to the first major release of bazel-lib since 1.0, which was released in June 2022.
We've carefully followed semver to this point, which means we couldn't make any breaking changes for the last 16 months.
To keep the project healthy, we have to occasionally clean up old code, so this release has the accumulated breaking changes.
BREAKING CHANGES
We no longer officially support Bazel 5. We encourage users to upgrade to Bazel 6.
We no longer provide a workaround for Bazel 5 users to get a @local_config_platform
repository.
If you need this, you must upgrade to Bazel 6.
JavaScript developers must upgrade to rules_js v1.34.0 and rules_ts v2.1.0.
Toolchains:
- Toolchains are no longer automatically registered for WORKSPACE users. Users must call the
aspect_bazel_lib_register_toolchains
macro or call theregister_[xyz]_toolchain
macros individually. See snippets in the release notes below. - The
host
repository has been moved from the extensionext
into a differed module extension named host.
jq:
We now run jq version 1.7, which includes a Linux arm64 binary.
- jq stamp variables are now of the form
$stamp[0].MY_VARIABLE
rather than$stamp.MY_VARIABLE
.
Starlark APIs:
- The
exclude_prefixes
attribute is removed fromcopy_to_directory
andcopy_to_directory_bin_action
. Users should useexclude_srcs_patterns
with glob patterns instead. - The
to_workspace_path
helper function is removed frompaths
. Usepaths.to_repository_relative_path
instead. - The
to_manifest_path
helper function is removed from paths. Usepaths.to_rlocation_path
instead. output_dir
is removed fromexpand_variables
. Pass output directory/tree artifacts toouts
instead.output_dir
is removed fromrun_binary
. Useout_dirs
instead.- The
copy_file_action
helper now uses the coreutils toolchain to perform a copy. - The
copy_directory_action
helper is removed. Usecopy_directory_bin_action
instead. - The
copy_to_directory_action
helper has been removed. Usecopy_to_directory_bin_action
action instead. - The load for
expand_template
has moved from@aspect_bazel_lib//lib:expand_make_vars.bzl
to@aspect_bazel_lib//lib:expand_template.bzl
.
New Features
- We have a hermetic
tar
rule. Read more: https://github.com/aspect-build/bazel-lib/blob/main/docs/tar.md
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.0.1")
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 = "4b32cf6feab38b887941db022020eea5a49b848e11e3d6d4d18433594951717a",
strip_prefix = "bazel-lib-2.0.1",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.0.1/bazel-lib-v2.0.1.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()
# Register bazel-lib toolchains
aspect_bazel_lib_register_toolchains()
What's Changed
- fix: exclude bazeliskrc from smoke test by @kormide in #654
- fix(ci): fix bzlmod issues and enable on ci by @kormide in #658
- fix: fix a bug where toolchain repositories were potentially duplicated by @kormide in #662
- feat: expose toolchains used for copy actions by @kormide in #661
- fix: remove need for rules_go when depending on a bzl_library target (#663) by @kormide in #664
Full Changelog: v2.0.0...v2.0.1
v1.38.1
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 = "1.38.1")
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 = "262e3d6693cdc16dd43880785cdae13c64e6a3f63f75b1993c716295093d117f",
strip_prefix = "bazel-lib-1.38.1",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.38.1/bazel-lib-v1.38.1.tar.gz",
)
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
Optional toolchains:
# Register the following toolchain to use jq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")
register_jq_toolchains()
# Register the following toolchain to use yq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_yq_toolchains")
register_yq_toolchains()
What's Changed
Full Changelog: v1.38.0...v1.38.1
v1.38.0
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 = "1.38.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 = "b848cd8e93be7f18c3deda6d2f3ade92a657d3585e119953bc50dc75fef535c2",
strip_prefix = "bazel-lib-1.38.0",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.38.0/bazel-lib-v1.38.0.tar.gz",
)
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
Optional toolchains:
# Register the following toolchain to use jq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")
register_jq_toolchains()
# Register the following toolchain to use yq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_yq_toolchains")
register_yq_toolchains()
What's Changed
- Fix bzlmod (#600) by @kormide in #660
- fix(ci): fix bzlmod issues and enable on ci (#658) by @kormide in #659
- feat: backport 2.x features for interoperability by @kormide in #657
Full Changelog: v1.37.0...v1.38.0
v2.0.0
⚠️ This release has some compatibility issues with rules_js and rules_ts which are fixed in bazel-lib v2.0.1.
Please upgrade to 2.0.1, and see release notes there.
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.0.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 = "c4f36285ceed51f75da44ffcf8fa393794d0dc2e273a2e03be50462e347740cd",
strip_prefix = "bazel-lib-2.0.0",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.0.0/bazel-lib-v2.0.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()
# Register bazel-lib toolchains
aspect_bazel_lib_register_toolchains()
What's Changed
- chore: upgrade to Aspect Workflows 5.8.0-rc9 by @gregmagolan in #557
- chore: upgrade to Aspect Workflows 5.8.0-rc11 by @gregmagolan in #558
- chore: update to Aspect CLI 5.7.2 by @gregmagolan in #559
- feat: add assert_directory_contains test to testing.bzl by @gregmagolan in #560
- feat: add undeclared output mode to expand_template by @gregmagolan in #561
- fix(ci): don't run patch on windows by @alexeagle in #562
- chore: update pre-commit buildifier by @alexeagle in #563
- chore(deps): update dependency buildifier_prebuilt to v6.3.3 by @renovate in #489
- chore: bump to latest version of Aspect Workflows starter image by @gregmagolan in #571
- fix: register tar toolchain for bzlmod users by @alexeagle in #574
- chore: remove expand_template re-export by @kormide in #580
- chore: run CI on 2.x branch by @kormide in #581
- Avoid expanding mtree spec during analysis phase by @dzbarsky in #576
- fix: fix bad import by @kormide in #583
- chore: drop Bazel 5 support for 2.0 by @alexeagle in #585
- chore: run gazelle by @alexeagle in #584
- chore: check gazelle on CI by @alexeagle in #586
- chore: remove legacy copy_to_directory_action by @kormide in #582
- chore: remove is_windows attributes by @alexeagle in #587
- refactor: remove legacy copy_directory_action helper by @gregmagolan in #589
- refactor: remove output_dir from run_binary and expand_variables by @gregmagolan in #588
- refactor: remove to_workspace_path and to_manifest_path from paths by @gregmagolan in #590
- refactor: remove exclude_prefixes from copy_to_directory and copy_to_directory_bin_action by @gregmagolan in #591
- chore: fix tar_toolchain naming by @alexeagle in #599
- Fix bzlmod by @alexeagle in #600
- feat: expose a config_setting for copy execution_requirements by @alexeagle in #606
- feat: tar includes runfiles by @alexeagle in #595
- refactor: rework toolchain registration for WORKSPACE and bzlmod users by @kormide in #597
- refactor: use _mtree_line helper by @alexeagle in #612
- chore: add windows binaries by @alexeagle in #610
- chore: upgrade to Aspect Workflows 5.8.0 by @gregmagolan in #617
- chore: remove useless check for stamped binary by @alexeagle in #618
- Update ci.yaml by @alexeagle in #619
- chore: remove bazel5 presets by @kormide in #614
- Unconditionally use runfiles.merge_all in write_source_file by @dzbarsky in #623
- chore: tweak CCI config yaml by @gregmagolan in #627
- chore: upgrade to Aspect Workflows 5.8.2 by @gregmagolan in #628
- chore: update buildifier targets used by Aspect Workflows by @gregmagolan in #629
- feat: support treeartifacts (#630) by @alexeagle in #631
- chore: don't run legacy pipeline when warming by @gregmagolan in #634
- chore: upgrade to Aspect Workflows 5.8.3 by @gregmagolan in #635
- fix: fix execution requirements for 'build without the bytes' by @gregmagolan in #639
- Revert: feat: expose a config_setting for copy execution_requirements (#606) by @gregmagolan in #640
- refactor: move 'git archive' configuration to .gitattributes by @alexeagle in #641
- fix(deps): update module github.com/bmatcuk/doublestar/v4 to v4.6.1 by @renovate in #633
- chore: green up Windows CI by @gregmagolan in #643
- chore: update bcr maintainer list by @kormide in #644
- chore: upgrade to Aspect Workflows 5.8.7 by @gregmagolan in #646
- Upgrade coreutils and add darwin arm64 binary by @dzbarsky in #649
- Use coreutils toolchain for copy_file action by @dzbarsky in #622
Full Changelog: v1.35.0...v2.0.0
v1.37.0
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 = "1.37.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 = "ce259cbac2e94a6dff01aff9455dcc844c8af141503b02a09c2642695b7b873e",
strip_prefix = "bazel-lib-1.37.0",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.37.0/bazel-lib-v1.37.0.tar.gz",
)
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
Optional toolchains:
# Register the following toolchain to use jq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")
register_jq_toolchains()
# Register the following toolchain to use yq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_yq_toolchains")
register_yq_toolchains()
What's Changed
- chore: upgrade to Aspect Workflows 5.8.0-rc12 by @gregmagolan in #596
- chore: upgrade to Aspect Workflows 5.8.0-rc14 by @gregmagolan in #598
- feat: expose a config_setting for copy execution_requirements (#606) by @alexeagle in #607
- fix: always include files from the same workspace as the build target in
copy_to_directory()
by @dgp1130 in #360 - fix: windows home directory by @alexeagle in #608
Full Changelog: v1.36.0...v1.37.0
v2.0.0-rc1
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.0.0-rc1")
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 = "a185ccff9c1b8589c63f66d7eb908de15c5d6bb05562be5f46336c53e7a7326a",
strip_prefix = "bazel-lib-2.0.0-rc1",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.0.0-rc1/bazel-lib-v2.0.0-rc1.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()
# Register bazel-lib toolchains
aspect_bazel_lib_register_toolchains()
What's Changed
- chore: upgrade to Aspect Workflows 5.8.0 by @gregmagolan in #617
- chore: remove useless check for stamped binary by @alexeagle in #618
- Update ci.yaml by @alexeagle in #619
- chore: remove bazel5 presets by @kormide in #614
- Unconditionally use runfiles.merge_all in write_source_file by @dzbarsky in #623
- chore: tweak CCI config yaml by @gregmagolan in #627
- chore: upgrade to Aspect Workflows 5.8.2 by @gregmagolan in #628
- chore: update buildifier targets used by Aspect Workflows by @gregmagolan in #629
- feat: support treeartifacts (#630) by @alexeagle in #631
Full Changelog: v2.0.0-rc0...v2.0.0-rc1
v2.0.0-rc0
Don't use. Release 2.0.0 is now available.
v2.0.0-beta1
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.0.0-beta1")
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 = "dd56b26e25c4d4647c24ed67fc93ab8b60b1d8eafd20df2651becfab0bccc342",
strip_prefix = "bazel-lib-2.0.0-beta1",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.0.0-beta1/bazel-lib-v2.0.0-beta1.tar.gz",
)
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
Optional toolchains:
# Register the following toolchain to use jq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")
register_jq_toolchains()
# Register the following toolchain to use yq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_yq_toolchains")
register_yq_toolchains()
What's Changed
- fix: register tar toolchain for bzlmod users by @alexeagle in #574
- chore: remove expand_template re-export by @kormide in #580
- chore: run CI on 2.x branch by @kormide in #581
- Avoid expanding mtree spec during analysis phase by @dzbarsky in #576
- fix: fix bad import by @kormide in #583
- chore: drop Bazel 5 support for 2.0 by @alexeagle in #585
- chore: run gazelle by @alexeagle in #584
- chore: check gazelle on CI by @alexeagle in #586
- chore: remove legacy copy_to_directory_action by @kormide in #582
- chore: remove is_windows attributes by @alexeagle in #587
- refactor: remove legacy copy_directory_action helper by @gregmagolan in #589
- refactor: remove output_dir from run_binary and expand_variables by @gregmagolan in #588
- refactor: remove to_workspace_path and to_manifest_path from paths by @gregmagolan in #590
- refactor: remove exclude_prefixes from copy_to_directory and copy_to_directory_bin_action by @gregmagolan in #591
- chore: fix tar_toolchain naming by @alexeagle in #599
- Fix bzlmod by @alexeagle in #600
- feat: expose a config_setting for copy execution_requirements by @alexeagle in #606
- feat: tar includes runfiles by @alexeagle in #595
Full Changelog: v2.0.0-beta0...v2.0.0-beta1
v1.36.0
📣 NOTE
v1.34.1 introduced a regression in performance for copying files, in particular users of rules_js with a large number of npm dependencies would be affected. This is now fixed in this release.
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 = "1.36.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 = "cbf473d630ab67b36461d83b38fdc44e56f45b78d03c405e4958280211124d79",
strip_prefix = "bazel-lib-1.36.0",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.36.0/bazel-lib-v1.36.0.tar.gz",
)
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
Optional toolchains:
# Register the following toolchain to use jq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")
register_jq_toolchains()
# Register the following toolchain to use yq
load("@aspect_bazel_lib//lib:repositories.bzl", "register_yq_toolchains")
register_yq_toolchains()
What's Changed
- chore: upgrade to Aspect Workflows 5.8.0-rc9 by @gregmagolan in #557
- chore: upgrade to Aspect Workflows 5.8.0-rc11 by @gregmagolan in #558
- chore: update to Aspect CLI 5.7.2 by @gregmagolan in #559
- feat: add assert_directory_contains test to testing.bzl by @gregmagolan in #560
- feat: add undeclared output mode to expand_template by @gregmagolan in #561
- fix(ci): don't run patch on windows by @alexeagle in #562
- chore: update pre-commit buildifier by @alexeagle in #563
- chore(deps): update dependency buildifier_prebuilt to v6.3.3 by @renovate in #489
- chore: bump to latest version of Aspect Workflows starter image by @gregmagolan in #571
- feat(presets): always fetch all coverage files on coverage runs by @kormide in #564
- Revert "refactor: reduce execution requirements for copy" by @alexeagle in #594
Full Changelog: v1.35.0...v1.36.0