Bug 268303 - devel/llvm*: update lua to 5.4
Summary: devel/llvm*: update lua to 5.4
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-10 18:43 UTC by Brooks Davis
Modified: 2022-12-13 12:03 UTC (History)
2 users (show)

See Also:


Attachments
update lua deps from "lua:53" to "lua:53+" (3.43 KB, patch)
2022-12-10 19:09 UTC, Vladimir Druzenko
no flags Details | Diff
update lua deps from "lua:53" to "lua:53+" v2 (6.21 KB, patch)
2022-12-10 20:48 UTC, Vladimir Druzenko
vvd: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brooks Davis freebsd_committer freebsd_triage 2022-12-10 18:43:30 UTC
Default lua is now 5.4, try to update llvm ports
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2022-12-10 19:09:09 UTC
Created attachment 238698 [details]
update lua deps from "lua:53" to "lua:53+"

Need testing.

Compiling llvm15: [ 79% 6532/8259]
Build all 5 ports (12, 13, 14, 15, -devel) - it's ~2 days for me.
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2022-12-10 20:13:49 UTC
pkg-static: Unable to access file /tmp/work/usr/ports/devel/llvm15/work/stage/usr/local/llvm15/lib/lua/5.3/lldb.so:No such file or directory

pkg-plist need fix in this line:
%%LLDB%%llvm%%LLVM_SUFFIX%%/lib/lua/5.3/lldb.so
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2022-12-10 20:48:50 UTC
Created attachment 238700 [details]
update lua deps from "lua:53" to "lua:53+" v2

Fixed plist for 14, 15 and -devel.

Test build of 15 in progress…
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2022-12-11 00:28:44 UTC
pkg-static: Unable to access file /tmp/work/usr/ports/devel/llvm15/work/stage/usr/local/llvm15/lib/lua/5.4/lldb.so:No such file or directory

There are no dir /tmp/work/usr/ports/devel/llvm15/work/stage/usr/local/llvm15/lib/lua

Need more "investigation"…
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2022-12-11 10:12:46 UTC
13 build fine. I think 12 can build fine too.

BTW, LLVM_DEFAULT is still 9.0:
# Possible values: 70, 80, 90, 10, 11, 12, 13, 14, -devel (to be used when non-base compiler is required)
# Please give notice to the Graphics Team (x11@FreeBSD.org) in advance before
# bumping the LLVM version.
.  if ${ARCH} == powerpc
LLVM_DEFAULT?=          10
.  else
LLVM_DEFAULT?=          90
.  endif

Time to updated default to something newer - 13 or 14 or 15.
Last 9.x release was 3 years ago.
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2022-12-11 11:07:18 UTC
Configure log diff with 5.3 and 5.4:

--- llvm15_lua53.configure
+++ llvm15_lua54.configure
@@ -15,7 +15,7 @@
 ===>   llvm15-15.0.6_2 depends on file: /usr/local/bin/python3.10 - found
 ===>   llvm15-15.0.6_2 depends on package: perl5>=5.32.r0<5.33 - found
 ===>   llvm15-15.0.6_2 depends on shared library: libzstd.so - found (/usr/local/lib/libzstd.so)
-===>   llvm15-15.0.6_2 depends on shared library: liblua-5.3.so - found (/usr/local/lib/liblua-5.3.so)
+===>   llvm15-15.0.6_2 depends on shared library: liblua-5.4.so - found (/usr/local/lib/liblua-5.4.so)
 ===>   llvm15-15.0.6_2 depends on shared library: libedit.so.0 - found (/usr/local/lib/libedit.so.0)
 ===>   llvm15-15.0.6_2 depends on shared library: libxml2.so - found (/usr/local/lib/libxml2.so)
 ===>  Configuring for llvm15-15.0.6_2
@@ -319,9 +319,9 @@
 -- Found LibLZMA: /usr/lib/liblzma.so (found version "5.2.5")
 -- Enable LZMA compression support in LLDB: TRUE
 -- Found SWIG: /usr/local/bin/swig (found suitable version "4.0.2", minimum required is "3.0")
--- Found Lua: /usr/local/lib/liblua-5.3.so;/usr/lib/libm.so (found suitable exact version "5.3.6")
--- Found LuaAndSwig: /usr/local/lib/liblua-5.3.so;/usr/lib/libm.so
--- Enable Lua scripting support in LLDB: TRUE
+-- Could NOT find Lua (missing: LUA_INCLUDE_DIR) (Required is exact version "5.3")
+-- Could NOT find LuaAndSwig (missing: LUA_INCLUDE_DIR)
+-- Enable Lua scripting support in LLDB: FALSE
 -- Found Python3: /usr/local/bin/python3.10 (found version "3.10.9") found components: Interpreter Development Development.Module Development.Embed
 -- Found PythonAndSwig: /usr/local/lib/libpython3.10.so
 -- Enable Python scripting support in LLDB: TRUE
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2022-12-11 13:24:40 UTC
Patches for llvm15:
==========================================================
--- lldb/cmake/modules/FindLuaAndSwig.cmake.orig
+++ lldb/cmake/modules/FindLuaAndSwig.cmake
@@ -9,7 +9,7 @@
 else()
   find_package(SWIG 3.0)
   if (SWIG_FOUND)
-    find_package(Lua 5.3 EXACT)
+    find_package(Lua 5.4 EXACT)
     if(LUA_FOUND AND SWIG_FOUND)
       mark_as_advanced(
         LUA_LIBRARIES
--- lldb/CMakeLists.txt.orig
+++ lldb/CMakeLists.txt
@@ -65,8 +65,8 @@
 endif ()
 
 if (LLDB_ENABLE_LUA)
-  find_program(Lua_EXECUTABLE lua5.3)
-  set(LLDB_LUA_DEFAULT_RELATIVE_PATH "lib/lua/5.3")
+  find_program(Lua_EXECUTABLE lua5.4)
+  set(LLDB_LUA_DEFAULT_RELATIVE_PATH "lib/lua/5.4")
   set(LLDB_LUA_RELATIVE_PATH ${LLDB_LUA_DEFAULT_RELATIVE_PATH}
     CACHE STRING "Path where Lua modules are installed, relative to install prefix")
 endif ()
--- test/API/lua_api/TestLuaAPI.py.orig
+++ test/API/lua_api/TestLuaAPI.py
@@ -160,7 +160,7 @@
         test_output = self.getBuildArtifact("output")
         test_input = self.getBuildArtifact("input")
 
-        lua_lldb_cpath = "%s/lua/5.3/?.so" % configuration.lldb_libs_dir
+        lua_lldb_cpath = "%s/lua/5.4/?.so" % configuration.lldb_libs_dir
 
         lua_prelude = "package.cpath = '%s;' .. package.cpath" % lua_lldb_cpath
 
==========================================================
Maybe better to keep possibility to build with lua53 too.
But I don't know how yet.
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2022-12-11 14:22:50 UTC
Incorrect path here:
--- test/API/lua_api/TestLuaAPI.py.orig
+++ test/API/lua_api/TestLuaAPI.py
Must be:
--- lldb/test/API/lua_api/TestLuaAPI.py.orig
+++ lldb/test/API/lua_api/TestLuaAPI.py
============================================
make check-plist
[  9% 775/8266]
Need 2-3 hours…
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2022-12-11 18:10:42 UTC
Yes, patch work fine. At least build without errors. Need run test.
Comment 10 Graham Perrin freebsd_committer freebsd_triage 2022-12-11 18:20:10 UTC
brooks@ would you like to take this (in progress)?
Comment 11 Brooks Davis freebsd_committer freebsd_triage 2022-12-12 21:26:17 UTC
I'm somewhat skeptical that we can safely update LLVM's Lua use to 5.4 given that's it is hardcoded in the build files.  We'll at least need to verify that the scripts included in lldb actually load or work.

FWIW, I can't find any discussion of Lua 5.4 on the LLVM discourse.
Comment 12 Vladimir Druzenko freebsd_committer freebsd_triage 2022-12-13 12:03:51 UTC
(In reply to Brooks Davis from comment #11)
Ye, but lua54 build with "-DLUA_COMPAT_5_3" - so it can work fine with scripts for 5.3.