Skip to content

Commit 28d7ea1

Browse files
committed
bazel/patch: Patch aspect lib to resolve external build issue
upstream issue is bazel-contrib/bazel-lib#548 pr is: bazel-contrib/bazel-lib#547 Currently the websites and archive patch this indepenendently This caused a breakage (in all 3) when aspect lib was updated envoyproxy/envoy-website#368 This should prevent that until there is some upstream resolution Signed-off-by: Ryan Northey <[email protected]>
1 parent ceac456 commit 28d7ea1

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

bazel/aspect.patch

+20
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),

bazel/repositories.bzl

+6-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,12 @@ def envoy_dependencies(skip_targets = []):
339339
patches = ["@envoy//bazel:rules_pkg.patch"],
340340
)
341341
external_http_archive("com_github_aignas_rules_shellcheck")
342-
external_http_archive("aspect_bazel_lib")
342+
external_http_archive(
343+
"aspect_bazel_lib",
344+
patch_args = ["-p1"],
345+
patches = ["@envoy//bazel:aspect.patch"],
346+
)
347+
343348
_com_github_fdio_vpp_vcl()
344349

345350
# Unconditional, since we use this only for compiler-agnostic fuzzing utils.

0 commit comments

Comments
 (0)