Skip to content

Commit

Permalink
chore(deps): install lua-messagepack 0.5.2 by rock directly (#14061)
Browse files Browse the repository at this point in the history
* chore(deps): install lua-messagepack 0.5.2 by rock directly

since lua-messagepack 0.5.2 has been archived, we can only install it directly via rock.

Fix: [FTI-6417](https://konghq.atlassian.net/browse/FTI-6417)

Please note this is a 3.4 OSS specific commit.

---------

Signed-off-by: tzssangglass <[email protected]>
  • Loading branch information
tzssangglass authored Jan 10, 2025
1 parent 6e2004b commit 3701fd4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
14 changes: 13 additions & 1 deletion build/luarocks/BUILD.luarocks.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,21 @@ EOF
visibility = ["//visibility:public"],
)

genrule(
name = "prepare_lua_messagepack",
srcs = ["@lua_messagepack_src//file"],
outs = ["lua-messagepack-0.5.2-1.src.rock"],
cmd = "cp $(location @lua_messagepack_src//file) $@",
visibility = ["//visibility:public"],
)

genrule(
name = "luarocks_make",
srcs = [
"@kong//:rockspec_srcs",
":luarocks_exec",
":luarocks_target", # to avoid concurrency issue, run this after luarocks_target
":prepare_lua_messagepack",
],
outs = ["luarocks_make.log"],
cmd = """
Expand All @@ -160,7 +169,10 @@ genrule(
# alias LDOC command to true(1) command
export LDOC=true

$(location :luarocks_exec) make --no-doc 2>&1 >[email protected]
# Install lua-messagepack
$(location :luarocks_exec) install $(location :prepare_lua_messagepack) >>[email protected] 2>&1

$(location :luarocks_exec) make --no-doc >>[email protected] 2>&1

# only generate the output when the command succeeds
mv [email protected] $@
Expand Down
10 changes: 9 additions & 1 deletion build/luarocks/luarocks_repositories.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A module defining the third party dependency luarocks"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@kong_bindings//:variables.bzl", "KONG_VAR")

Expand All @@ -17,3 +17,11 @@ def luarocks_repositories():
"https://luarocks.org/releases/luarocks-" + version + ".tar.gz",
],
)

http_file(
name = "lua_messagepack_src",
urls = [
"https://luarocks.org/manifests/fperrad/lua-messagepack-0.5.2-1.src.rock",
],
sha256 = "cbb1b7b12834b7f49fd20621446ec4d76eff67d324b8182b7988324b10830a43",
)

0 comments on commit 3701fd4

Please sign in to comment.