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

luarocks-tag-release workflow? #10

Closed
mrcjkb opened this issue Mar 29, 2023 · 4 comments · Fixed by #11
Closed

luarocks-tag-release workflow? #10

mrcjkb opened this issue Mar 29, 2023 · 4 comments · Fixed by #11

Comments

@mrcjkb
Copy link
Contributor

mrcjkb commented Mar 29, 2023

@teto and I are trying to promote the use of LuaRocks to distribute Neovim plugins.

Would you be open to a PR that adds the luarocks-tag-release GitHub action to this template?

By now, it has matured enough that most Neovim plugins only need to add the action, without any inputs.

Its use could be seen as controversial, because:

@matu3ba
Copy link

matu3ba commented Mar 31, 2023

Can you provide a brief overview and comparison to https://github.com/nvim-lua/nvim-package-specification ?
I'm still missing something like luarocks update --all, but I see the point of having a separate package index.

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Mar 31, 2023

@matu3ba Sure 😄

The workflow doesn't define any specification. I uses the existing rockspec format, which has been well-established in the Lua ecosystem (it's the de facto standard).

It's difficult to build an opinion on the Neovim package spec, because it's still WIP.
So I can only give you my (opinionated) thoughts based on what I know about the current status.

  • The PackSpec specifies support for source = luarocks:// in its schema. When it is finished, it should be compatible with LuaRocks, so I don't see a conflict between the two approaches.
  • PackSpec is based on RockSpec, and from what I can tell, the only thing it adds is the ability to install plugins using a larger number of source protocols. RockSpec can install from luarocks.org, and scm if enabled with the --dev flag.
  • luarocks has the ability to build and package plugins.
    With the luarocks-tag-release workflow, you can build non-lua binaries in GitHub CI (using make or cmake), and distribute them with your plugin. No need to tell users to manually build them after installing from scm.
  • luarocks is a full-fledged package manager that supports the coexistence of multiple dependencies with different versions.
  • There's a good reason there's no luarocks update --all: To minimise dependency hell. PackSpec won't solve that problem.
    If you specify plugins as dependencies in a rockspec, you can pin them with a lock file and update them with the --pin flag.
  • PackSpec defines a version in its schema; and the readme says plugin authors should have a git tag that matches that version. I don't agree with that UX. What if you want the version on your main branch to be scm or dev? Some plugin authors don't want to maintain tags, but prefer rolling releases. All of these use cases are supported by RockSpec. The luarocks-tag-release action supports them too, and solves the pain point of polluting your repository with multiple version-named rockspecs.
  • This is just my personal opinion, but it seems to me like the PackSpec is a reinvention of the wheel. I don't maintain a Neovim plugin manager though, so I could be overlooking something. In any case, I don't believe there's a conflict.
  • I believe we can solve the pain points much faster if we take the LuaRocks route. And when PackSpec is ready, plugin managers that implement the full spec should support LuaRocks anyway (although luarocks would probably be the less bloated option).

@mfussenegger
Copy link
Collaborator

It requires a LuaRocks account

Do you have an idea how to handle that? It should at least not cause failures if the credentials are missing.
I think assuming tagged releases is fine (and actually good that it doesn't do anything if there are no tags).

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Apr 2, 2023

The action will (and should) fail if the API key is missing.
But one could add

if: env.LUAROCKS_API_KEY != null

to the step that runs the action. This would skip it if the API key isn't set.

and actually good that it doesn't do anything if there are no tags

We do have plans to add support for luarocks test and also testing luarocks install (and maybe upload) in PRs - which we will recommend. Otherwise the only way to test that the workflow doesn't break would be to merge and tag.

These could also be skipped if the API key isn't set.

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

Successfully merging a pull request may close this issue.

3 participants