forked from luarocks/luarocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Project: LuaRocks per project workflow
Hisham Muhammad edited this page May 14, 2018
·
7 revisions
- managing multiple rocks trees is complicated
- LuaRocks is based on a 10+ year old design from when rubygems was the state of the art
- new users expect a per-project behavior, npm-style
- LuaRocks has the necessary machinery for that, but it's cumbersome to set it up
- a git-style
.luarocksdirectory: if a.luarocksdirectory is found in the current directory (or any directories above it), it will become the "project root" directory - a new command,
luarocks initsets up a project:- creates a
.luarocksdirectory in the current directory - writes a template
rockspecfile if none exists- uses the machinery of
luarocks write_rockspec, which does some git-specific detection, so the command should "do the right thing" when executed from inside a git clone
- uses the machinery of
- creates a
- offer a bullet-proof way to run Lua and LuaRocks using the current project tree
- Option 1:
- creating
luaandluarockslauncher scripts in the current directory that are hardcoded to use the project tree
- creating
- Option 2:
- adding a
luarocks execcommand (in the style ofbundle execwhich runs a command using LuaRocks's own bundled interpreter and is.luarocks-aware
- adding a
- Option 1:
- Current multi-tree support remains available
- Users who have the existing workflow in place won't need to change
- With the current existence of
~/.luarocksin the$HOMEdirectory, this means that LuaRocks will effectively become "--local-by-default"
- Working branch for
luarocks init: https://github.com/luarocks/luarocks/tree/luarocks-init
-
With Option 2, how do you use a different Lua interpreter (e.g. to test different Lua versions)
-
luarocks-5.1,luarocks-5.2,luarocks-5.3,luarocks-jit2.1, etc. binaries?
-
-
Where will the Lua modules themselves live? Inside
.luarocks(this is compatible with the current~/.luarocksor in a newlua_modulesdirectory (copying npm)-
lua_moduleshas better visibility (and familiarity for those used to npm); users will be able to inspect rocks more easily;.luarockswould be for config files, caches and other "hidden" things- inside
lua_modules, a regular version rocks tree should exist: e.g.lua_modules/share/lua/5.3/foo.lua
- inside
- using a rocks tree inside
.luarocksitself should be supported too, for compatibility with~/.luarocks- maybe it should be always the default when in
$HOME, to avoid$HOME/lua_modules?
- maybe it should be always the default when in
-