Homebrew/legacy-homebrew

Luarocks bundled with lua formula built with user configuration disabled

Closed this issue · 5 comments

The luarocks bundled with lua has user configuration files disabled. This is a problem for me and I wonder if its necessary to disable; I would really like to be able to do some user configuration in luarocks.
I believe this is a result of building luarocks with the --force-config flag enabled.

Here's the luarocks configuration information:

CONFIGURATION
    Lua version: 5.2
    Configuration files:
        System: /usr/local/etc/luarocks52/config-5.2.lua (ok)
        User  : disabled in this LuaRocks installation.

    Rocks trees in use:
        /usr/local ("system")

my brew doctor: https://gist.github.com/bakpakin/9ccb4f178e49e0d5c712
my brew config: https://gist.github.com/bakpakin/99721498b2e270f509d9

This was enforced because one of the more typical use-cases of the previous installation was for people to setup their configurations, and sometimes trees, in $HOME. When we made the change to vendoring Luarocks à la pip supporting that option still contained real risk of instantly borking the new install for users without any kind of obvious error messaging.

This was the best way to support multiple Lua/Luarocks versions that couldn't clash with each other more than overwriting installed-via-luarocks-by-user binaries (Such as moon), which is a problem we have with pip already and is relatively acceptable. The transition has been pretty painless, which I think is partially thanks to ignoring prior configuration files hanging around the system.

What is the use-case you want here?

I want to provide default rocks that are local to a project in a separate rocktree, as well as provide some default rocks that are included as dependencies for other rocks without having to actually install them. Essentially, a way to include rocks in a project without installing them system wide. I'm not overly familiar with luarocks, so tell me if there is another way to do this or if I'm barking up the wrong tree.

Sorry for the delay here.

You can create separate trees outside of the normal configuration by passing it as an argument to luarocks, i.e. luarocks-5.2 install moonscript --tree=/Users/Bob/Downloads/mytree. You can use the tree to install as many rocks as desired.

As long as that tree is ahead in the $PATH those rocks will be called before any others installed, or you can use something like an exec script to change the variables locally before calling your desired executable.

I will look at the lua configuration situation. It has been a fairly smooth transition, and it's possible we can safely remove the restriction going forwards.

Thanks.

User configuration options have been restored. brew update && brew upgrade and you'll be good.