Bug 1007000 - On aarch64 lua ships plugins in /usr/lib64/ but loads them from /usr/lib/
On aarch64 lua ships plugins in /usr/lib64/ but loads them from /usr/lib/
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: lua (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tim Niemueller
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-11 13:06 EDT by Marcin Juszkiewicz
Modified: 2014-07-04 12:40 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-07-04 12:40:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
updated spec file (8.22 KB, text/plain)
2013-09-12 05:58 EDT, Marcin Juszkiewicz
no flags Details
fix for AArch64 architecture (599 bytes, patch)
2013-09-12 05:58 EDT, Marcin Juszkiewicz
no flags Details | Diff
Changeset with spec and patch (3.33 KB, patch)
2013-09-12 06:04 EDT, Marcin Juszkiewicz
no flags Details | Diff

  None (edit)
Description Marcin Juszkiewicz 2013-09-11 13:06:32 EDT
Description of problem:

On AArch64 architecture Lua stores all plugins in /usr/lib64/ directory. But when plugins are requested by Lua script they can not be loaded and things fail (for example build of 'awesome' package).

Version-Release number of selected component (if applicable):

5.1.4-12.fc19

How reproducible:

Always.


Steps to Reproduce:
1. Install "lua-penlight" package
2. Run "lua"
3. type: require "pl.path"

Actual results:

[builder@model-1 rpmbuild]$ lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> > require "pl.path"
/usr/share/lua/5.1/pl/path.lua:30: pl.path requires LuaFileSystem
stack traceback:
        [C]: in function 'error'
        /usr/share/lua/5.1/pl/path.lua:30: in main chunk
        [C]: in function 'require'
        stdin:1: in main chunk
        [C]: ?

Expected results:

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require "pl.path"
> 

Additional info:
Why it fails?

I used strace on lua:

[builder@model-1]$ grep lfs /tmp/log
openat(AT_FDCWD, "./lfs.lua", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lua/5.1/lfs.lua", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/lua/5.1/lfs/init.lua", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/lua/5.1/lfs.lua", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/lua/5.1/lfs/init.lua", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "./lfs.so", O_RDONLY)  = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/lua/5.1/lfs.so", O_RDONLY) = -1 ENOENT (No such file or directory)

the lfs.so file is in filesystem but in other place:

[builder@model-1 rpmbuild]$ find / -name lfs.so 2>/dev/null
/usr/lib64/lua/5.1/lfs.so
Comment 1 Mark Salter 2013-09-11 16:21:46 EDT
Ah, I think this should fix it:

diff --git a/lua-5.1.4-autotoolize.patch b/lua-5.1.4-autotoolize.patch
index afcb3fb..8b57bb1 100644
--- a/lua-5.1.4-autotoolize.patch
+++ b/lua-5.1.4-autotoolize.patch
@@ -41813,7 +41813,7 @@ diff -urN lua-5.1.4/src/luaconf.h.template.in lua-5.1.4-autotoolize/src/luaconf.
 +/** autotools-patch **/
 +#define LUA_LDIR	"%lua_datadir%/lua/5.1/"
 +#if defined __alpha__ || defined __ia64__ || defined __powerpc64__ || \
-+    defined __s390x__ || defined __sparc64__ || defined __x86_64__
++    defined __s390x__ || defined __sparc64__ || defined __x86_64__ || defined __aarch64__
 +#define LUA_CDIR	"/usr/lib64/lua/5.1/"
 +#else
 +#define LUA_CDIR	"/usr/lib/lua/5.1/"
Comment 2 Marcin Juszkiewicz 2013-09-11 16:40:28 EDT
Mark: yes, that is proper fix - doing test build now.

Lua 5.2.2 (rawhide) does not need that patch as they use @libdir like it should be done.
Comment 3 Marcin Juszkiewicz 2013-09-12 04:28:32 EDT
Did a build and my test works as expected now.
Comment 4 Marcin Juszkiewicz 2013-09-12 05:58:05 EDT
Created attachment 796746 [details]
updated spec file
Comment 5 Marcin Juszkiewicz 2013-09-12 05:58:34 EDT
Created attachment 796747 [details]
fix for AArch64 architecture
Comment 6 Marcin Juszkiewicz 2013-09-12 06:04:38 EDT
Created attachment 796748 [details]
Changeset with spec and patch
Comment 7 Marcin Juszkiewicz 2014-07-04 12:40:32 EDT
rawhide upgraded to 5.2.2 so no issue

Note You need to log in before you can comment on or make changes to this bug.