From 021bdbd15441d1c8de3eab1b152bf27789c67f31 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Thu, 7 Mar 2024 17:20:29 -0800 Subject: [PATCH] chore(wasm): rename ngx_wasm_module => ngx_wasmx_module --- build/BUILD.bazel | 6 +++--- build/kong_bindings.bzl | 8 ++++---- build/openresty/BUILD.openresty.bazel | 2 +- build/openresty/wasmx/rules.bzl | 4 ++-- build/openresty/wasmx/wasmx_repositories.bzl | 2 +- kong/conf_loader/parse.lua | 4 ++-- scripts/explain_manifest/config.py | 2 +- scripts/explain_manifest/fixtures/amazonlinux-2-amd64.txt | 4 ++-- .../explain_manifest/fixtures/amazonlinux-2023-amd64.txt | 4 ++-- .../explain_manifest/fixtures/amazonlinux-2023-arm64.txt | 4 ++-- scripts/explain_manifest/fixtures/debian-10-amd64.txt | 4 ++-- scripts/explain_manifest/fixtures/debian-11-amd64.txt | 4 ++-- scripts/explain_manifest/fixtures/debian-12-amd64.txt | 4 ++-- scripts/explain_manifest/fixtures/el7-amd64.txt | 4 ++-- scripts/explain_manifest/fixtures/el8-amd64.txt | 4 ++-- scripts/explain_manifest/fixtures/el9-amd64.txt | 4 ++-- scripts/explain_manifest/fixtures/el9-arm64.txt | 4 ++-- scripts/explain_manifest/fixtures/ubuntu-20.04-amd64.txt | 4 ++-- scripts/explain_manifest/fixtures/ubuntu-22.04-amd64.txt | 4 ++-- scripts/explain_manifest/fixtures/ubuntu-22.04-arm64.txt | 4 ++-- 20 files changed, 40 insertions(+), 40 deletions(-) diff --git a/build/BUILD.bazel b/build/BUILD.bazel index 2e8f1682b9f1..25dbfe41ba9a 100644 --- a/build/BUILD.bazel +++ b/build/BUILD.bazel @@ -49,8 +49,8 @@ install_webui_cmd = select({ install_wasm_deps_cmd = select({ "@kong//:wasmx_flag": """ - for fname in $(locations @ngx_wasm_module//:lua_libs); do - base=${fname##*/ngx_wasm_module/lib/} + for fname in $(locations @ngx_wasmx_module//:lua_libs); do + base=${fname##*/ngx_wasmx_module/lib/} dest="${BUILD_DESTDIR}/openresty/lualib/$base" mkdir -p "$(dirname "$dest")" cp -v "$fname" "$dest" @@ -97,7 +97,7 @@ kong_directory_genrule( ], }) + select({ "@kong//:wasmx_flag": [ - "@ngx_wasm_module//:lua_libs", + "@ngx_wasmx_module//:lua_libs", "@openresty//:wasm_runtime", ], "//conditions:default": [], diff --git a/build/kong_bindings.bzl b/build/kong_bindings.bzl index 90353230f942..fa23119d2704 100644 --- a/build/kong_bindings.bzl +++ b/build/kong_bindings.bzl @@ -61,11 +61,11 @@ def _load_vars(ctx): content += '"OPENRESTY_PATCHES": [%s],' % (", ".join(patches)) - ngx_wasm_module_remote = ctx.os.environ.get("NGX_WASM_MODULE_REMOTE", "https://github.com/Kong/ngx_wasm_module.git") - content += '"NGX_WASM_MODULE_REMOTE": "%s",' % ngx_wasm_module_remote + ngx_wasmx_module_remote = ctx.os.environ.get("NGX_WASM_MODULE_REMOTE", "https://github.com/Kong/ngx_wasm_module.git") + content += '"NGX_WASM_MODULE_REMOTE": "%s",' % ngx_wasmx_module_remote - ngx_wasm_module_branch = ctx.os.environ.get("NGX_WASM_MODULE_BRANCH", "") - content += '"NGX_WASM_MODULE_BRANCH": "%s",' % ngx_wasm_module_branch + ngx_wasmx_module_branch = ctx.os.environ.get("NGX_WASM_MODULE_BRANCH", "") + content += '"NGX_WASM_MODULE_BRANCH": "%s",' % ngx_wasmx_module_branch ctx.file("BUILD.bazel", "") ctx.file("variables.bzl", "KONG_VAR = {\n" + content + "\n}") diff --git a/build/openresty/BUILD.openresty.bazel b/build/openresty/BUILD.openresty.bazel index f840a650a63d..936110e45c55 100644 --- a/build/openresty/BUILD.openresty.bazel +++ b/build/openresty/BUILD.openresty.bazel @@ -270,7 +270,7 @@ configure_make( "@openresty_binding//:all_srcs", ] + select({ "@kong//:wasmx_flag": [ - "@ngx_wasm_module//:all_srcs", + "@ngx_wasmx_module//:all_srcs", # wasm_runtime has to be a "data" (target) instead of "build_data" (exec) # to be able to lookup by its path (relative to INSTALLDIR) ":wasm_runtime", diff --git a/build/openresty/wasmx/rules.bzl b/build/openresty/wasmx/rules.bzl index 4e2b2efc570f..97865a7d78b4 100644 --- a/build/openresty/wasmx/rules.bzl +++ b/build/openresty/wasmx/rules.bzl @@ -16,11 +16,11 @@ wasmx_configure_options = select({ "//conditions:default": [], }) + select({ "@kong//:wasmx_static_mod": [ - "--add-module=$$EXT_BUILD_ROOT$$/external/ngx_wasm_module", + "--add-module=$$EXT_BUILD_ROOT$$/external/ngx_wasmx_module", ], "@kong//:wasmx_dynamic_mod": [ "--with-compat", - "--add-dynamic-module=$$EXT_BUILD_ROOT$$/external/ngx_wasm_module", + "--add-dynamic-module=$$EXT_BUILD_ROOT$$/external/ngx_wasmx_module", ], "//conditions:default": [], }) diff --git a/build/openresty/wasmx/wasmx_repositories.bzl b/build/openresty/wasmx/wasmx_repositories.bzl index 24365507d05f..0d2f626bb249 100644 --- a/build/openresty/wasmx/wasmx_repositories.bzl +++ b/build/openresty/wasmx/wasmx_repositories.bzl @@ -58,7 +58,7 @@ def wasmx_repositories(): wasm_module_branch = KONG_VAR["NGX_WASM_MODULE"] new_git_repository( - name = "ngx_wasm_module", + name = "ngx_wasmx_module", branch = wasm_module_branch, remote = KONG_VAR["NGX_WASM_MODULE_REMOTE"], build_file_content = """ diff --git a/kong/conf_loader/parse.lua b/kong/conf_loader/parse.lua index a4775b2f6709..eeeac125c25d 100644 --- a/kong/conf_loader/parse.lua +++ b/kong/conf_loader/parse.lua @@ -845,9 +845,9 @@ local function check_and_parse(conf, opts) errors[#errors + 1] = err end - if conf.wasm and check_dynamic_module("ngx_wasm_module") then + if conf.wasm and check_dynamic_module("ngx_wasmx_module") then local err - conf.wasm_dynamic_module, err = lookup_dynamic_module_so("ngx_wasm_module", conf) + conf.wasm_dynamic_module, err = lookup_dynamic_module_so("ngx_wasmx_module", conf) if err then errors[#errors + 1] = err end diff --git a/scripts/explain_manifest/config.py b/scripts/explain_manifest/config.py index 370c87643a8f..131f61dad278 100644 --- a/scripts/explain_manifest/config.py +++ b/scripts/explain_manifest/config.py @@ -22,7 +22,7 @@ def transform(f: FileInfo): f.runpath = expected_rpath # otherwise remain unmodified - if f.path.endswith("/modules/ngx_wasm_module.so"): + if f.path.endswith("/modules/ngx_wasmx_module.so"): expected_rpath = "/usr/local/openresty/luajit/lib:/usr/local/kong/lib:/usr/local/openresty/lualib" if f.rpath and expected_rpath in f.rpath: f.rpath = expected_rpath diff --git a/scripts/explain_manifest/fixtures/amazonlinux-2-amd64.txt b/scripts/explain_manifest/fixtures/amazonlinux-2-amd64.txt index 9c1876426ff7..58bce910f670 100644 --- a/scripts/explain_manifest/fixtures/amazonlinux-2-amd64.txt +++ b/scripts/explain_manifest/fixtures/amazonlinux-2-amd64.txt @@ -174,7 +174,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libdl.so.2 - libm.so.6 @@ -202,7 +202,7 @@ - lua-resty-events - lua-resty-lmdb - ngx_brotli - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/amazonlinux-2023-amd64.txt b/scripts/explain_manifest/fixtures/amazonlinux-2023-amd64.txt index 1767598eebbe..23c8f07c567b 100644 --- a/scripts/explain_manifest/fixtures/amazonlinux-2023-amd64.txt +++ b/scripts/explain_manifest/fixtures/amazonlinux-2023-amd64.txt @@ -164,7 +164,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libm.so.6 - libgcc_s.so.1 @@ -188,7 +188,7 @@ - lua-resty-events - lua-resty-lmdb - ngx_brotli - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/amazonlinux-2023-arm64.txt b/scripts/explain_manifest/fixtures/amazonlinux-2023-arm64.txt index 320540e5c77b..0c21f6338a99 100644 --- a/scripts/explain_manifest/fixtures/amazonlinux-2023-arm64.txt +++ b/scripts/explain_manifest/fixtures/amazonlinux-2023-arm64.txt @@ -146,7 +146,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libm.so.6 - libgcc_s.so.1 @@ -169,7 +169,7 @@ - lua-kong-nginx-module/stream - lua-resty-events - lua-resty-lmdb - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/debian-10-amd64.txt b/scripts/explain_manifest/fixtures/debian-10-amd64.txt index 3ee40f75e369..8c717069d615 100644 --- a/scripts/explain_manifest/fixtures/debian-10-amd64.txt +++ b/scripts/explain_manifest/fixtures/debian-10-amd64.txt @@ -174,7 +174,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libdl.so.2 - libm.so.6 @@ -202,7 +202,7 @@ - lua-resty-events - lua-resty-lmdb - ngx_brotli - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/debian-11-amd64.txt b/scripts/explain_manifest/fixtures/debian-11-amd64.txt index 4387961f6e57..63ff912a9513 100644 --- a/scripts/explain_manifest/fixtures/debian-11-amd64.txt +++ b/scripts/explain_manifest/fixtures/debian-11-amd64.txt @@ -163,7 +163,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libdl.so.2 - libm.so.6 @@ -191,7 +191,7 @@ - lua-resty-events - lua-resty-lmdb - ngx_brotli - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/debian-12-amd64.txt b/scripts/explain_manifest/fixtures/debian-12-amd64.txt index e47f94f75ffe..199749ff81c5 100644 --- a/scripts/explain_manifest/fixtures/debian-12-amd64.txt +++ b/scripts/explain_manifest/fixtures/debian-12-amd64.txt @@ -154,7 +154,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libm.so.6 - libgcc_s.so.1 @@ -178,7 +178,7 @@ - lua-resty-events - lua-resty-lmdb - ngx_brotli - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/el7-amd64.txt b/scripts/explain_manifest/fixtures/el7-amd64.txt index d64e38063985..3724e68614bc 100644 --- a/scripts/explain_manifest/fixtures/el7-amd64.txt +++ b/scripts/explain_manifest/fixtures/el7-amd64.txt @@ -174,7 +174,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libdl.so.2 - libm.so.6 @@ -201,7 +201,7 @@ - lua-kong-nginx-module/stream - lua-resty-events - lua-resty-lmdb - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/el8-amd64.txt b/scripts/explain_manifest/fixtures/el8-amd64.txt index 32b4666f539d..d27b15850ccd 100644 --- a/scripts/explain_manifest/fixtures/el8-amd64.txt +++ b/scripts/explain_manifest/fixtures/el8-amd64.txt @@ -173,7 +173,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libdl.so.2 - libm.so.6 @@ -201,7 +201,7 @@ - lua-resty-events - lua-resty-lmdb - ngx_brotli - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/el9-amd64.txt b/scripts/explain_manifest/fixtures/el9-amd64.txt index e6bc2c9d3b65..28f3047b1cb7 100644 --- a/scripts/explain_manifest/fixtures/el9-amd64.txt +++ b/scripts/explain_manifest/fixtures/el9-amd64.txt @@ -164,7 +164,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libm.so.6 - libgcc_s.so.1 @@ -188,7 +188,7 @@ - lua-resty-events - lua-resty-lmdb - ngx_brotli - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/el9-arm64.txt b/scripts/explain_manifest/fixtures/el9-arm64.txt index 320540e5c77b..0c21f6338a99 100644 --- a/scripts/explain_manifest/fixtures/el9-arm64.txt +++ b/scripts/explain_manifest/fixtures/el9-arm64.txt @@ -146,7 +146,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libm.so.6 - libgcc_s.so.1 @@ -169,7 +169,7 @@ - lua-kong-nginx-module/stream - lua-resty-events - lua-resty-lmdb - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/ubuntu-20.04-amd64.txt b/scripts/explain_manifest/fixtures/ubuntu-20.04-amd64.txt index 34cad3f9fdf9..9b346da59c8f 100644 --- a/scripts/explain_manifest/fixtures/ubuntu-20.04-amd64.txt +++ b/scripts/explain_manifest/fixtures/ubuntu-20.04-amd64.txt @@ -167,7 +167,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libdl.so.2 - libm.so.6 @@ -195,7 +195,7 @@ - lua-resty-events - lua-resty-lmdb - ngx_brotli - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/ubuntu-22.04-amd64.txt b/scripts/explain_manifest/fixtures/ubuntu-22.04-amd64.txt index 0c565edc151d..77d0ab4be01a 100644 --- a/scripts/explain_manifest/fixtures/ubuntu-22.04-amd64.txt +++ b/scripts/explain_manifest/fixtures/ubuntu-22.04-amd64.txt @@ -158,7 +158,7 @@ Needed : - libc.so.6 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libm.so.6 - libgcc_s.so.1 @@ -182,7 +182,7 @@ - lua-resty-events - lua-resty-lmdb - ngx_brotli - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True diff --git a/scripts/explain_manifest/fixtures/ubuntu-22.04-arm64.txt b/scripts/explain_manifest/fixtures/ubuntu-22.04-arm64.txt index 5ba824549c97..28a22626734f 100644 --- a/scripts/explain_manifest/fixtures/ubuntu-22.04-arm64.txt +++ b/scripts/explain_manifest/fixtures/ubuntu-22.04-arm64.txt @@ -155,7 +155,7 @@ - libc.so.6 - ld-linux-aarch64.so.1 -- Path : /usr/local/openresty/nginx/modules/ngx_wasm_module.so +- Path : /usr/local/openresty/nginx/modules/ngx_wasmx_module.so Needed : - libm.so.6 - libgcc_s.so.1 @@ -180,7 +180,7 @@ - lua-resty-events - lua-resty-lmdb - ngx_brotli - - ngx_wasm_module + - ngx_wasmx_module OpenSSL : OpenSSL 3.2.1 30 Jan 2024 DWARF : True DWARF - ngx_http_request_t related DWARF DIEs: True