Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ bazel_dep(name = "envoy_api", version = "1.37.0-dev")
bazel_dep(name = "envoy_build_config", version = "1.37.0-dev")
bazel_dep(name = "envoy_mobile", version = "1.37.0-dev")
bazel_dep(name = "gperftools", version = "2.17.2")
bazel_dep(name = "lz4", version = "1.10.0.bcr.1")
bazel_dep(name = "numactl", version = "2.0.19")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_python", version = "1.6.3")
Expand Down
30 changes: 16 additions & 14 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 81 additions & 0 deletions bazel/external/lz4.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "lz4",
srcs = [
"lib/lz4.c",
"lib/xxhash.c",
"lib/xxhash.h",
],
hdrs = [
"lib/lz4.h",
],
strip_include_prefix = "lib/",
visibility = ["//visibility:public"],
)

cc_library(
name = "lz4_lz4c_include",
hdrs = [
"lib/lz4.c",
],
strip_include_prefix = "lib/",
)

cc_library(
name = "lz4_hc",
srcs = [
"lib/lz4hc.c",
],
hdrs = [
"lib/lz4hc.h",
],
strip_include_prefix = "lib/",
visibility = ["//visibility:public"],
deps = [
":lz4",
":lz4_lz4c_include",
],
)

cc_library(
name = "lz4_file",
srcs = [
"lib/lz4file.c",
],
hdrs = [
"lib/lz4file.h",
],
strip_include_prefix = "lib/",
visibility = ["//:__subpackages__"],
deps = [
":lz4",
":lz4_frame",
],
)

cc_library(
name = "lz4_frame",
srcs = [
"lib/lz4frame.c",
"lib/lz4frame_static.h",
],
hdrs = [
"lib/lz4frame.h",
],
strip_include_prefix = "lib/",
visibility = ["//visibility:public"],
deps = [
":lz4",
":lz4_hc",
],
)

cc_library(
name = "lz4_xxhash_include",
hdrs = [
"lib/xxhash.h",
],
strip_include_prefix = "lib/",
visibility = ["//:__subpackages__"],
)
22 changes: 1 addition & 21 deletions bazel/foreign_cc/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_foreign_cc//foreign_cc:configure.bzl", "configure_make")
load("@rules_foreign_cc//foreign_cc:make.bzl", "make")
load("//bazel:envoy_build_system.bzl", "envoy_cc_library", "envoy_cmake", "envoy_package")

licenses(["notice"]) # Apache 2
Expand Down Expand Up @@ -56,25 +55,6 @@ envoy_cc_library(
}),
)

make(
name = "lz4",
args = [
"MOREFLAGS='-fPIC'",
"BUILD_SHARED=no",
],
lib_source = "@com_github_lz4_lz4//:all",
out_static_libs = [
"liblz4.a",
],
tags = ["skip_on_windows"],
targets = [
"lib",
"install",
],
visibility = ["//visibility:public"],
alwayslink = False,
)

# Kafka client dependency used by Kafka-mesh filter.
# librdkafka build generates extra headers that need to be copied into source to get it to compile.
configure_make(
Expand All @@ -93,7 +73,7 @@ configure_make(
targets = [
"ARFLAGS='' WITH_LDS='n' libs install-subdirs",
],
deps = [":lz4"],
deps = ["@lz4"],
alwayslink = True,
)

Expand Down
8 changes: 4 additions & 4 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def envoy_dependencies(skip_targets = []):
_com_github_intel_qatlib()
_com_github_intel_qatzip()
_com_github_qat_zstd()
_com_github_lz4_lz4()
_lz4()
_com_github_jbeder_yaml_cpp()
_com_github_libevent_libevent()
_com_github_luajit_luajit()
Expand Down Expand Up @@ -412,10 +412,10 @@ def _com_github_qat_zstd():
patches = ["@envoy//bazel/foreign_cc:qatzstd.patch"],
)

def _com_github_lz4_lz4():
def _lz4():
external_http_archive(
name = "com_github_lz4_lz4",
build_file_content = BUILD_ALL_CONTENT,
name = "lz4",
build_file = "@envoy//bazel/external:lz4.BUILD",
)

def _com_github_jbeder_yaml_cpp():
Expand Down
2 changes: 1 addition & 1 deletion bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@ REPOSITORY_LOCATIONS_SPEC = dict(
license = "Apache-2.0",
license_url = "https://github.com/maxmind/libmaxminddb/blob/{version}/LICENSE",
),
com_github_lz4_lz4 = dict(
lz4 = dict(
project_name = "LZ4",
project_desc = "Extremely Fast Compression algorithm",
project_url = "http://www.lz4.org/",
Expand Down
3 changes: 2 additions & 1 deletion contrib/qat/compression/qatzip/compressor/source/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ configure_make(
target_compatible_with = envoy_contrib_linux_x86_64_constraints(),
visibility = ["//visibility:public"],
deps = [
"//bazel/foreign_cc:lz4",
"@lz4",
"@lz4//:lz4_frame",
"@zlib",
"//contrib/qat:qatlib",
# Use boringssl alias to select fips vs non-fips version.
Expand Down