Skip to content

Commit 7ef81ff

Browse files
committed
bazel-registry: aspect_bazel_lib@2.16.0.envoy
Signed-off-by: Ryan Northey <ryan@synca.io>
1 parent 6ad2a32 commit 7ef81ff

File tree

5 files changed

+155
-0
lines changed

5 files changed

+155
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"aspect-build/bazel-lib"
2+
3+
module(
4+
name = "aspect_bazel_lib",
5+
bazel_compatibility = [">=6.5.0"],
6+
compatibility_level = 1,
7+
version = "2.16.0.envoy",
8+
)
9+
10+
# Lower-bounds (minimum) versions for direct runtime dependencies
11+
bazel_dep(name = "bazel_features", version = "1.9.0")
12+
bazel_dep(name = "bazel_skylib", version = "1.8.1")
13+
bazel_dep(name = "platforms", version = "0.0.10")
14+
bazel_dep(name = "stardoc", version = "0.7.1")
15+
bazel_dep(name = "rules_shell", version = "0.4.1")
16+
17+
# TODO(3.0): remove this back-compat
18+
bazel_dep(name = "jq.bzl", version = "0.1.0")
19+
bazel_dep(name = "yq.bzl", version = "0.1.1")
20+
bazel_dep(name = "tar.bzl", version = "0.5.1")
21+
22+
bazel_lib_toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")
23+
bazel_lib_toolchains.copy_directory()
24+
bazel_lib_toolchains.copy_to_directory()
25+
bazel_lib_toolchains.jq()
26+
bazel_lib_toolchains.yq()
27+
bazel_lib_toolchains.coreutils()
28+
bazel_lib_toolchains.tar()
29+
bazel_lib_toolchains.zstd()
30+
bazel_lib_toolchains.expand_template()
31+
bazel_lib_toolchains.bats()
32+
use_repo(bazel_lib_toolchains, "bats_toolchains", "bsd_tar_toolchains", "copy_directory_toolchains", "copy_to_directory_toolchains", "coreutils_toolchains", "expand_template_toolchains", "jq", "jq_toolchains", "yq", "yq_toolchains", "zstd_toolchains")
33+
34+
register_toolchains(
35+
"@copy_directory_toolchains//:all",
36+
"@copy_to_directory_toolchains//:all",
37+
"@jq_toolchains//:all",
38+
"@yq_toolchains//:all",
39+
"@coreutils_toolchains//:all",
40+
"@expand_template_toolchains//:all",
41+
"@bats_toolchains//:all",
42+
"@bsd_tar_toolchains//:all",
43+
"@zstd_toolchains//:all",
44+
)
45+
46+
####### Dev dependencies ########
47+
48+
# To allow /tools to be built from source
49+
# NOTE: when publishing to BCR, we patch this to be dev_dependency, as we publish pre-built binaries
50+
# along with our releases.
51+
bazel_dep(name = "rules_go", version = "0.50.1", dev_dependency = True, repo_name = "io_bazel_rules_go")
52+
bazel_dep(name = "gazelle", version = "0.41.1", dev_dependency = True, repo_name = "bazel_gazelle")
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"aspect-build/bazel-lib"
2+
3+
module(
4+
name = "aspect_bazel_lib",
5+
bazel_compatibility = [">=6.5.0"],
6+
compatibility_level = 1,
7+
version = "2.16.0.envoy",
8+
)
9+
10+
# Lower-bounds (minimum) versions for direct runtime dependencies
11+
bazel_dep(name = "bazel_features", version = "1.9.0")
12+
bazel_dep(name = "bazel_skylib", version = "1.8.1")
13+
bazel_dep(name = "platforms", version = "0.0.10")
14+
bazel_dep(name = "stardoc", version = "0.7.1")
15+
bazel_dep(name = "rules_shell", version = "0.4.1")
16+
17+
# TODO(3.0): remove this back-compat
18+
bazel_dep(name = "jq.bzl", version = "0.1.0")
19+
bazel_dep(name = "yq.bzl", version = "0.1.1")
20+
bazel_dep(name = "tar.bzl", version = "0.5.1")
21+
22+
bazel_lib_toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")
23+
bazel_lib_toolchains.copy_directory()
24+
bazel_lib_toolchains.copy_to_directory()
25+
bazel_lib_toolchains.jq()
26+
bazel_lib_toolchains.yq()
27+
bazel_lib_toolchains.coreutils()
28+
bazel_lib_toolchains.tar()
29+
bazel_lib_toolchains.zstd()
30+
bazel_lib_toolchains.expand_template()
31+
bazel_lib_toolchains.bats()
32+
use_repo(bazel_lib_toolchains, "bats_toolchains", "bsd_tar_toolchains", "copy_directory_toolchains", "copy_to_directory_toolchains", "coreutils_toolchains", "expand_template_toolchains", "jq", "jq_toolchains", "yq", "yq_toolchains", "zstd_toolchains")
33+
34+
register_toolchains(
35+
"@copy_directory_toolchains//:all",
36+
"@copy_to_directory_toolchains//:all",
37+
"@jq_toolchains//:all",
38+
"@yq_toolchains//:all",
39+
"@coreutils_toolchains//:all",
40+
"@expand_template_toolchains//:all",
41+
"@bats_toolchains//:all",
42+
"@bsd_tar_toolchains//:all",
43+
"@zstd_toolchains//:all",
44+
)
45+
46+
####### Dev dependencies ########
47+
48+
# To allow /tools to be built from source
49+
# NOTE: when publishing to BCR, we patch this to be dev_dependency, as we publish pre-built binaries
50+
# along with our releases.
51+
bazel_dep(name = "rules_go", version = "0.50.1", dev_dependency = True, repo_name = "io_bazel_rules_go")
52+
bazel_dep(name = "gazelle", version = "0.41.1", dev_dependency = True, repo_name = "bazel_gazelle")
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/lib/private/yq.bzl b/lib/private/yq.bzl
2+
index 29ca3d7..c8cd5eb 100644
3+
--- a/lib/private/yq.bzl
4+
+++ b/lib/private/yq.bzl
5+
@@ -71,10 +71,13 @@ def _yq_impl(ctx):
6+
7+
# For split operations, yq outputs files in the same directory so we
8+
# must cd to the correct output dir before executing it
9+
- bin_dir = "/".join([ctx.bin_dir.path, ctx.label.package]) if ctx.label.package else ctx.bin_dir.path
10+
+ bin_dir = ctx.bin_dir.path
11+
+ if ctx.label.workspace_name:
12+
+ bin_dir = "%s/external/%s" % (bin_dir, ctx.label.workspace_name)
13+
+ bin_dir = "/".join([bin_dir, ctx.label.package]) if ctx.label.package else bin_dir
14+
escape_bin_dir = _escape_path(bin_dir)
15+
cmd = "cd {bin_dir} && {yq} {args} {eval_cmd} {expression} {sources} {maybe_out}".format(
16+
- bin_dir = ctx.bin_dir.path + "/" + ctx.label.package,
17+
+ bin_dir = bin_dir,
18+
yq = escape_bin_dir + yq_bin.path,
19+
eval_cmd = "eval" if len(inputs) <= 1 else "eval-all",
20+
args = " ".join(args),
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
matrix:
2+
platform:
3+
- debian11
4+
- macos
5+
- ubuntu2404
6+
bazel:
7+
- 8.x
8+
9+
tasks:
10+
verify_targets:
11+
platform: ${{ platform }}
12+
bazel: ${{ bazel }}
13+
build_targets:
14+
- "@aspect_bazel_lib//lib:lib"
15+
- "@aspect_bazel_lib//lib:copy_to_directory"
16+
- "@aspect_bazel_lib//lib:copy_directory"
17+
- "@aspect_bazel_lib//lib:jq"
18+
- "@aspect_bazel_lib//lib:yq"
19+
- "@aspect_bazel_lib//lib:tar"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"integrity": "sha256-CS+EHdnqjnNuqDTzBId6JRkKdi0PCmyO2sn5SqyLvxY=",
3+
"strip_prefix": "bazel-lib-2.16.0",
4+
"url": "https://github.com/aspect-build/bazel-lib/archive/v2.16.0.tar.gz",
5+
"patch_strip": 1,
6+
"patches": {
7+
"aspect.patch": "sha256-bBrJAHyNBWppp9t9PUGt/fpFdGf+HepS40N/1tvRzAo="
8+
},
9+
"overlay": {
10+
"MODULE.bazel": "sha256-eMQc7A3JTG6OuPahTNUjklgPCigj30I8RPG+036xCgA="
11+
}
12+
}

0 commit comments

Comments
 (0)