mason.nvim icon indicating copy to clipboard operation
mason.nvim copied to clipboard

Failed to install editorconfig-checker due to missing Golang executable

Open Jarmos-san opened this issue 2 years ago • 3 comments

I've made an initial investigation into the error myself

  • [X] Yes

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

  • [X] Yes

Problem description

Mason fails to install editorconfig-checker due to the missing go executable.

Neovim version (>= 0.7)

NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Operating system/version

Linux ######## 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Affected packages

editorconfig-checker

Actual behavior

Mason cannot install editorconfig-checker due to missing go binary which is because the API is configured to build the binary at runtime (just a guess)?

Expected behavior

Mason should have been able to simply download the ec binary from the GitHub releases page.

Mason output

Failed (1)
  ◍ editorconfig-checker
    spawn: go failed with exit code - and signal -. go is not executable

Installation log

[INFO  Thu Sep  1 08:11:09 2022] ...acker/start/mason.nvim/lua/mason-core/installer/init.lua:110: Executing installer for Package(name=editorconfig-checker)
[DEBUG Thu Sep  1 08:11:09 2022] .../site/pack/packer/start/mason.nvim/lua/mason-core/fs.lua:70: fs: mkdirp /root/.local/share/nvim/mason/.packages/editorconfig-checker
[DEBUG Thu Sep  1 08:11:09 2022] ...te/pack/packer/start/mason.nvim/lua/mason-core/spawn.lua:82: "go" is not executable
[ERROR Thu Sep  1 08:11:09 2022] ...acker/start/mason.nvim/lua/mason-core/installer/init.lua:146: Installation failed for Package(name=editorconfig-checker) error=spawn: go failed with exit code - and signal -. go is not executable
[DEBUG Thu Sep  1 08:11:09 2022] .../site/pack/packer/start/mason.nvim/lua/mason-core/fs.lua:46: fs: rmrf /root/.local/share/nvim/mason/.packages/editorconfig-checker
[DEBUG Thu Sep  1 08:11:09 2022] ...ker/start/mason.nvim/lua/mason-core/installer/linker.lua:21: Unlinking Package(name=editorconfig-checker)

Healthcheck

mason: require("mason.health").check()
========================================================================
## mason.nvim report
  - OK: neovim version >= 0.7.0
  - WARNING: Go: not available
  - WARNING: cargo: not available
  - WARNING: luarocks: not available
  - WARNING: Ruby: not available
  - WARNING: RubyGem: not available
  - WARNING: Composer: not available
  - WARNING: PHP: not available
  - ERROR: npm: not available
  - ERROR: node: not available
  - OK: python3: `Python 3.10.6`
  - WARNING: pip3: not available
  - WARNING: javac: not available
  - WARNING: java: not available
  - WARNING: julia: not available
  - ERROR: wget: not available
  - OK: curl: `curl 7.84.0 (x86_64-pc-linux-gnu) libcurl/7.84.0 OpenSSL/3.0.4 zlib/1.2.11 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.3 libpsl/0.21.0(+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.48.0 librtmp/2.3 OpenLDAP/2.5.12`
  - OK: gzip: `gzip 1.10`
  - OK: tar: `tar (GNU tar) 1.34`
  - OK: bash: `GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)`
  - OK: sh: `Ok`
  - OK: GitHub API rate limit. Used: 26. Remaining: 34. Limit: 60. Reset: Thu Sep  1 08:41:06 2022.

Screenshots

No response

Jarmos-san avatar Sep 01 '22 08:09 Jarmos-san

I am not an expert, but based on this package, it does seem like installation does happen using the go binary. https://github.com/williamboman/mason.nvim/blob/main/lua/mason-registry/editorconfig-checker/init.lua.

Presumably, the reason is because, it is hard / tedious checking the OS and then also having to then having to make the version is up to date in the config file. Installing go for the user is not too difficult

jay-babu avatar Sep 04 '22 04:09 jay-babu

Installing go for the user is not too difficult

Agreed!

And I'm not a Lua expert either but I took a look through the source code & realised, mason.nvim "does support" (need clarification) downloading a GitHub release (see source code). And I believe mason.nvim can fetch the binaries from the project's release page.

Jarmos-san avatar Sep 04 '22 10:09 Jarmos-san

Downloading precompiled assets is generally preferred, especially if the package itself has no connection to the compiler environment being used (go & editorconfig are completely unrelated). rust-analyzer can be used as reference for downloading GitHub release assets. PR for these things are very welcome, otherwise I'll get around to this eventually!

williamboman avatar Sep 04 '22 12:09 williamboman