Virtualenv Lua liketool

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Virtualenv Lua liketool

luciano de souza-2
Hello all,
Is there in Lua a tool like the Virtualenv from Python? It isolates
the enviroment without the need of a Virtualbox machine.

Regards,


--
Luciano de Souza

Reply | Threaded
Open this post in threaded view
|

Re: Virtualenv Lua liketool

Nagaev Boris
On Sun, May 1, 2016 at 2:43 PM, luciano de souza <[hidden email]> wrote:

> Hello all,
> Is there in Lua a tool like the Virtualenv from Python? It isolates
> the enviroment without the need of a Virtualbox machine.
>
> Regards,
>
>
> --
> Luciano de Souza
>

Hello,

https://github.com/mpeterv/hererocks/


--


Best regards,
Boris Nagaev

Reply | Threaded
Open this post in threaded view
|

Re: Virtualenv Lua liketool

luciano de souza-2
Thank you. I will evaluate the tool.

2016-05-01 11:57 GMT-03:00, Nagaev Boris <[hidden email]>:

> On Sun, May 1, 2016 at 2:43 PM, luciano de souza <[hidden email]>
> wrote:
>> Hello all,
>> Is there in Lua a tool like the Virtualenv from Python? It isolates
>> the enviroment without the need of a Virtualbox machine.
>>
>> Regards,
>>
>>
>> --
>> Luciano de Souza
>>
>
> Hello,
>
> https://github.com/mpeterv/hererocks/
>
>
> --
>
>
> Best regards,
> Boris Nagaev
>
>


--
Luciano de Souza

Reply | Threaded
Open this post in threaded view
|

Re: Virtualenv Lua liketool

Vadim A. Misbakh-Soloviov
In reply to this post by Nagaev Boris
> https://github.com/mpeterv/hererocks/

Has it something to do with changed {c,}path order, that has been changed in
latest 5.2 and 5.3 releases?

It brakes entire idea of something like virtualenv (if you won't force
reassign {c,}path) in your init.lua.

===========================

> $ for imp in lua{jit,5.{1,2,3}}; do $imp -e 'print((jit and (jit.version) or
> _VERSION)..":"); print(package.path); print(package.cpath);print()'; done
> LuaJIT 2.1.0-beta2:
> ./?.lua;/usr/share/luajit-2.1.9999/?.lua;/usr/local/share/lua/5.1/?.lua;/
> usr/local/share/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/
> 5.1/?/init.lua
> ./?.so;/usr/local/lib/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/local/lib/lua/
> 5.1/loadall.so
>
> Lua 5.1:
> ./?.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;/usr/lib64/
> lua/5.1/?.lua;/usr/lib64/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/
> share/lua/5.1/?/init.lua
> ./?.so;/usr/lib64/lua/5.1/?.so;/usr/lib64/lua/5.1/?.so;/usr/lib64/lua/5.1/
> loadall.so
>
> Lua 5.2:
> /usr/share/lua/5.2/?.lua;/usr/share/lua/5.2/?/init.lua;/usr/lib64/lua/
> 5.2/?.lua;/usr/lib64/lua/5.2/?/init.lua;./?.lua
> /usr/lib64/lua/5.2/?.so;/usr/lib64/lua/5.2/loadall.so;./?.so
>
> Lua 5.3:
> /usr/share/lua/5.3/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/lib64/lua/
> 5.3/?.lua;/usr/lib64/lua/5.3/?/init.lua;./?.lua;./?/init.lua
> /usr/lib64/lua/5.3/?.so;/usr/lib64/lua/5.3/loadall.so;./?.so
===========================




--
wbr,
mva

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Virtualenv Lua liketool

Vadim A. Misbakh-Soloviov
Uh!
I finally opened the link from desktop and found that it supposed to do.
But it is on python and use some kludges ;)

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Virtualenv Lua liketool

Nagaev Boris
In reply to this post by Vadim A. Misbakh-Soloviov
On Sun, May 1, 2016 at 3:42 PM, Vadim A. Misbakh-Soloviov
<[hidden email]> wrote:

>> https://github.com/mpeterv/hererocks/
>
> Has it something to do with changed {c,}path order, that has been changed in
> latest 5.2 and 5.3 releases?
>
> It brakes entire idea of something like virtualenv (if you won't force
> reassign {c,}path) in your init.lua.
>
> ===========================
>> $ for imp in lua{jit,5.{1,2,3}}; do $imp -e 'print((jit and (jit.version) or
>> _VERSION)..":"); print(package.path); print(package.cpath);print()'; done
>> LuaJIT 2.1.0-beta2:
>> ./?.lua;/usr/share/luajit-2.1.9999/?.lua;/usr/local/share/lua/5.1/?.lua;/
>> usr/local/share/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/
>> 5.1/?/init.lua
>> ./?.so;/usr/local/lib/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/local/lib/lua/
>> 5.1/loadall.so
>>
>> Lua 5.1:
>> ./?.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;/usr/lib64/
>> lua/5.1/?.lua;/usr/lib64/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/
>> share/lua/5.1/?/init.lua
>> ./?.so;/usr/lib64/lua/5.1/?.so;/usr/lib64/lua/5.1/?.so;/usr/lib64/lua/5.1/
>> loadall.so
>>
>> Lua 5.2:
>> /usr/share/lua/5.2/?.lua;/usr/share/lua/5.2/?/init.lua;/usr/lib64/lua/
>> 5.2/?.lua;/usr/lib64/lua/5.2/?/init.lua;./?.lua
>> /usr/lib64/lua/5.2/?.so;/usr/lib64/lua/5.2/loadall.so;./?.so
>>
>> Lua 5.3:
>> /usr/share/lua/5.3/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/lib64/lua/
>> 5.3/?.lua;/usr/lib64/lua/5.3/?/init.lua;./?.lua;./?/init.lua
>> /usr/lib64/lua/5.3/?.so;/usr/lib64/lua/5.3/loadall.so;./?.so
> ===========================
>
>
>
>
> --
> wbr,
> mva

hererocks patches default values of LUA_PATH and LUA_CPATH in Lua
source to point to correct locations. See https://git.io/vwMDV

> that has been changed in latest 5.2 and 5.3 releases?

I can't find information about LUA_PATH and LUA_CPATH changes in Lua
5.2 and Lua 5.3 manuals. What exactly do you mean?



--


Best regards,
Boris Nagaev

Reply | Threaded
Open this post in threaded view
|

Re: Virtualenv Lua liketool

Daurnimator
On 2 May 2016 at 02:03, Nagaev Boris <[hidden email]> wrote:
> I can't find information about LUA_PATH and LUA_CPATH changes in Lua
> 5.2 and Lua 5.3 manuals. What exactly do you mean?

Probably not what the OP was talking about, but there have been a
couple of changes:

  - In 5.2 and 5.3, version specific variables of form LUA_PATH_5_3
take precedence over plain LUA_PATH.
    This allows you to have different lua paths set for different lua
versions at the same time

  - In 5.2 and 5.3, the default search path order changed. The local
directory is searched *after* system directories.

Reply | Threaded
Open this post in threaded view
|

Re: Virtualenv Lua liketool

Vadim A. Misbakh-Soloviov
In reply to this post by Nagaev Boris
> I can't find information about LUA_PATH and LUA_CPATH changes in Lua
> 5.2 and Lua 5.3 manuals. What exactly do you mean?

Just take a look on cut betwen "==="'s in that my message, you're answered on.

Lua<5.2 and LuaJIT has path/cpath order which makes it to prefer "local"
modules (from cwd) over "system-wide" ones.
It was quite usefull behaviour, especially for testing.
But 5.2/5.3 introduced new order, where system-wide paths are more preferable  
than local ones (not sure, if 5.2 has it from its first release, tho).

I'd show exact commit and lines to clarify what I mean, if lua were in git :-/

--
wbr,
mva

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Virtualenv Lua liketool

Roberto Ierusalimschy
> > I can't find information about LUA_PATH and LUA_CPATH changes in Lua
> > 5.2 and Lua 5.3 manuals. What exactly do you mean?
>
> Just take a look on cut betwen "==="'s in that my message, you're answered on.
>
> Lua<5.2 and LuaJIT has path/cpath order which makes it to prefer "local"
> modules (from cwd) over "system-wide" ones.
> It was quite usefull behaviour, especially for testing.
> But 5.2/5.3 introduced new order, where system-wide paths are more preferable  

The new order makes the default more secure (even more with the new -E
option). For those that know what they are doing (e.g., for testing), it
is trivial to have environment variables with your prefered path, like
this:

  LUA_PATH=./?.lua;;
  LUA_CPATH=./?.so;;

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: Virtualenv Lua liketool

Nagaev Boris
In reply to this post by Vadim A. Misbakh-Soloviov
On Sun, May 1, 2016 at 4:20 PM, Vadim A. Misbakh-Soloviov
<[hidden email]> wrote:

>> I can't find information about LUA_PATH and LUA_CPATH changes in Lua
>> 5.2 and Lua 5.3 manuals. What exactly do you mean?
>
> Just take a look on cut betwen "==="'s in that my message, you're answered on.
>
> Lua<5.2 and LuaJIT has path/cpath order which makes it to prefer "local"
> modules (from cwd) over "system-wide" ones.
> It was quite usefull behaviour, especially for testing.
> But 5.2/5.3 introduced new order, where system-wide paths are more preferable
> than local ones (not sure, if 5.2 has it from its first release, tho).
>
> I'd show exact commit and lines to clarify what I mean, if lua were in git :-/
>
> --
> wbr,
> mva

So hererocks does it Lua 5.3 way even for Lua 5.1. Reported:
https://github.com/mpeterv/hererocks/issues/25


--


Best regards,
Boris Nagaev

Reply | Threaded
Open this post in threaded view
|

Re: Virtualenv Lua liketool

Nagaev Boris
On Sun, May 1, 2016 at 5:01 PM, Nagaev Boris <[hidden email]> wrote:

> On Sun, May 1, 2016 at 4:20 PM, Vadim A. Misbakh-Soloviov
> <[hidden email]> wrote:
>>> I can't find information about LUA_PATH and LUA_CPATH changes in Lua
>>> 5.2 and Lua 5.3 manuals. What exactly do you mean?
>>
>> Just take a look on cut betwen "==="'s in that my message, you're answered on.
>>
>> Lua<5.2 and LuaJIT has path/cpath order which makes it to prefer "local"
>> modules (from cwd) over "system-wide" ones.
>> It was quite usefull behaviour, especially for testing.
>> But 5.2/5.3 introduced new order, where system-wide paths are more preferable
>> than local ones (not sure, if 5.2 has it from its first release, tho).
>>
>> I'd show exact commit and lines to clarify what I mean, if lua were in git :-/
>>
>> --
>> wbr,
>> mva
>
> So hererocks does it Lua 5.3 way even for Lua 5.1. Reported:
> https://github.com/mpeterv/hererocks/issues/25
>

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.



--


Best regards,
Boris Nagaev