Bug 1007000 - On aarch64 lua ships plugins in /usr/lib64/ but loads them from /usr/lib/
Summary: On aarch64 lua ships plugins in /usr/lib64/ but loads them from /usr/lib/
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: lua
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tim Niemueller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-11 17:06 UTC by Marcin Juszkiewicz
Modified: 2014-07-04 16:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-04 16:40:32 UTC
Type: Bug
Embargoed:


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

Description Marcin Juszkiewicz 2013-09-11 17:06:32 UTC
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 20:21:46 UTC
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 20:40:28 UTC
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 08:28:32 UTC
Did a build and my test works as expected now.

Comment 4 Marcin Juszkiewicz 2013-09-12 09:58:05 UTC
Created attachment 796746 [details]
updated spec file

Comment 5 Marcin Juszkiewicz 2013-09-12 09:58:34 UTC
Created attachment 796747 [details]
fix for AArch64 architecture

Comment 6 Marcin Juszkiewicz 2013-09-12 10:04:38 UTC
Created attachment 796748 [details]
Changeset with spec and patch

Comment 7 Marcin Juszkiewicz 2014-07-04 16:40:32 UTC
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.