[MacPorts] #67765: Change #37496 seems to have broken lua54-luarocks
MacPorts
noreply at macports.org
Fri Oct 27 17:59:05 UTC 2023
#67765: Change #37496 seems to have broken lua54-luarocks
------------------------------+----------------------
Reporter: michaellenaghan | Owner: l2dy
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: lua54-luarocks |
------------------------------+----------------------
Comment (by l2dy):
Replying to [comment:5 michaellenaghan]:
> That won't work, for two reasons.
>
> First, as far as I can tell, installing `luarocks` doesn't add the
`luarocks` paths to `LUA_PATH` and `LUA_CPATH`. Maybe that's "as
designed", but it isn't obvious; the port doesn't publish any usage notes,
etc. as most ports that require additional config do.
That's as designed. You should read `--help` before using the `--local`
flag.
{{{
--local Use the tree in the user's home directory.
To enable it, see '/opt/local/bin/luarocks help
path'.
}}}
> Second, and perhaps more importantly: the rock will be built and
installed for `lua5.3` rather than `lua5.4`. It's true that `luarocks` can
build for any version. But it's also true that, by default, it builds for
the version it's based on. In order to build for any *other* version, you
have to specify that version — e.g. `--lua-version 5.4` -- every time you
do anything.
>
> To make matters worse, `luarocks` still installs a bunch of versioned
symlinks:
>
> {{{
> $ ls /opt/local/bin/luarocks*
> /opt/local/bin/luarocks* /opt/local/bin/luarocks-admin*
> /opt/local/bin/luarocks-5.1@ /opt/local/bin/luarocks-admin-5.1@
> /opt/local/bin/luarocks-5.2@ /opt/local/bin/luarocks-admin-5.2@
> /opt/local/bin/luarocks-5.3@ /opt/local/bin/luarocks-admin-5.3@
> /opt/local/bin/luarocks-5.4@ /opt/local/bin/luarocks-admin-5.4@
> }}}
>
> Using a versioned symlink still builds for the *default* `lua` version,
rather than the version you selected:
>
> {{{
> $ luarocks-5.4
>
> ...
>
> Configuration:
> Lua:
> Version : 5.3
> Interpreter: /opt/local/bin/lua (ok)
> LUA_DIR : /opt/local (ok)
> LUA_BINDIR : /opt/local/bin (ok)
> LUA_INCDIR : /opt/local/include (ok)
> LUA_LIBDIR : /opt/local/lib (ok)
>
> Configuration files:
> System : /opt/local/etc/luarocks/config-5.3.lua (ok)
> User : /Users/example/.luarocks/config-5.3.lua (not found)
>
> Rocks trees in use:
> /Users/example/.luarocks ("user")
> /opt/local/share/luarocks ("system")
>
> }}}
>
> and:
>
> {{{
> $ luarocks-5.4 path
> export
LUA_PATH='/opt/local/share/lua/5.3/?.lua;/opt/local/share/lua/5.3/?/init.lua;/opt/local/lib/lua/5.3/?.lua;/opt/local/lib/lua/5.3/?/init.lua;…'
> export
LUA_CPATH='/opt/local/lib/lua/5.3/?.so;/opt/local/lib/lua/5.3/loadall.so;./?.so;/Users/example/.luarocks/lib/lua/5.3/?.so;/opt/local/share/luarocks/lib/lua/5.3/?.so;…'
> export
PATH='/Users/example/.luarocks/bin:/opt/local/share/luarocks/bin:…'
> }}}
>
> Notice that in both cases I'm using `luarocks-5.4` but seeing `5.3` in
the paths.
>
> I don't know what the previous experience was like. I just know that
this one is incredibly confusing. It may be possible to make it work
right, but if something doesn't change you're likely to get more tickets
like this one.
Previously, using `luarocks-5.4` will build for Lua 5.4. I was just bit by
this new behavior when updating the `luarocks-1.0` port group.
> P.S. It's also odd that 5.3 is the default `lua`? 5.4 was released in
2020. I bring that up because if `luarocks` was using the *latest* version
then maybe fewer users would run into these problems?
It follows the default version used by the `lua` port. We could update all
of them at once.
Overall, I agree that the new behavior is suboptimal and should be
reverted, but we will also need to take care not to break the new
`luarocks-1.1` port group and related ports.
I won't be able to work on these improvements soon, so pull requests are
welcome.
--
Ticket URL: <https://trac.macports.org/ticket/67765#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list