Skip to content

Commit

Permalink
luarocks-packages.csv: changed repo by rockspec uri
Browse files Browse the repository at this point in the history
This is a breaking change that converts the 'src' csv column (a git URI) to a 'rockspec'
fullpath uri.
before this, luarocks-nix would clone the repo and look for rockspecs
with a brittle algorithm. This removes the ambiguity on which rockspec
to package while allowing to remove a bunch of brittle code from
luarocks-nix.
  • Loading branch information
teto committed Apr 30, 2024
1 parent b73ec84 commit 9e22d74
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 28 deletions.
35 changes: 17 additions & 18 deletions maintainers/scripts/luarocks-packages.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name,src,ref,server,version,luaversion,maintainers
name,rockspec,ref,server,version,luaversion,maintainers
alt-getopt,,,,,,arobyn
bit32,,,,5.3.0-1,5.1,lblasc
argparse,,,,,,
Expand All @@ -13,7 +13,7 @@ cosmo,,,,,,
coxpcall,,,,1.17.0-1,,
cqueues,,,,,,vcunat
cyan,,,,,,
digestif,https://github.com/astoff/digestif.git,,,,5.3,
digestif,,,,,5.3,
dkjson,,,,,,
fennel,,,,,,misterio77
fidget.nvim,,,,,,mrcjkb
Expand All @@ -22,16 +22,16 @@ fluent,,,,,,alerque
funnyfiles.nvim,,,,,,mrcjkb
fzf-lua,,,,,,mrcjkb
fzy,,,,,,mrcjkb
gitsigns.nvim,https://github.com/lewis6991/gitsigns.nvim.git,,,,5.1,
haskell-tools.nvim,,,,,,
gitsigns.nvim,https://raw.githubusercontent.com/lewis6991/gitsigns.nvim/main/gitsigns.nvim-scm-1.rockspec,,,,5.1,
haskell-tools.nvim,,,,,,mrcjkb
http,,,,0.3-0,,vcunat
image.nvim,,,,,,teto
inspect,,,,,,
jsregexp,,,,,,
ldbus,,,http://luarocks.org/dev,,,
ldoc,,,,,,
lgi,,,,,,
linenoise,https://github.com/hoelzro/lua-linenoise.git,,,,,
linenoise,https://raw.githubusercontent.com/hoelzro/lua-linenoise/master/linenoise-0.9-1.rockspec,,,,,
ljsyscall,,,,,5.1,lblasc
lmathx,,,,,5.3,alexshpilkin
lmpfrlib,,,,,5.3,alexshpilkin
Expand All @@ -54,13 +54,13 @@ lua-resty-jwt,,,,,,
lua-resty-openidc,,,,,,
lua-resty-openssl,,,,,,
lua-resty-session,,,,,,
lua-rtoml,https://github.com/lblasc/lua-rtoml,,,,,lblasc
lua-subprocess,https://github.com/0x0ade/lua-subprocess,,,,5.1,scoder12
lua-rtoml,https://raw.githubusercontent.com/lblasc/lua-rtoml/main/lua-rtoml-0.2-0.rockspec,,,,,lblasc
lua-subprocess,https://raw.githubusercontent.com/0x0ade/lua-subprocess/master/subprocess-scm-1.rockspec,,,,5.1,scoder12
lua-term,,,,,,
lua-toml,,,,,,
lua-zlib,,,,,,koral
lua_cliargs,,,,,,
luabitop,https://github.com/teto/luabitop.git,,,,,
luabitop,https://raw.githubusercontent.com/teto/luabitop/master/luabitop-1.0.2-3.rockspec,,,,,
luacheck,,,,,,
luacov,,,,,,
luadbi,,,,,,
Expand Down Expand Up @@ -93,35 +93,34 @@ lua-yajl,,,,,,pstn
lua-iconv,,,,7.0.0,,
luuid,,,,20120509-2,,
luv,,,,1.44.2-1,,
lush.nvim,https://github.com/rktjmp/lush.nvim,,,,,teto
lush.nvim,,,https://luarocks.org/dev,,,teto
lyaml,,,,,,lblasc
magick,,,,,5.1,donovanglover
markdown,,,,,,
mediator_lua,,,,,,
middleclass,,,,,,
mimetypes,,,,,,
mpack,,,,,,
moonscript,https://github.com/leafo/moonscript.git,dev-1,,,,arobyn
moonscript,https://raw.githubusercontent.com/leafo/moonscript/master/moonscript-dev-1.rockspec,,,,,arobyn
neotest,,,,,,mrcjkb
nlua,,,,,,teto
nui.nvim,,,,,,mrcjkb
nvim-cmp,https://github.com/hrsh7th/nvim-cmp,,,,,
nvim-cmp,https://raw.githubusercontent.com/hrsh7th/nvim-cmp/main/nvim-cmp-scm-1.rockspec,,,,,
nvim-nio,,,,,,mrcjkb
pathlib.nvim,,,,,,
penlight,https://github.com/lunarmodules/Penlight.git,,,,,alerque
plenary.nvim,https://github.com/nvim-lua/plenary.nvim.git,,,,5.1,
rapidjson,https://github.com/xpol/lua-rapidjson.git,,,,,
rocks.nvim,,,,,5.1,teto mrcjkb
penlight,,,,,,alerque
plenary.nvim,https://raw.githubusercontent.com/nvim-lua/plenary.nvim/master/plenary.nvim-scm-1.rockspec,,,,5.1,
rapidjson,,,,,,
rest.nvim,,,,,5.1,teto
rocks.nvim,,,,,,mrcjkb
rocks-git.nvim,,,,,,mrcjkb
rocks-config.nvim,,,,,,mrcjkb
rocks-dev.nvim,,,,,,mrcjkb
rustaceanvim,,,,,,mrcjkb
say,https://github.com/Olivine-Labs/say.git,,,,,
say,,,,,,
serpent,,,,,,lockejan
sqlite,,,,,,
std._debug,https://github.com/lua-stdlib/_debug.git,,,,,
std._debug,,,,,,
std.normalize,,,,,,
stdlib,,,,41.2.2,,vyp
teal-language-server,,,http://luarocks.org/dev,,,
Expand All @@ -131,6 +130,6 @@ tiktoken_core,,,,,,natsukium
tl,,,,,,mephistophiles
toml,,,,,,mrcjkb
toml-edit,,,,,5.1,mrcjkb
vstruct,https://github.com/ToxicFrog/vstruct.git,,,,,
vstruct,,,,,,
vusted,,,,,,figsoda
xml2lua,,,,,,teto
3 changes: 3 additions & 0 deletions nixos/doc/manual/release-notes/rl-2405.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
[v0.31](https://github.com/derailed/k9s/releases/tag/v0.31.0) for details. It is recommended
to back up your current configuration and let k9s recreate the new base configuration.

- the .csv format used to define lua packages to be updated via
`luarocks-packages-updater` has changed: `src` (URL towards a git repository) has now become `rockspec` (URL towards a rockspec) to remove ambiguity regarding which rockspec to use and simplify implementation.

- NixOS AMIs are now uploaded regularly to a new AWS Account.
Instructions on how to use them can be found on <https://nixos.github.io/amis>.
We are working on integration the data into the NixOS homepage.
Expand Down
21 changes: 11 additions & 10 deletions pkgs/development/lua-modules/updater/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
class LuaPlugin:
name: str
"""Name of the plugin, as seen on luarocks.org"""
src: str
"""address to the git repository"""
rockspec: str
"""Full path towards the rockspec"""
ref: Optional[str]
"""git reference (branch name/tag)"""
version: Optional[str]
Expand Down Expand Up @@ -103,7 +103,7 @@ def generate_nix(self, results: List[Tuple[LuaPlugin, str]], outfilename: str):
f.write(HEADER)
header2 = textwrap.dedent(
"""
{ stdenv, lib, fetchurl, fetchgit, callPackage, ... } @ args:
{ stdenv, lib, fetchurl, fetchgit, callPackage, ... }:
final: prev:
{
"""
Expand Down Expand Up @@ -171,16 +171,17 @@ def generate_pkg_nix(plug: LuaPlugin):
if plug.maintainers:
cmd.append(f"--maintainers={plug.maintainers}")

if plug.src != "":
if plug.src is None:
if plug.rockspec != "":
if plug.ref or plug.version:
msg = (
"src must be set when 'version' is set to \"src\" for package %s"
"'version' and 'ref' will be ignored as the rockspec is hardcoded for package %s"
% plug.name
)
log.error(msg)
raise RuntimeError(msg)
log.debug("Updating from source %s", plug.src)
cmd.append(plug.src)
log.warn(msg)

log.debug("Updating from rockspec %s", plug.rockspec)
cmd.append(plug.rockspec)

# update the plugin from luarocks
else:
cmd.append(plug.name)
Expand Down

0 comments on commit 9e22d74

Please sign in to comment.