oakes / vim_cubed

Vim rendered on a cube for no reason

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build vim3- problem with paravim?

ajrilatt opened this issue · comments

I'm running Windows 11. This is my first interaction with Nim. Installed Nim 2.0.0:

Nim Compiler Version 2.0.0 [Windows: amd64]
Compiled at 2023-08-01

When running nimble run vim3 from the project directory, I get:

Verifying dependencies for vim3@0.1.0
     Info:  Dependency on paranim@>= 0.10.0 already satisfied
  Verifying dependencies for paranim@0.12.0
     Info:  Dependency on nimgl@>= 1.1.9 already satisfied
  Verifying dependencies for nimgl@1.3.2
     Info:  Dependency on glm@>= 1.1.1 already satisfied
  Verifying dependencies for glm@1.1.1
     Info:  Dependency on paravim@>= 0.18.2 already satisfied
  Verifying dependencies for paravim@0.18.4
     Info:  Dependency on paranim@>= 0.12.0 already satisfied
  Verifying dependencies for paranim@0.12.0
     Info:  Dependency on nimgl@>= 1.1.9 already satisfied
  Verifying dependencies for nimgl@1.3.2
     Info:  Dependency on glm@>= 1.1.1 already satisfied
  Verifying dependencies for glm@1.1.1
     Info:  Dependency on pararules@>= 1.2.0 already satisfied
  Verifying dependencies for pararules@1.4.0
     Info:  Dependency on paratext@>= 0.13.0 already satisfied
  Verifying dependencies for paratext@0.13.0
     Info:  Dependency on illwill@>= 0.2.0 already satisfied
  Verifying dependencies for illwill@0.3.1
     Info:  Dependency on stb_image@>= 2.5 already satisfied
  Verifying dependencies for stb_image@2.5
   Building vim3/vim3.exe using c backend
C:\Users\<...>\vim_cubed\src\common.nim(1, 51) Warning: imported and not used: 'attributes' [UnusedImport]
C:\Users\<...>\vim_cubed\src\common.nim(4, 6) Warning: imported and not used: 'sequtils' [UnusedImport]
C:\Users\<...>\.nimble\pkgs2\paravim-0.18.4-687b3f5daa613addaf90dbfb6c5443d7cd390799\paravim.nim(135, 63) Error: cannot convert 257 to range 0..255(int)
       Tip: 24 messages have been suppressed, use --verbose to show them.
nimble.nim(229)          buildFromDir

    Error:  Build failed for the package: vim3

I don't see anything wrong with paravim.nim. Line 135 is the last line, which is where the build error is tripping.

Any advice is appreciated.

Ah, looks like a new error in nim 2.0. I fixed it, so do nimble install paravim to get the latest and then try building vim cubed again.

Thanks for the update & for coming back to the project so quickly. After a fresh nimble install paravim, I can build without any errors!

vim3 will display a file if provided as an argument, but if I attempt to move my cursor, or run a command, or make an edit, it immediately crashes.

Trace:

C:\Users\<...>\vim_cubed\src\vim3.nim(55) vim3
C:\Users\<...>\vim_cubed\src\vim3.nim(10) keyCallback
C:\Users\<...>\.nimble\pkgs2\paravim-0.18.5-d616da6f86da2ff0399d7e477eec2f703828be78\paravim.nim(59) keyCallback
C:\Users\<...>\.nimble\pkgs2\paravim-0.18.5-d616da6f86da2ff0399d7e477eec2f703828be78\paravim\vim.nim(124) onInput
C:\Users\<...>\.nimble\pkgs2\paravim-0.18.5-d616da6f86da2ff0399d7e477eec2f703828be78\paravim\vim.nim(103) updateAfterInput
C:\Users\<...>\.nimble\pkgs2\paravim-0.18.5-d616da6f86da2ff0399d7e477eec2f703828be78\paravim\vim.nim(85) updateSearchHighlights
C:\Users\<...>\nim-2.0.0\lib\system\fatal.nim(53) sysFatal
Error: unhandled exception: value out of range: 1 notin -2147483648 .. 2147483647 [RangeDefect]

1 notin -2147483648 .. 2147483647 is strange, that evaluates to true when tested in a codepen. Seems like a mismatch in datatypes. Did nim 2.0 add more type checking?

That is pretty weird...it doesn't happen to me but i don't have a windows machine to test with at the moment. If you have WSL installed it might be worth checking how it behaves from there.

I set up WSL, grabbed the xorg development packages, reinstalled Nim, pulled down this repo again, and was able to compile everything without errors. vim3 now functions as normal (if "normal" can even be used to describe it!). The X11 emulation is definitely slower than it was on Windows, but that's a small price to pay for editing a file in three dimensions.

Thanks again for coming back to this project and rolling out a patch so quickly. It's a very fun editor.