From 3701fd466e813b27a2c084fde60dbaea1a2e9933 Mon Sep 17 00:00:00 2001 From: kurt Date: Fri, 10 Jan 2025 10:44:07 +0800 Subject: [PATCH] chore(deps): install lua-messagepack 0.5.2 by rock directly (#14061) * 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 --- build/luarocks/BUILD.luarocks.bazel | 14 +++++++++++++- build/luarocks/luarocks_repositories.bzl | 10 +++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/build/luarocks/BUILD.luarocks.bazel b/build/luarocks/BUILD.luarocks.bazel index 658066651c8..17f8f6fa1c4 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,7 +169,10 @@ genrule( # alias LDOC command to true(1) command export LDOC=true - $(location :luarocks_exec) make --no-doc 2>&1 >$@.tmp + # Install lua-messagepack + $(location :luarocks_exec) install $(location :prepare_lua_messagepack) >>$@.tmp 2>&1 + + $(location :luarocks_exec) make --no-doc >>$@.tmp 2>&1 # only generate the output when the command succeeds mv $@.tmp $@ 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", + )