lunarvim.org icon indicating copy to clipboard operation
lunarvim.org copied to clipboard

Adding Dependencies to Installation Docs

Open christopher-besch opened this issue 2 years ago • 22 comments

closes LunarVim#2028 There is probably a lot more to be added here but this is at least a start.

christopher-besch avatar Dec 04 '21 08:12 christopher-besch

xclip applies to Linux, maybe not macOS and certainly not Windows. This is also missing ripgrep, for what it's worth.

chase avatar Dec 04 '21 08:12 chase

Sidenote: when the installer asks you for rust dependencies, it will install fd-find and ripgrep for you

abzcoding avatar Dec 04 '21 08:12 abzcoding

@kylo252 The installer uses cargo to install ripgrep and fd-find, so maybe it should go in there and rg and fd should sub-items of it: https://github.com/LunarVim/LunarVim/blob/rolling/utils/installer/install.sh#L242-L251

chase avatar Dec 04 '21 08:12 chase

Sidenote: when the installer asks you for rust dependencies, it will install fd-find and ripgrep for you

I'm pretty sure it doesn't, as it didn't ask me when I installed the latest version, which lead to the referenced Issue.

christopher-besch avatar Dec 04 '21 08:12 christopher-besch

@kylo252 The installer uses cargo to install ripgrep and fd-find

The thing is that you can install these through your package manager or something and never have to deal with cargo 🤷

I'm pretty sure it doesn't, as it didn't ask me when I installed the latest version, which lead to the referenced Issue.

Maybe you missed it, since it's optional.

kylo252 avatar Dec 04 '21 08:12 kylo252

Maybe you missed it, since it's optional.

Maybe I did, but the installer never asked me so I don't even now where I should've been looking.

christopher-besch avatar Dec 04 '21 08:12 christopher-besch

Maybe I did, but the isntaller never asked me so I don't even now where I should've been looking.

Which system did you say you were using? I know that Debian has some other fd by default.

kylo252 avatar Dec 04 '21 08:12 kylo252

@kylo252 The installer uses cargo to install ripgrep and fd-find

The thing is that you can install these through your package manager or something and never have to deal with cargo shrug

While it may be optional, I think it's the most direct way to getting them installed. Also distros may have out of date versions of the software or like in Ubuntu, doesn't install the binary as fd.

There are also cases, like on macOS, where the package manager is unreliable and often comes with out of date software and in the case of Homebrew, it often compiles from source anyway.

chase avatar Dec 04 '21 08:12 chase

There are also cases, like on macOS, where the package manager is unreliable and often comes with out of date software and in the case of Homebrew, it often compiles from source anyway.

It's a bit more tricky with macOS and where to get cargo, see https://github.com/LunarVim/LunarVim/issues/1021#issuecomment-915851897

kylo252 avatar Dec 04 '21 08:12 kylo252

Which system did you say you were using?

I'm using Manjaro which initially lacks both xclip and fd. I've also tested Ubuntu and Fedora, where they're installed by default. On Debian xclip is missing but fd is fine.

christopher-besch avatar Dec 04 '21 09:12 christopher-besch

In Debian, fd references to another binary and not https://github.com/sharkdp/fd. Ref: The docs of https://github.com/sharkdp/fd I am not sure of the Debian fd is the same as the rust package find-fd that LunarVim uses, since I don't use Debian and can't find any docs on this. @christopher-besch Could you look into this, since it seems like you have a Debian system? A fast fd -h might be sufficient.

Uzaaft avatar Dec 11 '21 15:12 Uzaaft

Interesting... The Debian package for fd is called fd-find. I installed that and it exposed fd only through fdfind, without the dash. There is no fd package for Debian. This is the help page you requested: image

christopher-besch avatar Dec 12 '21 06:12 christopher-besch

I wonder if LunarVim is even capable of finding that weird fdfind command.

christopher-besch avatar Dec 12 '21 06:12 christopher-besch

I wonder if LunarVim is even capable of finding that weird fdfind command.

I'm always hesitant to how much additional processing I can do in the installer because it's a headache not being able to use basic bash features (e.g. associative arrays) on macOS 😢

see LunarVim/LunarVim@a9bf1d0 (#1052)

I'd much rather stop trying to re-invent the wheel and instead use actual native tools per-platform for detecting dependencies.

kylo252 avatar Dec 12 '21 08:12 kylo252

You can alias fdfind to fD, just follow the guide in the docs.

Uzaaft avatar Dec 12 '21 08:12 Uzaaft

You can alias fdfind to fD, just follow the guide in the docs.

But that's something the user has to do. It's obviously be much more convenient for the installation script to do that job.

I'm always hesitant to how much additional processing I can do in the installer [...]

I feel you. Your efforts are very much appreciated! What kind of dependency detection tools are you thinking about?

christopher-besch avatar Dec 12 '21 09:12 christopher-besch

You can alias fdfind to fD, just follow the guide in the docs.

But that's something the use has to do. It's obviously be much more convenient for the installation script to do that job.

I'm always hesitant to how much additional processing I can do in the installer [...]

I feel you. Your efforts are very much appreciated! What kind of dependency detection tools are you thinking about?

If the user chooses to manually install all dependencies, I think they should do the job.

Regarding the detection of dependencies, are we talking about only the *NIX systems? If so, I got a neat built in method that I use in my fish config.

if command -v <the_command> &> /dev/null
     do_stuff_if_command_is_found
else
    do_something_else
end

The fish code above should Posix compliant

Uzaaft avatar Dec 12 '21 10:12 Uzaaft

But that's something the user has to do. It's obviously be much more convenient for the installation script to do that job.

I don't think it's that easy to do with only user-level privileges. Hell, some users don't even have npm install working without sudo. And technically, none of these are a requirement, but more in the quality-of-life category.

I feel you. Your efforts are very much appreciated!

Thank you ❤️

What kind of dependency detection tools are you thinking about?

Ideally, your package manager should deal with this, because the alternative is very time-consuming when trying to create a cross-platform dependency-aware installer from scratch.

kylo252 avatar Dec 12 '21 11:12 kylo252

Ideally, your package manager should deal with this [...]

So we'd need to publish LunarVim on all kinds of package managers?

christopher-besch avatar Dec 12 '21 12:12 christopher-besch

So we'd need to publish LunarVim on all kinds of package managers?

Only the most popular ones from each platform:

  • Linux: PKGBUILD and maybe Nix
  • OSX: Homebrew
  • OpenBSD: these gurus can handle following simple instructions
  • Windows: maybe scoop (although I just realized that we can re-use PKGBUILD with msys!)

The alternative is that someone has to write that package manager just for lunarvim 😞

kylo252 avatar Dec 12 '21 12:12 kylo252

What about Arch?

christopher-besch avatar Dec 12 '21 16:12 christopher-besch

Arch uses PKGBUILD. Example: Tensorflow PKGBUILD

Uzaaft avatar Dec 14 '21 16:12 Uzaaft