-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nimble install nimlsp cannot open file /usr/nimsuggest/nimsuggest.nim #68
Comments
duplicate #67 |
As SolitudeSF mentioned this is a duplicate. But maybe NimLSP should detect this case and give a better warning so that it's easier for users to figure out what's wrong |
nimsuggest should be a nimble package |
If you install the The alternative is for NimLSP to be choosenim aware. So it would check when run whether the Araq also suggested putting NimLSP into the core Nim distribution which would solve all of this. But that would mean the Nim tools would have external dependencies, which is a bit odd. |
How to build it on mac?
|
I'm not sure if you can pass command arguments like that to Nimble, or it might just not like the relative path. I'd recommend installing Nim via choosenim, but if that's not an option then you might have to install NimLSP manually to build with |
@PMunch thank you for instant reply. Nim is installed with no problem using choosenim or homebrew, but nimble doesn't know anything about nimlsp, so i tried the manual build. It requires nimsuggest sources. So i have to check out the Nim repo to have nimsuggest/nimsuggest.nim Actually the question is how to install it manually on mac? It depends on nimsuggest which tries to include "std/private/decode_helpers" and fails. This one is with "choosenim" but result is the same
|
I managed to do it finally. Not sure if it's a proper way or too hacky. I moved nimlsp sources folder to Nim sources folder, and made couple changes to koch.nim file. This is my diff in case somebody stuck with the same issue:
There was a warning during compile time, @PMunch not sure if it's important:
After that just run build_all.sh and it compiles to Nim/bin/nimlsp |
I can kind of understand why nimlsp needs access to the nim sources, but why not just have it carry a copy of the correct source for every major release of nim (handles common cases), along with a way to accept a path to an external source repo (handles the exceptional case)? That would let it be easily installable via nimble at the cost of a bit more package size. Alternately, it could pull down a tarball of the correct source from github at install time. |
@pjz because when installing NimLSP most users already have the Nim sources on their machine, so why download a new copy or write a bunch of logic to pull down tarballs for something that's already on disk? It seems like maybe NimLSP has some trouble building on Mac and Windows because of not finding |
I think this is incorrect. People who are new or trying out Nim (which are the people who need an LSP most!) probably got it installed via a package manager (apt, yum, whatever) and so do NOT have the Nim source on their machine. |
Depends on the package manager, the Arch package at least contains the sources. In fact the only ones I've heard who've had problems with Nim from a package manager in the past are Mac users. But I can see some newcomer installing Nim with an oddly packaged package and not having them only to be annoyed that installing NimLSP doesn't work. I guess NimLSP could do some checks to see if it can find the sources it needs (instead of just assuming that they're there and failing at the compilation stage if they are not) in order to spit out an informative message that you either need to point it at the correct sources or if you don't have them grab them from some URL. |
...or make it clear that if you're packaging Nim, you need to package the source as well. |
I have the same problem on FreeBSD:
, and I guess on all system where |
I'm on Manjaro (Arch), have Nim installed via pacman -S nim, sources are in When I try to install nimlsp via nimble like so:
And nothing more.
Or like this:
So, who to install Nimlsp then? I want to continue using Nim from Manjaro repos instead of |
its weird that this logic is replicated in code, when we have same almost same thing going on in config. i have a quick pr.
you can import nimsuggest because its path is retrieved with getCurrentCompilerExe(), just in config, not in the importing module. |
@SolitudeSF , do you think it will compile for all OS'es? i mean |
dont see why it would be os dependant |
Still not working after applying #124:
What I’m doing wrong? |
do you have nimsuggest source installed with nim compiler? that pr isnt meant to fix this issue (because the issue is in your setup) |
that patch cleaned up nimlsp analysis errors for suggestlib.nim file and has nothing to do with compilation step of nimlsp. |
can we make nim install script include nimsuggest and iterate these dirs https://github.com/nim-lang/Nim/blob/devel/tools/niminst/install.nimf or download nimsuggest directory from git repo and import it? |
Why should we download the sources for trying new language? I have dozens language installed on emacs, but this case is the first. I understand why it should be , but still stupid. |
It's a bit unfortunate. Granted you don't have to install NimLSP to try Nim, I used the language for years before I even wrote this project. Certainly nice to have, but in my mind not really a requisite. That said I guess we could set up a CD pipeline here on GitHub to build the binaries and simply distribute them. After all that's how you get Nim installed without sources in the first place. |
The problem with the command I'm not sure how I can make nimble pass forward that flag to the compiler. |
Move the flag after the package name |
@SolitudeSF Nope. Doesn't work. It still installs the dependencies only. I installed |
Seems like Nimble doesn't handle its arguments properly and confuses the shorthand |
This issue doesn't come up when installing other nimble packages (nake, godot, nimx, etc).
When I run
nimble install nimlsp
it returns the following error:I have nim and nimble installed using the package inside the pacman repos.
versions:
nim: 1.4.2
nimble: 0.12.0
The text was updated successfully, but these errors were encountered: