Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reproduce LUA_PATH and LUA_CPATH order in Lua 5.1 and LuaJIT #25

Closed
starius opened this issue May 1, 2016 · 4 comments
Closed

reproduce LUA_PATH and LUA_CPATH order in Lua 5.1 and LuaJIT #25

starius opened this issue May 1, 2016 · 4 comments

Comments

@starius
Copy link
Contributor

starius commented May 1, 2016

hererocks adds its paths to the beginning of LUA_PATH_DEFAULT and LUA_CPATH_DEFAULT.

It is similar to how Lua 5.3 does. I'm not certain about Lua 5.2.

Lua 5.1 and LuaJIT use local path "./?.lua" as first member.

I think, changing LUA_LDIR and LUA_CDIR is more reliable than adding new component to the beginning. Moreover, current behaviour promotes code inside hererocks to load system-wide code, which breaks the isolation and may result in hidden dependencies.

See http://lua.2524044.n2.nabble.com/Virtualenv-Lua-liketool-td7672360.html

@mpeterv
Copy link
Owner

mpeterv commented May 1, 2016

hererocks does reproduce the order (local first for Lua 5.1 and LuaJIT, local last for Lua 5.2+):

local_paths_first = self.major_version == "5.1"

@starius
Copy link
Contributor Author

starius commented May 1, 2016

Sorry for the noise, I forgot to reset LUA_PATH and LUA_CPATH while testing. After I set LUA_PATH=';;' LUA_CPATH=';;' it works as expected. There is no bug with the order.

What do you think about the second part of the request: excluding system-wide libraries like /usr/lib/ from LUA_PATH_DEFAULT and LUA_CPATH_DEFAULT?

@mpeterv
Copy link
Owner

mpeterv commented May 1, 2016

What do you think about the second part of the request: excluding system-wide libraries like /usr/lib/ from LUA_PATH_DEFAULT and LUA_CPATH_DEFAULT?

That's done, too. Only paths within installation prefix and current directory are there. Looks like the message on the mailing list with lists of paths is produced using standard global installations and not hererocks.

@starius
Copy link
Contributor Author

starius commented May 1, 2016

I see. There is no bug, so I close the issue.

@starius starius closed this as completed May 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants