Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): install lua-messagepack 0.5.2 by rock directly #14061

Merged
merged 2 commits into from
Jan 10, 2025
Merged
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
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",
)
Loading