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

Building fails on current devel #32

Closed
rama0x9 opened this issue Jun 23, 2018 · 13 comments
Closed

Building fails on current devel #32

rama0x9 opened this issue Jun 23, 2018 · 13 comments

Comments

@rama0x9
Copy link

rama0x9 commented Jun 23, 2018

untouched godot-nim-stub, running on arch linux

[rama@home myproject]$ nake build
Compiling nakefile...
OpenGL ES 3.0 Renderer: GeForce GTX 1070/PCIe/SSE2
Generating audio_stream_player_2d.nim...
Generating shape_2d.nim...
Generating dynamic_font_data.nim...
Generating light_2d.nim...
Generating primitive_mesh.nim...
Generating shader.nim...
Generating mobile_vr_interface.nim...
Generating scene_tree_timer.nim...
Generating editor_file_dialog.nim...
Generating packed_scene.nim...
Generating visual_script_function.nim...
Generating animation.nim...
Generating visual_script_sub_call.nim...
Generating video_player.nim...
Generating http_client.nim...
Generating sky.nim...
Generating animation_player.nim...
Generating sprite_base_3d.nim...
Generating polygon_path_finder.nim...
Generating capsule_mesh.nim...
Generating visual_script_constructor.nim...
Generating kinematic_collision.nim...
Generating geometry_instance.nim...
Generating groove_joint_2d.nim...
Generating translation_server.nim...
nake.nim(93)             moduleHook
nakelib.nim(252)         runTask
nakefile.nim(29)         :anonymous
nakefile.nim(26)         genGodotApi
godotapigen.nim(1002)    genApi
renderer.nim(1442)       renderTree
renderer.nim(635)        gstmts
renderer.nim(546)        gsub
renderer.nim(1254)       gsub
renderer.nim(609)        gsection
renderer.nim(1160)       gsub
renderer.nim(546)        gsub
renderer.nim(1127)       gsub
renderer.nim(546)        gsub
renderer.nim(1167)       gsub
renderer.nim(546)        gsub
renderer.nim(1174)       gsub
renderer.nim(1341)       gsub
renderer.nim(321)        gcoms
renderer.nim(318)        gcom
renderer.nim(226)        putComment
system.nim(2857)         sysFatal
Error: unhandled exception: index out of bounds [IndexError]

and with an existing project:

stub/game/world/character/blocky/player.nim(5, 7) template/generic instantiation from here
/home/rama/.nimble/pkgs/godot-0.7.14/nim/godotmacros.nim(403, 35) Error: undeclared field: ''
@endragor
Copy link
Member

devel gets breaking changes all the time, I intend to apply fixes once the new version is released. Also, when using devel, remember to install latest Nim compiler to the nimble repo: do nimble install from Nim's folder. That should fix your first error.

@rama0x9
Copy link
Author

rama0x9 commented Jun 25, 2018

not working on first error, after doing nimble install in the devel folder ~.choosenim/toolchains/nim-#devel/ and then nake build i get

[...]
Hint: rodutils [Processing]
/home/rama/.nimble/pkgs/godot-0.7.14/godotapigen.nim(9, 26) Error: type mismatch: got <string>
but expected one of: 
proc getIdent(self: IdentCache; identifier: string): PIdent
proc getIdent(self: IdentCache; identifier: string; h: Hash): PIdent
proc getIdent(self: IdentCache; identifier: cstring; length: int; h: Hash): PIdent

expression: getIdent(ident)

I understand that it's tedious to keep up with the regular changes on devel, so don't worry, i don't need the latest. I only need a working devel build because there are some nim packages which require >0.18.1 and i want to use them.

@endragor
Copy link
Member

Did you also nake clean after installing the devel? nakefile needs to be recompiled since it depends on Nim compiler through godot API generator module.

@rama0x9
Copy link
Author

rama0x9 commented Jun 25, 2018

sure, it's the first thing i do if something not working.
But in this case with compiler 0.18.1, nake clean breaks everything because if i build with stable, switch to devel and build without clean, it compiles.
But If i clean with stable, switch to devel and then build, this error happens, now both nake build & nake clean are showing that error, even after i switch back to stable. To make it work again i need to remove compiler 0.18.1

@Zireael07
Copy link

I am having the same error:
/home/rama/.nimble/pkgs/godot-0.7.14/godotapigen.nim(9, 26) Error: type mismatch: got
but expected one of:
proc getIdent(self: IdentCache; identifier: string): PIdent
proc getIdent(self: IdentCache; identifier: string; h: Hash): PIdent
proc getIdent(self: IdentCache; identifier: cstring; length: int; h: Hash): PIdent

expression: getIdent(ident)

@zetashift
Copy link
Contributor

@Zireael07 are you using Nim v0.18 or 0.19?

@Zireael07
Copy link

Zireael07 commented Sep 28, 2018

0.18
(The docs page for the bindings says >= 0.18 is fine)

@zetashift
Copy link
Contributor

@Zireael07 I can't reproduce your error. I cloned the godot-nim-stub and ran nake build and it compiles fine. Using v0.18 and windows 10

@zetashift
Copy link
Contributor

..\..\..\.nimble\pkgs\godot-0.7.17\internal\godotstrings.nim(41, 8) Error: usage of 'isNil' is a user-defined error
       Tip: 11 messages have been suppressed, use --verbose to show them.

Yeah, hoping that fixing the 0.19 changes will be easy. Will the new version also work with 3.1?

@zetashift
Copy link
Contributor

Most of the fixing I could do was change the isNil's and equals to an empty seq and empty string.
Should I make a PR so far with my progress or do you already have a branch up endragor?

@dom96
Copy link

dom96 commented Nov 3, 2018

Pro Tip: The Nim compiler sources are a moving target, pin the compiler package version to something that works and you won't have issues like this again. (For example requires "compiler#mygithash")

@zacharycarter
Copy link

I think there are two separate issues being discussed now - one regarding choosenim and pinned compiler versions and another regarding API codgen errors.

The latter issue can be solved by changing any calls to getIdent in godotapigen.nim to include an indentCache.

I created one in this file - var gic* = newIdentCache() - and then used it as the first argument to all getIdent calls in that file. With 0.18.0, this code compiled fine.

I can issue a PR if desired

@rafallus rafallus mentioned this issue Dec 5, 2018
@jrenner
Copy link
Contributor

jrenner commented Dec 27, 2018

Hi, I'm running into the .nimble/pkgs/godot-0.7.17/godotapigen.nim(9, 26) Error: type mismatch: got <string> error. What's the best way to deal with this currently?

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

7 participants