Skip to content

Commit 22a94a7

Browse files
oowlflrgh
authored andcommitted
bump(deps): bump ngx_brotli version to master branch
(cherry picked from commit ba99b40)
1 parent f85129c commit 22a94a7

File tree

6 files changed

+47
-6
lines changed

6 files changed

+47
-6
lines changed

.requirements

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ WASMER=3.1.1
1818
WASMTIME=14.0.3
1919
V8=10.5.18
2020

21-
NGX_BROTLI=25f86f0bac1101b6512135eac5f93c49c63609e3 # v1.0.0rc
21+
NGX_BROTLI=a71f9312c2deb28875acc7bacfdd5695a111aa53 # master branch of Jan 23, 2024
22+
BROTLI=ed738e842d2fbdf2d6459e39267a633c4a9b2f5d # master branch of brotli deps submodule of Jan 23, 2024

BUILD.bazel

+13
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,19 @@ config_setting(
123123
visibility = ["//visibility:public"],
124124
)
125125

126+
bool_flag(
127+
name = "brotli",
128+
build_setting_default = True,
129+
)
130+
131+
config_setting(
132+
name = "brotli_flag",
133+
flag_values = {
134+
":brotli": "true",
135+
},
136+
visibility = ["//visibility:public"],
137+
)
138+
126139
config_setting(
127140
name = "debug_linux_flag",
128141
constraint_values = [

build/openresty/BUILD.openresty.bazel

+16-5
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ CONFIGURE_OPTIONS = [
149149
"--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/pcre/lib\"",
150150
"--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/openssl/lib\"",
151151
"--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/luajit/lib\"",
152+
"--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/lib\"",
152153
# Here let's try not having --disable-new-dtags; --disable-new-dtags creates rpath instead of runpath
153154
# note rpath can't handle indirect dependency (nginx -> luajit -> dlopen("other")), so each indirect
154155
# dependency should have its rpath set (luajit, libxslt etc); on the other side, rpath is not
@@ -168,7 +169,6 @@ CONFIGURE_OPTIONS = [
168169
"--add-module=$$EXT_BUILD_ROOT$$/external/lua-kong-nginx-module/stream",
169170
"--add-module=$$EXT_BUILD_ROOT$$/external/lua-resty-lmdb",
170171
"--add-module=$$EXT_BUILD_ROOT$$/external/lua-resty-events",
171-
"--add-module=$$EXT_BUILD_ROOT$$/external/ngx_brotli",
172172
] + select({
173173
"@kong//:aarch64-linux-anylibc-cross": [
174174
"--crossbuild=Linux:aarch64",
@@ -230,6 +230,11 @@ CONFIGURE_OPTIONS = [
230230
"--group=nobody",
231231
],
232232
"//conditions:default": [],
233+
}) + select({
234+
"@kong//:brotli_flag": [
235+
"--add-module=$$EXT_BUILD_ROOT$$/external/ngx_brotli",
236+
],
237+
"//conditions:default": [],
233238
}) + wasmx_configure_options
234239

235240
# TODO: set prefix to populate pid_path, conf_path, log_path etc
@@ -259,10 +264,10 @@ configure_make(
259264
configure_options = CONFIGURE_OPTIONS,
260265
data = [
261266
"@lua-kong-nginx-module//:all_srcs",
262-
"@lua-resty-lmdb//:all_srcs",
263267
"@lua-resty-events//:all_srcs",
264-
"@openresty_binding//:all_srcs",
268+
"@lua-resty-lmdb//:all_srcs",
265269
"@ngx_brotli//:all_srcs",
270+
"@openresty_binding//:all_srcs",
266271
] + select({
267272
"@kong//:wasmx_flag": [
268273
"@ngx_wasm_module//:all_srcs",
@@ -284,9 +289,9 @@ configure_make(
284289
],
285290
visibility = ["//visibility:public"],
286291
deps = [
287-
"@pcre",
288292
"@openresty//:luajit",
289-
"@openssl//:openssl",
293+
"@openssl",
294+
"@pcre",
290295
] + select({
291296
"@kong//:any-cross": [
292297
"@cross_deps_zlib//:zlib",
@@ -299,5 +304,11 @@ configure_make(
299304
"@cross_deps_libxcrypt//:libxcrypt",
300305
],
301306
"//conditions:default": [],
307+
}) + select({
308+
"@kong//:brotli_flag": [
309+
"@brotli//:brotlicommon",
310+
"@brotli//:brotlienc",
311+
],
312+
"//conditions:default": [],
302313
}),
303314
)

build/openresty/brotli/BUILD.bazel

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""A module defining the dependency """
2+
3+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
4+
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
5+
load("@kong_bindings//:variables.bzl", "KONG_VAR")
6+
7+
def brotli_repositories():
8+
maybe(
9+
git_repository,
10+
name = "brotli",
11+
branch = KONG_VAR["BROTLI"],
12+
remote = "https://github.com/google/brotli",
13+
visibility = ["//visibility:public"], # let this to be referenced by openresty build
14+
)

build/openresty/repositories.bzl

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ load("//build/openresty/pcre:pcre_repositories.bzl", "pcre_repositories")
88
load("//build/openresty/openssl:openssl_repositories.bzl", "openssl_repositories")
99
load("//build/openresty/atc_router:atc_router_repositories.bzl", "atc_router_repositories")
1010
load("//build/openresty/wasmx:wasmx_repositories.bzl", "wasmx_repositories")
11+
load("//build/openresty/brotli:brotli_repositories.bzl", "brotli_repositories")
1112

1213
# This is a dummy file to export the module's repository.
1314
_NGINX_MODULE_DUMMY_FILE = """
@@ -23,6 +24,7 @@ def openresty_repositories():
2324
openssl_repositories()
2425
atc_router_repositories()
2526
wasmx_repositories()
27+
brotli_repositories()
2628

2729
openresty_version = KONG_VAR["OPENRESTY"]
2830

0 commit comments

Comments
 (0)