Skip to content

Commit

Permalink
fix(luarocks): try to install from root manifest (#1687)
Browse files Browse the repository at this point in the history
## Description

When passing the `--dev` flag to `luarocks`, it will prioritise `dev`
versions when resolving dependencies (treating `dev` or `scm` as greater
than a SemVer version) if the rockspec doesn't specify an upper version
constraint (which is often the case).

Dev packages are often unstable and may cause more problems, especially
for Windows users (an example I've seen is git for windows trying and
failing to checkout submodules).

For now , a good compromise between too many retries and not retrying at
all could be to try `luarocks install` from the root manifest first, but
to keep the `--dev` flag in `luarocks make`.

If that still causes problems, it might be better to fall back to
`luarocks make` without `--dev` first, and then to try `luarocks ---dev
make` as a last resort.
In rocks.nvim, we only fall back to adding the `--dev` flag if the
install error message contains the string `"No results matching query
were found"`; assuming that stable non-dev packages shouldn't depend on
dev packages.
  • Loading branch information
mrcjkb authored Aug 31, 2024
1 parent 80da254 commit 591ef40
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lua/lazy/pkg/rockspec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ function M.build(task)
root,
"--server",
Config.options.rocks.server,
"--dev",
"--lua-version",
"5.1",
"install", -- use install so that we can make use of pre-built rocks
Expand Down

0 comments on commit 591ef40

Please sign in to comment.