Dear Maintainer,

As a workaround until LuaJIT gains support for PowerPC, I propose building the python-lupa package with PUC Lua instead of LuaJIT on ppc64 and ppc64el architectures, where LuaJIT
is not supported.

Proposed changes:
Update debian/control to exclude ppc64 and ppc64el from the LuaJIT build dependency:
Build-Depends:
libluajit-5.1-dev [!s390x !alpha !hppa !ia64 !m68k !ppc64 !ppc64el !sh4 !sparc64] | liblua5.1-0-dev,


Apply the attached patch to setup.py, which adds architecture detection to automatically
select PUC Lua on ppc64 and ppc64el by default.


Rationale:
LuaJIT does not support PowerPC 64-bit architectures and causes segmentation faults during package tests. This workaround ensures the package builds successfully on these architectures while maintaining LuaJIT
usage on supported platforms.


Please review the attached patch and let me know if this approach is acceptable for resolving the
LuaJIT issue on ppc64 and ppc64el.

Thanks,
Trupti

On 2026-01-18 17:26, Sebastian Ramacher wrote:
Control: tags -1 ftbfs
Control: severity -1 important

On 2026-01-10 00:37:06 +0530, Trupti wrote:
Source:  python-lupa
Version:  2.4+dfsg-1
Severity: serious
tags : FTBFS
User: [email protected]
Usertags: ppc64el
X-Debbugs-Cc: [email protected]


Dear Maintainer,

pyton-lupa is failed to build on ppc64el with below error:

python-lupa never built on ppc64el. So this bug is of severity important
at most.

Cheers

--- python-lupa-2.4+dfsg.orig/setup.py
+++ python-lupa-2.4+dfsg/setup.py
@@ -153,35 +153,46 @@ def get_lua_build_from_arguments():
 
 
 def find_lua_build(no_luajit=False):
+    # Force PUC Lua on architectures where LuaJIT doesn't work
+    machine = get_machine().lower()
+    unsupported_archs = ['ppc64', 'ppc64le']
+    
+    if any(arch in machine for arch in unsupported_archs):
+        print("Detected %s architecture - LuaJIT not supported" % machine)
+        print("Forcing PUC Lua (lua5.1) instead of LuaJIT")
+        no_luajit = True
+
     # try to find local LuaJIT2 build
-    for filename in os.listdir(basedir):
-        if not filename.lower().startswith('luajit'):
-            continue
-        filepath = os.path.join(basedir, filename, 'src')
-        if not os.path.isdir(filepath):
-            continue
-        libfile = os.path.join(filepath, 'libluajit.a')
-        if os.path.isfile(libfile):
-            print("found LuaJIT build in %s" % filepath)
-            print("building statically")
-            return dict(extra_objects=[libfile],
-                        include_dirs=[filepath])
-        # also check for lua51.lib, the Windows equivalent of libluajit.a
-        for libfile in iglob(os.path.join(filepath, 'lua5?.lib')):
+    if not no_luajit:
+        for filename in os.listdir(basedir):
+            if not filename.lower().startswith('luajit'):
+                continue
+            filepath = os.path.join(basedir, filename, 'src')
+            if not os.path.isdir(filepath):
+                continue
+            libfile = os.path.join(filepath, 'libluajit.a')
             if os.path.isfile(libfile):
-                print("found LuaJIT build in %s (%s)" % (
-                    filepath, os.path.basename(libfile)))
+                print("found LuaJIT build in %s" % filepath)
                 print("building statically")
-                # And return the dll file name too, as we need to
-                # include it in the install directory
                 return dict(extra_objects=[libfile],
-                            include_dirs=[filepath],
-                            libfile=libfile)
-    print("No local build of LuaJIT2 found in lupa directory")
+                            include_dirs=[filepath])
+            # also check for lua51.lib, the Windows equivalent of libluajit.a
+            for libfile in iglob(os.path.join(filepath, 'lua5?.lib')):
+                if os.path.isfile(libfile):
+                    print("found LuaJIT build in %s (%s)" % (
+                        filepath, os.path.basename(libfile)))
+                    print("building statically")
+                    # And return the dll file name too, as we need to
+                    # include it in the install directory
+                    return dict(extra_objects=[libfile],
+                                include_dirs=[filepath],
+                                libfile=libfile)
+        print("No local build of LuaJIT2 found in lupa directory")
 
     # try to find installed LuaJIT2 or Lua
     if no_luajit:
         packages = []
+        print("Skipping LuaJIT, searching for PUC Lua only")
     else:
         packages = [('luajit', '2')]
     packages += [
@@ -209,6 +220,7 @@ def find_lua_build(no_luajit=False):
     return {}
 
 
+
 def no_lua_error():
     error = ("Neither LuaJIT2 nor Lua 5.[1234] were found. Please install "
              "Lua and its development packages, "

Reply via email to