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

[Question] Install latest working version #43

Closed
abraaofilho10 opened this issue Jan 7, 2019 · 7 comments
Closed

[Question] Install latest working version #43

abraaofilho10 opened this issue Jan 7, 2019 · 7 comments

Comments

@abraaofilho10
Copy link

Hello! I'm trying to use Godot with Nim but the latest version is not working. I tried to use an older version (0.7.8) but I don't know how to install it correctly. I downloaded the zip file and extracted it to /home/user/.nimble/pkgs because I don't know how to install it using nimble directly. When I tried to compile the "godot-nim-stub" I got an error saying "nakefile.nim(5, 8) Error: cannot open 'godotapigen'". How do I install the latest working version?

Thanks in advance! =)

@zetashift
Copy link
Contributor

zetashift commented Jan 7, 2019

What Nim version are you using? You should use 0.18.0 and you can install using nimble using the command nimble install godot

Edit: also make sure you have a environment variable named GODOT_BIN pointing to your godot executable location.

@abraaofilho10
Copy link
Author

I'm using choosenim with version 0.18.0. I tried to install with "nimble install godot" but when I compile the stub project with "nake build" I got the following error:

/home/user/.nimble/pkgs/godot-0.7.17/godotapigen.nim(9,` 26) Error: type mismatch: got <string>
but expected one of: 
proc getIdent(ic: IdentCache; identifier: string): PIdent
proc getIdent(ic: IdentCache; identifier: string; h: Hash): PIdent
proc getIdent(ic: IdentCache; identifier: cstring; length: int; h: Hash): PIdent

expression: getIdent(ident)

I saw it is the same error as #41 but I couldn't find a solution, then I tried to use godot-nim 0.7.8 that gives me this other error:

nakefile.nim(5, 8) Error: cannot open 'godotapigen'

My .bash_profile has this as GODOT_BIN:

export GODOT_BIN=$HOME/Godot3/Godot_v3.0.6-stable_x11.64

@zetashift
Copy link
Contributor

zetashift commented Jan 7, 2019

Yeah, use nimble and you can solve that getIdent error with doing some trickey explained here: #32 (comment)

after that nake clean and nake build in the godot-nim-stub
I had the same getIdent error and I solved it by following that thread, clean install of 0.18.0, nimble install in the toolchain folder and nake clean. If you still have trouble, I'll try to replicate it and solve it again and write down the steps, as I don't remember correctly what I did exactly.

@abraaofilho10
Copy link
Author

I didn't know that I needed to do "nimble install" after installing a nim version. Is this in the documentation?

I did the following but I couldn't get it to work.
I deleted .choosenim/toolchains/nim-0.18.0 and .nimble/pkgs/compiler-0.18.0 and ./nimble/pkgs/godot-0.7.17

$ choosenim 0.18
(...)
Extracting nim-0.18.0.tar.xz
Building Nim 0.18.0
Building tools (nimble, nimgrep, nimsuggest)
Info: Version 0.18.0 already selected
[user@localhost nim-0.18.0]$ nimble install
Verifying dependencies for compiler@0.18.0
Installing compiler@0.18.0
Success: compiler installed successfully.
[user@localhost nim-0.18.0]$ nimble install godot
Downloading https://github.com/pragmagic/godot-nim using git

Warning: Package 'godot' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'godot', but file 'godotnim.nim' is in a directory named 'nim' instead. This will be an error in the future.

Hint: If 'nim' contains source files for building 'godot', rename it to 'godot'. Otherwise, prevent its installation by adding `skipDirs = @["nim"]` to the .nimble file.
  Verifying dependencies for godot@0.7.17
      Info: Dependency on compiler@>= 0.17.3 already satisfied
  Verifying dependencies for compiler@0.18.0
 Installing godot@0.7.17
   Success: godot installed successfully.
[user@localhost nim-0.18.0]$ cd /home/user/Downloads/godot-nim-stub-master
[user@localhost godot-nim-stub-master]$ nake clean
Compiling nakefile...
Hint: used config file '/home/user/.choosenim/toolchains/nim-0.18.0/config/nim.cfg' [Conf]
Hint: used config file '/home/user/Downloads/godot-nim-stub-master/nakefile.nim.cfg' [Conf]
(...)
Hint: rodutils [Processing]
/home/user/.nimble/pkgs/godot-0.7.17/godotapigen.nim(9, 26) Error: type mismatch: got <string>
but expected one of: 
proc getIdent(ic: IdentCache; identifier: string): PIdent
proc getIdent(ic: IdentCache; identifier: string; h: Hash): PIdent
proc getIdent(ic: IdentCache; identifier: cstring; length: int; h: Hash): PIdent

expression: getIdent(ident)

@zetashift
Copy link
Contributor

zetashift commented Jan 7, 2019

The nimble install thing is a weird thing that just seemed to work

Alright let's see if I can reproduce my solution
-> Clean install with choosenim
-> nimble install godot
-> nimble install nake

Now if I run nake clean I actually get the Pident error. I went to .choosenim\toolchains\nim-0.18.0 and did nimble install then went to the godot-nim-stub and ran nake clean and nake build succesfully.
You did the same thing but installed godot-nim after the nimble install, maybe try to install it before hand? (Also make sure when you do the clean install that /user/.choosenim and user/.nimble aren't present beforehand)

@abraaofilho10
Copy link
Author

abraaofilho10 commented Jan 8, 2019

It worked nicely. Thank you very much! =)

Steps:
deleted .nimble folder and .choosenim folder

curl https://nim-lang.org/choosenim/init.sh -sSf | sh

choosenim 0.18.0

nimble install

nimble install godot

nimble install nake

nake clean

nake build

@zetashift
Copy link
Contributor

@chalcosoma I think you can close this sicne this issue will mostly likely be solved by 0.19+ compatibility.

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

2 participants