From 2b45a45410ba2d7be353c7ef3c4dc349c2c7c900 Mon Sep 17 00:00:00 2001 From: tzssangglass Date: Fri, 27 Dec 2024 17:03:25 +0800 Subject: [PATCH 1/2] 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) Signed-off-by: tzssangglass --- build/luarocks/BUILD.luarocks.bazel | 12 ++++++++++++ build/luarocks/luarocks_repositories.bzl | 10 +++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/build/luarocks/BUILD.luarocks.bazel b/build/luarocks/BUILD.luarocks.bazel index 658066651c8..86ed307f42e 100644 --- a/build/luarocks/BUILD.luarocks.bazel +++ b/build/luarocks/BUILD.luarocks.bazel @@ -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 = """ @@ -160,6 +169,9 @@ genrule( # alias LDOC command to true(1) command export LDOC=true + # Install lua-messagepack + $(location :luarocks_exec) install $(location :prepare_lua_messagepack) 2>&1 >$@.tmp + $(location :luarocks_exec) make --no-doc 2>&1 >$@.tmp # only generate the output when the command succeeds diff --git a/build/luarocks/luarocks_repositories.bzl b/build/luarocks/luarocks_repositories.bzl index de37ea9ee07..fcf3f265089 100644 --- a/build/luarocks/luarocks_repositories.bzl +++ b/build/luarocks/luarocks_repositories.bzl @@ -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") @@ -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", + ) From 63837b3db5f64cccd74685e5be71e6b246392c19 Mon Sep 17 00:00:00 2001 From: tzssangglass Date: Mon, 6 Jan 2025 11:06:55 +0800 Subject: [PATCH 2/2] apply comments Signed-off-by: tzssangglass --- build/luarocks/BUILD.luarocks.bazel | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/luarocks/BUILD.luarocks.bazel b/build/luarocks/BUILD.luarocks.bazel index 86ed307f42e..17f8f6fa1c4 100644 --- a/build/luarocks/BUILD.luarocks.bazel +++ b/build/luarocks/BUILD.luarocks.bazel @@ -170,9 +170,9 @@ genrule( export LDOC=true # Install lua-messagepack - $(location :luarocks_exec) install $(location :prepare_lua_messagepack) 2>&1 >$@.tmp + $(location :luarocks_exec) install $(location :prepare_lua_messagepack) >>$@.tmp 2>&1 - $(location :luarocks_exec) make --no-doc 2>&1 >$@.tmp + $(location :luarocks_exec) make --no-doc >>$@.tmp 2>&1 # only generate the output when the command succeeds mv $@.tmp $@