Changed package path and cpath in lua5.2 and 5.3

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

Changed package path and cpath in lua5.2 and 5.3

Vadim A. Misbakh-Soloviov
Hi there!

Some time ago I've *suddenly* noticed that Lua 5.2 and 5.3 has changed package
path and cpath order, so globally-installed packages are prefered over local
ones (in curent working directory).


Can I ask about the reason of such change (which, in my opinion, is a
regression, making a bunch of troubles, and giving nothing (at least, I don't
know what) in exchange.


--
Best regards,
mva

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

Re: Changed package path and cpath in lua5.2 and 5.3

Laurent FAILLIE
Hello,

It's only a parameter set by environment variables : so you can easily change the order to the one that suit your needs :)

Bye

Laurent



Le Vendredi 25 septembre 2015 17h50, Vadim A. Misbakh-Soloviov <[hidden email]> a écrit :


Hi there!

Some time ago I've *suddenly* noticed that Lua 5.2 and 5.3 has changed package
path and cpath order, so globally-installed packages are prefered over local
ones (in curent working directory).


Can I ask about the reason of such change (which, in my opinion, is a
regression, making a bunch of troubles, and giving nothing (at least, I don't
know what) in exchange.


--
Best regards,
mva

Reply | Threaded
Open this post in threaded view
|

Re: Changed package path and cpath in lua5.2 and 5.3

Vadim A. Misbakh-Soloviov
> It's only a parameter set by environment variables : so you can easily
> change the order to the one that suit your needs :) Bye

Yes, I know that it is changeable in the script. But, for example, in
makefile-called tests it adds more complexity off the air (for example, if I
can do `lua5.1 -l lib` (or `lua5.1 -e 'require"lib"'`) to test if library
includes successfully, then with 5.2+ that trick doesn't work anymore and I
need to reorder package.{,c}path before require).

And makefile tests is the one of many examples, where old behaviour was more
comfortable than current.

And, anyway, I just want to (at least) know the reason of that change. Maybe
developers (reading the list) made this for some explicit goal, which I just
can see?

-- Although, other languages interpreters either keeps or adding "local-
preferred" behaviour, AFAIK, and I know no one (except Lua5.2+) which is
reordered behavoiur to prefer globals.



--
Best regards,
mva

signature.asc (836 bytes) Download Attachment