FS#45210 - [lua] unable to load locally compiled libraries.

Attached to Project: Arch Linux
Opened by Alissa (AlissaSquared) - Friday, 05 June 2015, 02:33 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:24 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Anatol Pomozov (anatolik)
Caleb Maclennan (alerque)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Program `lua` unable to load libraries when libraries are self-compiled or installed to /usr/local/.

Additional info:

Many libraries are not installed directly to /usr/; however, they are instead installed to /usr/local/, due to the fact most authors of libraries expect them to be self-compiled and therefore belong in /usr/local/. However, this represents a problem when a user tries to load a library from there without setting the path directly before starting the interpreter, as the default path when Lua is installed on the system doesn't include /usr/local/. Lua should be able to check /usr/local/lib/ along with /usr/lib/ for libraries installed by the user.

https://www.archlinux.org/packages/extra/x86_64/lua/ version 5.3.0-2


Steps to reproduce:

Locally compile a library, such as LuaFileSystem, nstall to /usr/local/lib/lua/5.3 as per the instructions in Makefile, and attempt to load.
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:24 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/lua/issues/1
Comment by Doug Newgard (Scimmia) - Friday, 05 June 2015, 05:48 GMT
https://aur.archlinux.org/packages/lua-luafilesystem/

If you're doing thing outside of pacman, I would say it's up to you to configure your system to use them.
Comment by Daurnimator (daurnimator) - Friday, 05 June 2015, 06:01 GMT
Most other distros have /usr/local in addition to /usr.
e.g. debian: https://anonscm.debian.org/cgit/pkg-lua/lua5.2.git/tree/debian/patches/0002-debian-paths.patch

This is no different to your $PATH containing both /usr/bin and /usr/local/bin
Comment by Doug Newgard (Scimmia) - Friday, 05 June 2015, 06:08 GMT
Arch is not "Most other distros". Debian specifically seems to be patch-happy.
Comment by Daurnimator (daurnimator) - Friday, 05 June 2015, 06:33 GMT
/me notes that arch already patches out /usr/local for /usr
Instead of the patch swapping it out, it should add a 2nd location.

Having both locations is not unusual, infact it's pretty standard. e.g.:
- $PATH contains /usr/local/bin then /usr/bin
- gcc searches /usr/local/include then /usr/include
- man searches /usr/local/man and /usr/local/share/man and /usr/man and /usr/share/man/
Comment by Alissa (AlissaSquared) - Thursday, 03 September 2015, 01:46 GMT
I have found https://raw.githubusercontent.com/ChickenNuggers/dotfiles/master/.theme/lua.source as a suitable replacement (thanks to Daurnimator) as to Arch properly configuring Lua.

Unfortunately, it looks like at least Python also emits /usr/local from search paths. Seeing as it is not likely this will be changed anytime soon, I'll just leave this as it is.
Comment by abdel (abdel) - Thursday, 09 January 2020, 10:08 GMT
What about AUR package ?
Shouldn't they go in /usr/local folder ?
Comment by Daurnimator (daurnimator) - Thursday, 09 January 2020, 10:22 GMT
@abdel No, installed AUR packages are effectively system packages too. /usr/local is just for things not installed via your OS package manager.
Comment by abdel (abdel) - Thursday, 09 January 2020, 10:37 GMT
Ok. good to know :)
thanks
Comment by Mateusz Gozdek (invidian) - Sunday, 04 April 2021, 10:16 GMT
>Instead of the patch swapping it out, it should add a 2nd location.

This sounds like a reasonable approach to me. Any objections why this cannot be implemented?
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.
Comment by Caleb Maclennan (alerque) - Wednesday, 20 September 2023, 07:07 GMT
@daurnimator Do you still feel the default path should be extended? Personally I would have been inclined to reject this and keep just the system path(s) by default and let the user extend it if they want, but obviously there is some precedent for prepending /usr/local too.
Comment by Daurnimator (daurnimator) - Wednesday, 20 September 2023, 12:12 GMT
@alerque I still think we should add /usr/local.
Comment by Caleb Maclennan (alerque) - Thursday, 05 October 2023, 09:17 GMT
Has bug migration started? Finshed? Test run? Notifications for this issue started turning up here:

https://gitlab.archlinux.org/flyspray-migration/packaging/packages/lua/-/issues/1#note_127580

But I don't see any *other* bugs of mine or signs of migration. Is Flyspray still canonical?
Comment by Caleb Maclennan (alerque) - Thursday, 05 October 2023, 09:18 GMT
@daurimator Okay, I'll play around with a POC for what it will look like to add and see if I turn up any speed bumps.

Loading...