lua-users home
lua-l archive

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


2013/4/17 Hisham <h@hisham.hm>:
> I'm glad to announce LuaRocks 2.0.13. LuaRocks is a package management
> system for Lua modules. (For more information, please visit
> http://luarocks.org )
>
> And as always, all kind of feedback is much appreciated.
>

[For those not in the mood: jump straight to the bottom SUMMARY.]

I've never before really come to grips with LuaRocks: I've just used
it blindly like "sudo luarocks install lpeg", the same way I use Cabal.
The difference is, I know no Haskell, so I don't feel guilty about Cabal,
whereas I'm about 25% of the way to being a Lua expert, so I do feel
guilty about LuaRocks.

So this announcement seemed like a welcome opportunity to get to
learn LuaRocks properly, maybe package something I wrote as a rock.
I'm writing a blow-by-blow log since Hisham said "all kind of feedback
is much appreciated."

Ready. [OS is Ubuntu 12.4, not that it should matter for LuaRocks.
For the non-Linux people: 'sudo' means that just for that one commmand
I'm claiming superuser (administrator) status.]

$ luarocks
[about 60 lines of help text]

-- Fine. I like that.

$ sudo luarocks install luarocks
Error: No results matching query were found.

-- What's this? LuaRocks itself is not a rock? I can't believe it.

$ luarocks search
Error: Enter name and version or use --all; see help.

-- Actually help says nothing about search except "Query the LuaRocks
-- servers." So telling me to see help is not really, well, helpful.
-- But wait: even though the 60 lines of help does not say so, one can
-- sometimes get more detailed help if you give a topic.

$ luarocks help search
[about 10 lines]

-- That's better. Besides --all there are two other options.

$ luarocks search
[many lines]
$ luarocks search | less
[now I can examine them with a pager]

-- It's true! LuaRocks is a large Lua program, of which new releases
-- are published every now and then, but it is not itself a rock.
-- You can't update it using the very tool designed for that purpose.
-- Score: cabal 1, luarocks 0.

-- Downloaded the tarball via Firefox ...
$ tar -xzf luarocks-2.0.13.tar.gz
$ cd luarocks-2.0.13/
luarocks-2.0.13$ ls
config.ld  COPYING     COPYING_lua  README.md  src
configure  COPYING_7z  Makefile     rockspec   test

-- It does look like a rock from here ...

$ sudo luarocks build rockspec
Error: Could not find a result named rockspec.

-- Let's just read that specialized help again, maybe I missed something.
$ luarocks help build

LuaRocks 2.0.12, a module deployment system for Lua

NAME
	luarocks build - Build/compile a rock.

SYNOPSIS
	luarocks build [--pack-binary-rock] {<rockspec>|<rock>|<name> [<version>]}

DESCRIPTION
	Build and install a rock, compiling its C parts if any.
	Argument may be a rockspec file, a source rock file
	or the name of a rock to be fetched from a repository.
	
	If --pack-binary-rock is passed, the rock is not installed;
	instead, a .rock file with the contents of compilation is produced
	in the current directory.

SEE ALSO
	'luarocks help' for general options and configuration.

-- It says: Argument may be a rockspec file. 'rockspec' is a rockspec
-- file.

-- At this point I get a deja vu feeling.
$ ls ../luarocks*.gz
../luarocks-2.0.12.tar.gz
../luarocks-2.0.13.tar.gz
../luarocks-2.0.5.tar.gz

-- I've been here twice before. Somehow I did get luarocks-2.0.12
-- up and running. How did I manage that? Wait .. wasn't there
-- a 'configure'?

$ ./configure
[about 15 lines]
Done. You can now run 'make' to build.

$ make
[about 70 lines]
Done. Type 'make install' to install into /usr/local.

$ sudo make install
[about 40 lines]

$ luarocks
[shows 2.0.13 now, and ends with:]
   System configuration file: /usr/local/etc/luarocks/config-5.2.lua (ok)

-- Right! Up and running. Now to read the docs, and make my own rock.
$ less README.md
[about 10 lines that would look good on a 110-column terminal]
[1]: http://luarocks.org/en/Types_of_rocks
[2]: http://luarocks.org/en/Dependencies
[3]: http://luarocks.org/en/Rocks_repositories
[4]: http://luarocks.org/en/Download
[5]: http://luarocks.org/en/Installation_instructions_for_Unix
[6]: http://luarocks.org/en/Installation_instructions_for_Windows
[7]: http://luarocks.org/en/License

-- Maybe those are installed locally somewhere? No.

To be continued.

SUMMARY:

1. LuaRocks should be updatable by "luarocks install luarocks".
2. The main help screen should say "More detailed help available
   by 'luarocks help <command>'.
3. It should not be necessary to visit the website. There should
   be an INSTALL file giving the main points of both sets of
   installation instructions, and selected documentation, in
   particular "How to package your module as a rock" (which I have
   so far not found on the side) should be installed locally.
   E.g. /usr/local/doc/luarocks or /usr/local/lib/luarocks/doc.
4. BTW the site is not super-nice, for example I needed to say
   "No Style" because with "Basic Page Style" the lines do not
   wrap.