lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Andrew Starks
> Sent: donderdag 15 mei 2014 22:56
> To: Lua mailing list
> Subject: Re: Makefile vs LUA_PATH inconsistency
> 
> 
> 
> On Thu, May 15, 2014 at 1:47 PM, Thijs Schreijer <thijs@thijsschreijer.nl>
> wrote:
> When building Lua using MinGW, the following structure is produced;
> 
> {root}
>   +-- bin
>   +-- include
>   +-- lib
>   |    +-- lua
>   |         +-- 5.2
>   +-- man
>   |    +-- man1
>   +-- share
>        +-- lua
>             +-- 5.2
> 
> But checking the default paths; (added some linebreaks for readability)
> C:\Temp\lua\5.2>bin\lua
> Lua 5.2.1  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> > print("PATH: "..package.path .. "\n\nCPATH: " .. package.cpath)
> PATH:
> C:\Temp\lua\5.2\bin\lua\?.lua;
> C:\Temp\lua\5.2\bin\lua\?\init.lua;
> C:\Temp\lua\5.2\bin\?.lua;
> C:\Temp\lua\5.2\bin\?\init.lua;
> .\?.lua
> 
> CPATH:
> C:\Temp\lua\5.2\bin\?.dll;
> C:\Temp\lua\5.2\bin\loadall.dll;
> .\?.dll
> >
> 
> So any files placed in the generated ./lib/lua/5.2/ or ./share/lua/5.2/
> paths will not be found. So the make file is inconsistent with the default
> paths.
> 
> Shouldn't the default paths be updated to include those locations, and make
> it consistent?
> 
> Thijs
> 
> Do you think that path should be different (like use (_WIN32 && !(_MINGW) )
> ) or should the make file build an alternate structure?
> 
> If Lua is typically put in a sandbox, then I'd change the Makefile. If it's
> typically put inside part of the MinGW sandbox, then changing the luaconf.h
> would make more sense.
> 
> Either way, it should be consistent. It would be nice if you didn't having
> to set environment variables for default installations and that should be an
> attainable goal.
> 
> -Andrew

Changing the paths has a drawback that it would have to include `\\..\\share\\lua\\5.2\\`. The issue is '..' here, as it moves up, so with a binary placed top-level (not in .\bin\), it would traverse out of the application structure on the file system and start exploring unknown paths there. That's what makes me uncomfortable with changing the paths. Otoh any one deviating from defaults is on his own, and should know what he's doing.

Alternatively updating the file structure generated by the makefile could be a solution. But then there is MinGW; is it Windows, or Unix? I think the paths defined for Windows are ok. But how much can/should Windows deviate from the other platforms?


A Windows like structure (working with the current default paths in luaconf.h) would be;

 {root}
   +-- 5.2           <-- contains '/bin' contents and binary modules (.dll)
        +-- include  <-- no changes
        +-- lib      <-- no changes
        +-- lua      <-- Lua modules

Binary modules would also go in the '5.2' directory, no longer in 'lib'.

If you want to keep the versioning in the tree itself, instead of the toplevel version number, then the /bin and /lib contents must also become versioned, which it currently isn't. (eg. makefile produces lua.exe, which should become lua52.exe) That would also imply that the paths would also need updating to include the versions (so paths & makefile changes)

Thijs