Skip to content

Commit

Permalink
Fix hessian2_codec Envoy dependency builds in Dalec
Browse files Browse the repository at this point in the history
It's not immediately clear why in Dalec hessian2_codec does not build
successfully, while using Envoy CI Docker image it builds just fine.

However, it's pretty clear to me that hessian2 repo contains an issue
with Bazel build rules and fixing it resolves the Dalec build problem.

I've sent a patch to the upstream hessian2_codec repository (see
alibaba/hessian2-codec#37). The patch, if
accepted will fix the problem for future versions of Envoy, but in 1.32
we are stuck with this issue.

Signed-off-by: Mikhail Krinkin <krinkin.m.u@gmail.com>
  • Loading branch information
krinkinmu committed Jan 3, 2025
1 parent 5966de2 commit c926bd7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
21 changes: 21 additions & 0 deletions bazel/foreign_cc/hessian2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/hessian2/basic_codec/BUILD b/hessian2/basic_codec/BUILD
index 65587d7..4ffd22c 100644
--- a/hessian2/basic_codec/BUILD
+++ b/hessian2/basic_codec/BUILD
@@ -203,8 +203,6 @@ cc_library(
srcs = [
"class_instance_codec.cc",
"class_instance_codec.hpp",
- "def_ref_codec.cc",
- "def_ref_codec.hpp",
"list_codec.cc",
"list_codec.hpp",
"map_codec.cc",
@@ -217,6 +215,7 @@ cc_library(
":bool_codec_lib",
":byte_codec_lib",
":date_codec_lib",
+ ":def_ref_codec_lib",
":number_codec_lib",
":ref_object_codec_lib",
":string_codec_lib",
6 changes: 5 additions & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,11 @@ def _com_github_nlohmann_json():
)

def _com_github_alibaba_hessian2_codec():
external_http_archive("com_github_alibaba_hessian2_codec")
external_http_archive(
name = "com_github_alibaba_hessian2_codec",
patches = ["@envoy//bazel/foreign_cc:hessian2.patch"],
patch_args = ["-p1"],
)

def _com_github_ncopa_suexec():
external_http_archive(
Expand Down

0 comments on commit c926bd7

Please sign in to comment.