docker-openresty icon indicating copy to clipboard operation
docker-openresty copied to clipboard

Update LuaRocks to 3.12.0

Open Yagich opened this issue 7 months ago • 8 comments

Images using LuaRocks versions 3.11.1 (the current version in certain images, including alpine-fat) and below will suffer issues if they are using the default LuaJIT backend and default LuaRocks.org manifests: https://github.com/luarocks/luarocks/issues/1797

This issue has been fixed in 3.12.0.

Yagich avatar Jun 06 '25 03:06 Yagich

Thanks for reporting this, interesting issue! I'm working on this now.

neomantra avatar Jun 06 '25 16:06 neomantra

Edit: I closed my PR since this issue will be fixed by https://github.com/openresty/docker-openresty/commit/943060ab55d18bc42b5e149b4281bbcf4f601fdf, which is being built now as 1.27.1.2-2.


@neomantra I just opened a PR to fix this: https://github.com/openresty/docker-openresty/pull/277.

I didn't race you intentionally. I started a while ago and didn't see your message until after I finished.

davidthing avatar Jun 06 '25 16:06 davidthing

The fix seems to be working! 😌 For those not following this closely, the root cause was an issue with LuaRocks, not openresty. Many thanks to @neomantra for pulling in the latest LuaRocks so quickly!

luarocks install succeeds using the latest image:

docker run --rm -it --entrypoint /bin/bash openresty/openresty:1.27.1.2-2-jammy -c "luarocks install lua-resty-http"

luarocks install fails using the previous version:

docker run --rm -it --entrypoint /bin/bash openresty/openresty:1.27.1.2-1-jammy -c "luarocks install lua-resty-http"

davidthing avatar Jun 06 '25 18:06 davidthing

The following image tags are released which upgrade LuaRocks to 3.12. Thanks for reporting and thanks to @davidthing for the PR and testing!

  • 1.27.1.2-2
  • 1.25.3.2-5

neomantra avatar Jun 06 '25 20:06 neomantra

Thank you for the fixes!

Yagich avatar Jun 07 '25 00:06 Yagich

I am still facing an issue with luarocks in openresty/openresty:1.27.1.2-2-alpine-fat. Installing packages work without pinning the version but it doesn't if I do pin the version. For example:

# luarocks install lua-resty-session --pin 4.0.3
Installing https://luarocks.org/lua-resty-session-4.0.3-1.src.rock

Missing dependencies for lua-resty-session 4.0.3-1:
   lua_pack >= 2.0.0 (not installed)
   lua-ffi-zlib >= 0.5 (not installed)
   lua-resty-openssl >= 0.8.0 (not installed)

lua-resty-session 4.0.3-1 depends on lua >= 5.1 (5.1-1 provided by VM: success)
lua-resty-session 4.0.3-1 depends on lua_pack >= 2.0.0 (not installed)
Installing https://luarocks.org/lua_pack-2.0.0-0.src.rock

Forcing lua to pinned version 5.1-1
Missing dependencies for lua_pack 2.0.0-0:
Forcing lua to pinned version 5.1-1
   lua 5.1-1 (not installed)

Forcing lua to pinned version 5.1-1
lua_pack 2.0.0-0 depends on lua >= 5.1, < 5.3 (not installed)
Forcing lua to pinned version 5.1-1

Error: Failed installing dependency: https://luarocks.org/lua_pack-2.0.0-0.src.rock - Could not satisfy dependency lua 5.1-1: Rock lua 5.1-1 is already provided by VM or via 'rocks_provided' in the config file.

According to the luarocks team:

Make sure you're using the very latest version: 3.12.2 -- there is an important mitigation for a luajit bug in it.

Any change we could get an upgrade to 3.12.2 instead of 3.12.0?

thomasleplus avatar Jul 25 '25 22:07 thomasleplus

Thanks for the update to this issue. 3.12.0 was supposed to fix that, but happy to update it especially if they suggested so. I just pushed out an upgrade to 3.12.2, but it is not released.

I'm doing some other work on a new release, but you can test this in the meantime like I just did. The doesn't seem to fix the situation, but I note it works with the version pin removed. Curiously, it seems related to Lua version detection and pinning?

I will fold this version into a full release later today.

$ docker run -it --entrypoint=/bin/bash openresty/openresty:alpine-fat



7bfb6bd45a27:/# luarocks --version
/usr/local/openresty/luajit/bin/luarocks 3.12.2
LuaRocks main command-line interface



7bfb6bd45a27:/# luarocks install lua-resty-session --pin 4.0.3
Installing https://luarocks.org/lua-resty-session-4.0.3-1.src.rock

Missing dependencies for lua-resty-session 4.0.3-1:
   lua_pack >= 2.0.0 (not installed)
   lua-ffi-zlib >= 0.5 (not installed)
   lua-resty-openssl >= 0.8.0 (not installed)

lua-resty-session 4.0.3-1 depends on lua >= 5.1 (5.1-1 provided by VM: success)
lua-resty-session 4.0.3-1 depends on lua_pack >= 2.0.0 (not installed)
Installing https://luarocks.org/lua_pack-2.0.0-0.src.rock

Forcing lua to pinned version 5.1-1
Missing dependencies for lua_pack 2.0.0-0:
Forcing lua to pinned version 5.1-1
   lua 5.1-1 (not installed)

Forcing lua to pinned version 5.1-1
lua_pack 2.0.0-0 depends on lua >= 5.1, < 5.3 (not installed)
Forcing lua to pinned version 5.1-1

Error: Failed installing dependency: https://luarocks.org/lua_pack-2.0.0-0.src.rock - Could not satisfy dependency lua 5.1-1: Rock lua 5.1-1 is already provided by VM or via 'rocks_provided' in the config file.




7bfb6bd45a27:/# luarocks install lua-resty-session
Installing https://luarocks.org/lua-resty-session-4.1.2-1.src.rock

Missing dependencies for lua-resty-session 4.1.2-1:
   lua-ffi-zlib >= 0.5 (not installed)
   lua-resty-openssl >= 1.5.0 (not installed)

lua-resty-session 4.1.2-1 depends on lua >= 5.1 (5.1-1 provided by VM: success)
lua-resty-session 4.1.2-1 depends on lua-ffi-zlib >= 0.5 (not installed)
Installing https://luarocks.org/lua-ffi-zlib-0.6-0.src.rock


lua-ffi-zlib 0.6-0 depends on lua >= 5.1 (5.1-1 provided by VM: success)
No existing manifest. Attempting to rebuild...
lua-ffi-zlib 0.6-0 is now installed in /usr/local/openresty/luajit

lua-resty-session 4.1.2-1 depends on lua-resty-openssl >= 1.5.0 (not installed)
Installing https://luarocks.org/lua-resty-openssl-1.6.1-1.src.rock


lua-resty-openssl 1.6.1-1 is now installed in /usr/local/openresty/luajit (license: BSD)

lua-resty-session 4.1.2-1 is now installed in /usr/local/openresty/luajit (license: BSD)

neomantra avatar Jul 29 '25 11:07 neomantra

You are correct, I am still facing the same issue with the latest image shipping 3.12.2. I let the luarocks team know (https://github.com/luarocks/luarocks/issues/1816) and if they release a new fix, I will test if before letting you know. Thanks a lot!

thomasleplus avatar Jul 29 '25 15:07 thomasleplus