williamboman/mason.nvim

Checkhealth fails to report luarocks version number

Closed this issue · 4 comments

I've searched open issues for similar requests

  • Yes

I've recently downloaded the latest plugin version of mason.nvim

  • Yes

Problem description

When using a luarocks version with a minor version number which has more than one digit mason will fail to parse the version number.

Expected behavior

Mason should parse the version number of luarocks regardless of how many digits the minor version number is.

Steps to reproduce

  1. Install luarocks with a minor version number that has more than one digit (exg: 3.10.0)
  2. run :checkhealth mason

Neovim version (>= 0.7)

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Operating system/version

Linux archlinux 6.7.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 03 Mar 2024 00:30:36 +0000 x86_64 GNU/Linux

Healthcheck output

mason: require("mason.health").check()

mason.nvim ~
- OK mason.nvim version v1.10.0
- OK PATH: prepend
- OK Providers: 
  mason.providers.registry-api
  mason.providers.client
- OK neovim version >= 0.7.0

mason.nvim [Registries] ~
- OK Registry `github.com/mason-org/mason-registry version: 2024-03-04-scarce-bonito` is installed.

mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send`
- OK wget: `GNU Wget 1.21.4 built on linux-gnu.`
- OK curl: `curl 8.6.0 (x86_64-pc-linux-gnu) libcurl/8.6.0 OpenSSL/3.2.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 libssh2/1.11.0 nghttp2/1.60.0 nghttp3/1.2.0`
- OK gzip: `gzip 1.13`
- OK tar: `tar (GNU tar) 1.35`
- OK bash: `GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu)`
- OK sh: `Ok`

mason.nvim [Languages] ~
- OK Go: `go version go1.22.0 linux/amd64`
- OK Ruby: `ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]`
- OK PHP: `PHP 8.3.3 (cli) (built: Feb 16 2024 17:14:40) (NTS)`
- WARNING luarocks: failed to parse version
  - ADVICE:
    - Error: ~/.local/share/nvim/lazy/mason.nvim/lua/mason/health.lua:214: attempt to compare number with nil
- OK node: `v21.6.2`
- OK cargo: `cargo 1.76.0 (c84b36747 2024-01-18)`
- OK Composer: `Composer version 2.7.1 2024-02-09 15:26:28`
- OK java: `openjdk version "21.0.2" 2024-01-16`
- OK RubyGem: `3.3.25`
- OK julia: `julia version 1.10.1`
- OK python: `Python 3.12.2`
- OK npm: `10.5.0`
- OK javac: `javac 21.0.2`
- OK pip: `pip 24.0 from ~/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip (python 3.12)`
- OK python venv: `Ok`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 0. Remaining: 5000. Limit: 5000. Reset: Tue 05 Mar 2024 12:03:31 AM.

Screenshots

No response

I'm currently having the exact same problem and I thought it was something odd in my current installation. Nice to see other people are having the same error.

I managed to fix this on my system by changing the pattern in 'lua/mason/health.lua:213' from "(%d+)%.(%d)%.(%d)" to "(%d+)%.(%d+)%.(%d+)".

Let me know if I should submit a PR with this fix, or if I should let an existing maintainer add it.

I'm also affected exactly the same way.
@FerretDetective I have no authority here, but I'd encourage you to make the PR.
MY luarocks is on version 3.10.0 and your fix will handle it correctly whereas the current one won't.

cxwx commented

same issus

and my luarocks version

$>> luarocks --version
/opt/homebrew/bin/luarocks 3.11.0
LuaRocks main command-line interface

not sure why.