Open f3fora opened 3 years ago
See @teto's comment on #526 for the first part.
Re: new-version
: My understanding was that this command only updates the rockspec for a given rock, and does not actually update rocks. Is this incorrect?
first time I see new-version. I dont see why this would be needed ? just install the rockspecs from the different repos ? they may have conflicting requirements but as a first approach that should be fine.
Yes; I'm not sure that new-version
solves any problems for us here (though I do want to find a way to update installed rocks, which we currently lack).
Sorry. I misunderstood new version
function. I was stupid, because I use it something for its real purpose.
I actually need a easy way to update rocks.
Maybe, comparing results of
luarocks show myrock --mversion
and luarocks search myrock
can be useful.
Alternatively, using the entry version
in use_rocks
such that one can explicitly choose the rock version can solve the issue, leaving to the user the job of checking when a new version is released.
Alternatively, using the entry version in use_rocks such that one can explicitly choose the rock version can solve the issue, leaving to the user the job of checking when a new version is released.
However, version argument raises the following error
Usage: luarocks install [-h] [--keep] [--force] [--force-fast]
[--only-deps] [--no-doc] [--verify] [--check-lua-versions]
[--deps-mode <mode>] [--no-manifest] <rock> [<version>]
Error: option '--version' does not take arguments
using luarocks commands with just the package name wont be practical because most plugin authors won't upload their rockspec to luarocks.org, we just need the builiding blocks to be there (nvim-plenary, lush.nvim etc). So I believe packer will have to pass an explicit path to the rockspec.
Btw your report is missing the actual command you ran but I can guess the issue anyway. Try:
luarocks install plenary.nvim 1.2
instead (replace the entries, you just pass the version number directly)
using luarocks commands with just the package name wont be practical because most plugin authors won't upload their rockspec to luarocks.org, we just need the builiding blocks to be there (nvim-plenary, lush.nvim etc). So I believe packer will have to pass an explicit path to the rockspec.
Ok! I didn't even think about this. I just use it with some luarocks.org packages.
Btw your report is missing the actual command you ran but I can guess the issue anyway. Try:
luarocks install plenary.nvim 1.2
instead (replace the entries, you just pass the version number directly)
This was a report about packer.nvim
when using
use_rocks {'my_package' , version='my_version'}
FWIW the use_rocks
keys get converted into flags like --<key>
but I guess version needs to be special cased to just pass in the value without the flag prefix.
FWIW the
use_rocks
keys get converted into flags like--<key>
but I guess version needs to be special cased to just pass in the value without the flag prefix.
So, this is actually a bug!
Yeah, version
isn't special cased like env
so it falls into https://github.com/wbthomason/packer.nvim/blob/3fdea07bec6cb733d2f82e50a10829528b0ed4a9/lua/packer/luarocks.lua#L219
Actually the solution is to change this line https://github.com/wbthomason/packer.nvim/blob/3fdea07bec6cb733d2f82e50a10829528b0ed4a9/lua/packer/luarocks.lua#L207
adding or key == 'version'
I can fix this but I prefer not to open a PR for just few words.
@f3fora I don't actually that's the best solution. That line is intended to prevent users being able to mess with how the luarocks are installed since packer is already using those and a user messing with those two keys specifically would cause breakage. Whilst adding it there would allow it to work, it would muddy the waters about what that function is for. I think it would be better to explicitly special case the version key to just pass the value without a flag
Describe the feature
luarocks build
Use packer to build a
.rockspec
withluarocks build
, such that one can define something likeluarocks new-version
When one executes
:PackerUpdade
, packer should call alsoluarocks new-version my-rock
to update rocks, wheremy-rock
is each luarocks dependency installed with packer.