Skip to content
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

How to start ? #30

Closed
AmjadHD opened this issue Jan 5, 2023 · 17 comments
Closed

How to start ? #30

AmjadHD opened this issue Jan 5, 2023 · 17 comments

Comments

@AmjadHD
Copy link
Contributor

AmjadHD commented Jan 5, 2023

After building with Nim 81b7f9108f139bbf237f3e121fdbe9ff32a7193f, I ran the generated exe and got this:

D:\Amjad\langserver>nimlangserver.exe
D:\Amjad\langserver\nimlangserver.nim(858) nimlangserver
C:\Users\User\.nimble\pkgs\asynctools-#non-blocking\asynctools\asyncpipe.nim(191) createPipe
C:\Users\User\.choosenim\toolchains\nim-#devel\lib\std\oserrors.nim(92) raiseOSError
Error: unhandled exception: The system cannot find the path specified.
 [OSError]

D:\Amjad\langserver>

Note: I'm on Windows.

@AmjadHD
Copy link
Contributor Author

AmjadHD commented Jan 6, 2023

@yyoncho sorry for the ping, ^.

@AmjadHD
Copy link
Contributor Author

AmjadHD commented Jan 18, 2023

@zah ^.

@veksha
Copy link

veksha commented Jun 8, 2023

same error. latest nim devel.
nimlsp has related issue PMunch/nimlsp#131

nimlsp at least works (without async on windows)

@n0bra1n3r
Copy link

I've got the same error. Does anyone know which version of Nim this works with? I'm on neovim as well, and have tried using Nim version 1.6, 2.0, and devel. I had the following config working in neovim at some point but I can't remember which versions of langserver and nim I was using:

  config.nim_langserver.setup {
    on_new_config = function(new_config, new_root_dir)
      new_config.rootUri = ([[file://%s]]):format(new_root_dir)
    end,
    root_dir = function(filename)
      return config.util.root_pattern[[*.nimble]](filename) or
        config.util.root_pattern[[config.nims]](filename) or
        config.util.root_pattern[[*.cfg]](filename) or
        config.util.root_pattern[[*.nimcfg]](filename) or
        config.util.root_pattern[[*.nims]](filename) or
        config.util.root_pattern[[.nvim]](filename) or
        config.util.root_pattern[[.git]](filename) or
        config.util.root_pattern[[main.nim]](filename) or
        config.util.root_pattern[[*.nim]](filename)
    end,
    settings = {
      -- We are using null-ls for checking.
      checkOnSave = false,
      autoCheckFile = false,
      autoCheckProject = false,
    },
  }

@nickysn
Copy link
Collaborator

nickysn commented Dec 15, 2023

Should be fixed in 6f25160

@veksha
Copy link

veksha commented Dec 15, 2023

still same error for me

Shutting down due to an error: The system cannot find the path specified.

D:\Programm\Nim\langserver\nimlangserver.nim(1024) nimlangserver
D:\Programm\Nim\langserver\nimlangserver.nim(1007) main
C:\Users\yura\.nimble\pkgs\asynctools-#non-blocking\asynctools\asyncpipe.nim(191) createPipe
D:\Programm\Nim\Nim-devel\lib\std\oserrors.nim(92) raiseOSError

@nickysn
Copy link
Collaborator

nickysn commented Dec 15, 2023

C:\Users\yura\.nimble\pkgs\asynctools-#non-blocking\asynctools\asyncpipe.nim(191) createPipe <-- this looks like the old and broken version of asynctools. How are you building the project? You should build it against this version of asynctools: https://github.com/nickysn/asynctools/tree/fixes_for_nimlangserver

@veksha
Copy link

veksha commented Dec 15, 2023

i clone repo and do nimble build.
i see the following lines:

...
      Info: Dependency on https://github.com/nickysn/asynctools@#fixes_for_nimlangserver already satisfied
...
      Info: Dependency on unittest2@any version already satisfied
  Verifying dependencies for unittest2@0.0.6
 Installing https://github.com/yyoncho/asynctools@#non-blocking
Downloading https://github.com/yyoncho/asynctools using git
  Verifying dependencies for asynctools@#non-blocking
 Installing asynctools@#non-blocking
   Success: asynctools installed successfully.
...

maybe it's installing both versions and using the last one?

nimble --version
nimble v0.13.1 compiled at 2023-05-06 22:52:57
git hash: 8cf5643621600aaa869935721227fc3b7ee5f881

@veksha
Copy link

veksha commented Dec 17, 2023

i think nimble build first gets asynctools#fixes_for_nimlangserver.
then it downloads nim-json-rpc#notif-changes (which downloads wrong version of asynctools) and sets paths for imports.

i swapped lines in .nimble file like this and now it works:

requires "nim >= 1.0.0",
         "https://github.com/yyoncho/nim-json-rpc#notif-changes",
         "https://github.com/nickysn/asynctools#fixes_for_nimlangserver",
         "with",
         "chronicles"

package order matters.
similar issue: #14

@AmjadHD
Copy link
Contributor Author

AmjadHD commented Dec 18, 2023

now it starts but it doesn't respond to any requests.

@veksha
Copy link

veksha commented Dec 22, 2023

@AmjadHD any logs?

@AmjadHD
Copy link
Contributor Author

AmjadHD commented Dec 23, 2023

nvm, it was fixed by #79

@lost22git
Copy link

same error

╰─❯ nimlangserver
Shutting down due to an error: The system cannot find the path specified.

oserrors.nim(92)         raiseOSError

@sixwaaaay
Copy link

error when using mingw:

could not load: pcre64.dll

msvc

Shutting down due to an error: The system cannot find the path specified.

oserrors.nim(92)         raiseOSError

@veksha
Copy link

veksha commented Jan 27, 2024

@lost22git @sixwaaaay
make sure your nimble is not outdated like v0.13.1, but newer, something like 0.14.2.

i was having "Shutting down due to an error: The system cannot find the path specified" because nimble was old and it was using old and broken asynctools branch when building nimlangserver.

@lost22git
Copy link

@lost22git @sixwaaaay make sure your nimble is not outdated like v0.13.1, but newer, something like 0.14.2.

i was having "Shutting down due to an error: The system cannot find the path specified" because nimble was old and it was using old and broken asynctools branch when building nimlangserver.

it still error

 nimlangserver
Shutting down due to an error: The system cannot find the path specified.

oserrors.nim(92)         raiseOSError

╭╴🪟 $psh _config on  main [✘!?]
╰─❯ nimble --version
nimble v0.14.2 compiled at 2023-12-15 01:21:03
git hash: couldn't determine git hash

@nickysn
Copy link
Collaborator

nickysn commented Feb 6, 2024

This has been fixed in the latest release. We also provide binaries, in case you have trouble building from source.

@nickysn nickysn closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants