Skip to content

Commit ce0f49d

Browse files
committed
fix(upgrate-tests): use lua5.4 for luarocks
1 parent 746f301 commit ce0f49d

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/lua5.4
2+
package.loaded["luarocks.core.hardcoded"] = { SYSCONFDIR = [[/usr/local/etc/luarocks]], LUA_VERSION = "5.1" }
3+
package.path=[[/usr/local/share/lua/5.1/?.lua;]] .. package.path
4+
local list = package.searchers or package.loaders; table.insert(list, 1, function(name) if name:match("^luarocks%.") then return loadfile([[/usr/local/share/lua/5.1/]] .. name:gsub([[%.]], [[/]]) .. [[.lua]]) end end)
5+
6+
-- Load cfg first so that the loader knows it is running inside LuaRocks
7+
local cfg = require("luarocks.core.cfg")
8+
9+
local loader = require("luarocks.loader")
10+
local cmd = require("luarocks.cmd")
11+
12+
local description = "LuaRocks main command-line interface"
13+
14+
local commands = {
15+
init = "luarocks.cmd.init",
16+
pack = "luarocks.cmd.pack",
17+
unpack = "luarocks.cmd.unpack",
18+
build = "luarocks.cmd.build",
19+
install = "luarocks.cmd.install",
20+
search = "luarocks.cmd.search",
21+
list = "luarocks.cmd.list",
22+
remove = "luarocks.cmd.remove",
23+
make = "luarocks.cmd.make",
24+
download = "luarocks.cmd.download",
25+
path = "luarocks.cmd.path",
26+
show = "luarocks.cmd.show",
27+
new_version = "luarocks.cmd.new_version",
28+
lint = "luarocks.cmd.lint",
29+
write_rockspec = "luarocks.cmd.write_rockspec",
30+
purge = "luarocks.cmd.purge",
31+
doc = "luarocks.cmd.doc",
32+
upload = "luarocks.cmd.upload",
33+
config = "luarocks.cmd.config",
34+
which = "luarocks.cmd.which",
35+
test = "luarocks.cmd.test",
36+
}
37+
38+
cmd.run_command(description, commands, "luarocks.cmd.external", ...)

scripts/upgrade-tests/test-upgrade-path.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ function build_containers() {
9090
[ -d worktree/$OLD_KONG_VERSION ] || git worktree add worktree/$OLD_KONG_VERSION $OLD_KONG_VERSION
9191
$COMPOSE up --wait
9292
prepare_container $OLD_CONTAINER
93+
# the following two lines will not be needed on 3.11+
94+
docker exec -u 0 apt-get install -y lua5.4
95+
docker cp scripts/upgrade-tests/luarocks-lua54 $OLD_CONTAINER:/usr/local/bin/luarocks
9396
docker exec -w /kong $OLD_CONTAINER make $old_make_target CRYPTO_DIR=/usr/local/kong
9497
make dev-legacy CRYPTO_DIR=/usr/local/kong
9598
}

0 commit comments

Comments
 (0)