Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration options to enable the use of luarocks with programs that have a bundled Lua interpreter. #1499

Open
mrcjkb opened this issue Mar 31, 2023 · 2 comments

Comments

@mrcjkb
Copy link

mrcjkb commented Mar 31, 2023

Description

@teto and I are working on promoting LuaRocks for Neovim plugin distribution, using the luarocks-tag-release GitHub action - in the hopes of solving some pain points in the current plugin ecosystem.

Neovim is bundled with LuaJIT, and can act as a Lua interpreter with the nvim -l command.
It could be useful to be able to configure luarocks to use Neovim with the -l flag as a Lua interpreter.

Here are some use cases I have in mind:

  • Test suites that depend on Neovim's Lua API could be run using busted.
  • Plugin managers could shell out to luarocks after configuring it to use Neovim as an interpreter.

A generic API for this could look something like this:

luarocks config lua_version 5.1
luarocks config lua_interpreter nvim
luarocks config lua_interpreter_flags -l
luarocks test

To work with busted, some additional configuration options might be necessary. For example, lua -e stat may need to be translated to nvim -c lua stat - not sure if this is feasible to do on the LuaRocks side.

Alternatives

  • Use a wrapper binary that translates from the Lua CLI to the Neovim CLI.

This option should work fine for luarocks test. But it might not be feasible for the second use case of plugin managers shelling out to luarocks, unless neovim or the plugin managers themselves are distributed with a wrapper.

Thoughts?

@alerque
Copy link
Contributor

alerque commented Mar 31, 2023

This would also be useful for pandoc which now ships a full on Lua interpreter that can be used as pandoc-lua (and it would make packaging filters for use with Pandoc easier) and in the future it would also be useful for sile which is headed the same direction.

@mrcjkb
Copy link
Author

mrcjkb commented Jun 7, 2023

I played around with the idea some more and wrote a post about an approach that works for testing.

@alerque maybe a similar approach could be useful with pandoc, too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants