bash-language-server icon indicating copy to clipboard operation
bash-language-server copied to clipboard

Bundle ShellCheck executables for most platforms

Open skovhus opened this issue 2 years ago • 3 comments

The vscode extension for ShellCheck bundles pre-compiled binaries for ShellCheck. This is a great feature that could be integrated into the bash-language-server – it would give a much better developer experience for all the users that doesn't have ShellCheck installed (or doesn't know about ShellCheck).

This would work for darwin arm64/x64, linux arm/arm64/x64 and win32 ia32/x64.

Implementation

ShellCheck provides binary distributions. https://github.com/vscode-shellcheck/shellcheck-binaries can be used to enabling using tools such as bindl. I quickly tried exposing those in an npm package (proof of concept: npm install shellcheck-binaries) which gives a footprint of 152 MB (note that bash-language-server is currently 5 MB). It is a big increase for the vscode extension and especially the bash-language-server.

As a first step we could simply do this opt in for now – as an optional dependency. And include the dependency for vscode.

skovhus avatar Jan 07 '23 09:01 skovhus

Or you could download the binary using a script? There is a great script you could adapt that uses uname -sm to find out the user's system, and also checks the system for curl and wget: https://github.com/junegunn/fzf/blob/master/install . It should be battle tested... I don't really know that much about the subject, so please take my suggestion as just a crazy idea :)

David-Else avatar Jan 12 '23 19:01 David-Else

Rather than bundling all of the the binaries in one package, most packages shiping native binaries follow the esbuild method these days. Esbuild made an npm scope, then put a package in it for each arch/os combo. It then pinned them all in the optionalDependencies field, and npm only fetches the ones for the current platform. I don't know if vscode would be that intelligent though.

lishaduck avatar Jul 07 '24 17:07 lishaduck