mason.nvim
mason.nvim copied to clipboard
Error while installing specific version of jdtls
I've searched open issues for similar requests
- [X] Yes
I've recently downloaded the latest plugin version of mason.nvim
- [X] Yes
Problem description
I tried to install a specific version of jdtls, and I got an error.
:Mason install [email protected]
I spotted that the date added to the download URL does not match. It should be jdt-language-server-1.27.1-202309140221.tar.gz.
The date current datetime in the download URL is the one for [email protected].
Expected behavior
When requesting for [email protected], the url should be https://www.eclipse.org/downloads/download.php?file=/jdtls/milestones/1.27.1/jdt-language-server-1.27.1-202309140221.tar.gz
Affected packages
jdtls
Mason output
Failed
◍ jdtls
▶ # [5/5] Failed to download file "https://download.eclipse.org/jdtls/milestones/1.27.1/jdt-language-server-1.27.1-202309281329.tar.gz".
Installation log
[WARN Mar 24 oct 14:26:06 2023] ...zy/mason.nvim/lua/mason-core/installer/registry/util.lua:50: Failed to fetch versions for package Package(name=jdtls)
[ERROR Mar 24 oct 14:26:08 2023] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:249: Installation failed for Package(name=jdtls) error='spawn: wget failed with exit code 8 and signal 0. \nFailed to download file "https://download.eclipse.org/jdtls/milestones/1.27.1/jdt-language-server-1.27.1-202309281329.tar.gz".'
[INFO Mar 24 oct 14:28:56 2023] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:184: Executing installer for Package(name=jdtls) {
version = "v1.27.1"
}
Neovim version (>= 0.7)
NVIM v0.9.4 Build type: Release LuaJIT 2.1.0-beta3
Operating system/version
Darwin MacBook-Pro.local 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000 arm64
Healthcheck
mason.nvim ~
- OK mason.nvim version v1.8.1
- 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: 2023-10-24-sturdy-atm` 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.3 compilé sur darwin22.1.0.`
- OK curl: `curl 8.1.2 (x86_64-apple-darwin23.0) libcurl/8.1.2 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.55.1`
- OK gzip: `Apple gzip 428`
- OK tar: `bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.0.5 bz2lib/1.0.8 `
- OK bash: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)`
- OK sh: `Ok`
mason.nvim [Languages] ~
- OK Ruby: `ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23]`
- OK luarocks: `/opt/homebrew/bin/luarocks 3.9.2`
- OK Go: `go version go1.20.2 darwin/arm64`
- OK RubyGem: `3.0.3.1`
- OK node: `v20.7.0`
- OK npm: `10.1.0`
- OK java: `openjdk version "17.0.5" 2022-10-18`
- WARNING julia: not available
- ADVICE:
- spawn: julia failed with exit code - and signal -. julia is not executable
- OK python: `Python 3.11.5`
- OK JAVA_HOME: `openjdk version "17.0.5" 2022-10-18`
- OK javac: `javac 17.0.5`
- OK cargo: `cargo 1.72.1`
- OK pip: `pip 23.2.1 from /opt/homebrew/lib/python3.11/site-packages/pip (python 3.11)`
- OK python venv: `Ok`
- OK PHP: `PHP 8.2.11 (cli) (built: Sep 26 2023 11:11:58) (NTS)`
- OK Composer: `Composer version 2.6.4 2023-09-29 10:54:46`
mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 4. Remaining: 4996. Limit: 5000. Reset: Mar 24 oct 15:24:31 2023.
Screenshots
No response
This also happens on Linux with other versions of jdtls
Hello! Yeah this issue is somewhat unique to jdtls due to how they version their releases. Every release contains a timestamp (e.g. 1.27.1-202309140221) which makes it not feasible to support other versions than the latest (I would however consider supporting the latest <5 releases or so). Every time a release is made I have to manually adjust this timestamp. I can't figure out a nice way to support installing older versions of jdtls without having to make special adjustments for jdtls specifically.
If you want to support older versions I'd very much appreciate a PR to the registry to add them. You can use the angular-language-server as reference.
edit: I just realized that this would currently not be possible due to the timestamp being included in the version, which would cause the version comparison to fail (mason.nvim would fail to parse 1.27.1-202309140221 as a valid semver version).