Open Begasus opened 1 week ago
If I understood it correctly, .self
is just a symlink to where the package is installed, so normally /boot/system
, but it could be /boot/home/config
when installed as a user package. So it should work just fine.
Or did I misunderstand how these links work?
My guess is that .self
is just a symlink to /boot/system
. I tested with .self
of both Lua 5.4 and Luajit 2.1. The installed Lua packages in /boot/home/config/non-packaged
aren't in .self/non-packaged
.
Hacked around a bit, so far I'm getting this atm:
~> luajit
LuaJIT 2.1.1716656478 -- Copyright (C) 2005-2023 Mike Pall. https://luajit.org/
JIT: ON SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
> require "lfs"
stdin:1: module 'lfs' not found:
no field package.preload['lfs']
no file './lfs.lua'
no file '/boot/system/data/luajit-2.1/lfs.lua'
no file '/boot/system/data/lua/5.1/lfs.lua'
no file '/boot/system/data/lua/5.1/lfs/init.lua'
no file '/boot/home/config/non-packaged/data/lua/5.1/lfs.lua'
no file '/boot/home/config/non-packaged/data/lua/5.1/lfs/init.lua'
no file './lfs.so'
no file '/boot/system/lib/lua/5.1/lfs.so'
no file '/boot/home/config/non-packaged/lib/lua/5.1/lfs.so'
no file '/boot/system/lib/lua/5.1/lfs.so'
no file '/boot/system/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
stdin:1: in main chunk
[C]: at 0xc886b19aa0
Think I'm going to leave it like this for some time, patch seem OK, patch probably not so. :)
~> luajit
LuaJIT 2.1.1716656478 -- Copyright (C) 2005-2023 Mike Pall. https://luajit.org/
JIT: ON SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
> require "lfs"
stdin:1: module 'lfs' not found:
no field package.preload['lfs']
no file './lfs.lua'
no file '/boot/system/data/luajit-2.1/lfs.lua'
no file '/boot/home/config/non-packaged/data/luajit-2.1/lfs.lua'
no file '/boot/system/data/lua/5.1/lfs.lua'
no file '/boot/system/data/lua/5.1/lfs/init.lua'
no file '/boot/home/config/non-packaged/data/lua/5.1/lfs.lua'
no file '/boot/home/config/non-packaged/data/lua/5.1/lfs/init.lua'
no file './lfs.so'
no file '/boot/system/lib/lua/5.1/lfs.so'
no file '/boot/system/lib/lua/5.1/loadall.so'
no file '/boot/home/config/non-packaged/lib/lua/5.1/lfs.so'
no file '/boot/home/config/non-packaged/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
stdin:1: in main chunk
[C]: at 0xd2ecb56aa0
>
Looking into https://github.com/haikuports/haikuports/issues/8874 This revealed that luajit has the same problems when called from Terminal:
You can see that it's looking in .self, where it would never find external installed packages/rocks.