Zerobrane does not access environment

81 views Asked by At

I am moving to Debian 10 from Ubuntu 20.04. Now Lua 5.3 is not finding my own modules using "require". Worked fine on Ubuntu before, I suspect I am missing something now...

Pointers are most welcome! Thanks

in ~/.bashrc I have copied from the previous installation:

export LUA_PATH_5_3="/home/martin/lua/?.lua;;"
export LUA_PATH="/home/martin/lua/?.lua;;"

when running a compile I get that, so it is not looking into the correct folder

module 'weeknumber' not found:
no field package.preload['weeknumber']
no file '/usr/local/share/lua/5.3/weeknumber.lua'
no file '/usr/local/share/lua/5.3/weeknumber/init.lua'
no file '/usr/local/lib/lua/5.3/weeknumber.lua'
no file '/usr/local/lib/lua/5.3/weeknumber/init.lua'
no file './weeknumber.lua'
no file './weeknumber/init.lua'
no file './weeknumber.lua'
no file './weeknumber/init.lua'
no file './lua/weeknumber.lua'
no file './lua/weeknumber/init.lua'
no file '/opt/zbstudio/lualibs/weeknumber/weeknumber.lua'
no file '/opt/zbstudio/lualibs/weeknumber.lua'
no file '/opt/zbstudio/lualibs/weeknumber/weeknumber/init.lua'
no file '/opt/zbstudio/lualibs/weeknumber/init.lua'
no file '/opt/zbstudio/lualibs/weeknumber.lua'
no file '/opt/zbstudio/lualibs/weeknumber/weeknumber.lua'
no file '/opt/zbstudio/lualibs/weeknumber/init.lua'
no file '/usr/local/lib/lua/5.3/weeknumber.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './weeknumber.so'
no file '/opt/zbstudio/bin/linux/x64/clibs53/weeknumber.so'
no file '/opt/zbstudio/bin/linux/x64/clibs53/libweeknumber.so'

testing with

print ( os.getenv("PATH"))
print ( os.getenv("LUA_PATH_5_3"))
print ( os.getenv("LUA_PATH"))

shows the environment is not picked up, even PATH is incomplete. I tried with .profile too, no change:

/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
nil
;;./?.lua;./?/init.lua;./lua/?.lua;./lua/?/init.lua;/opt/zbstudio/lualibs/?/?.lua;/opt/zbstudio/lualibs/?.lua;/opt/zbstudio/lualibs/?/?/init.lua;/opt/zbstudio/lualibs/?/init.lua;/opt/zbstudio/lualibs/?.lua;/opt/zbstudio/lualibs/?/?.lua;/opt/zbstudio/lualibs/?/init.lua
1

There are 1 answers

1
hazefire On

Here goes with the answer after lots of trying. Because Zerobrane is an X11 programme and not terminal programme, entries in ~/.profile or ~/.bashrc are not assessed. X11 has its own mechanism, and apparently that works a bit different on Debian than Ubuntu.

The solution (one of several options): put all important entries into ~/.xsessionrc

export LUA_PATH_5_3="/home/martin/lua/?.lua;;"
export LUA_PATH="/home/martin/lua/?.lua;;"
export PATH=<some relevant path>/bin:$PATH

Being lazy, I rebooted and all worked. I removed any entries from ~/.profile and /etc/profile, only left ~/.bashrc so terminal sessions have those environment sessions.