yglukhov / nimx

GUI library
MIT License
1.1k stars 75 forks source link

Uncommitted source file? #191

Closed c-blake closed 7 years ago

c-blake commented 7 years ago

nimx/private/font/stb_ttf_glyph_provider.nim has a lot of references to stbtt* which it neither imports nor defines and which naturally block successful compilation. Those symbols seem to come from some c2nim + much manual work on Sean Barrett's stb_truetype.h. [ I made a brief attempt post c2nim, but it seems like a lot of manual work. ]

yglukhov commented 7 years ago

This stuff comes with ttf which is among nimx dependencies. Have you installed nimx with nimble install?

c-blake commented 7 years ago

Ok...I was not using nimble and manually setting up the 17 dependencies..Aiee. [ I confused the ttf.nim in sdl2 with the one in the ttf package. ] So, using nimble the package and all its dependencies seem to build fine.

Is there some trick to building the nimx tests from sources besides "cd pkgs/nimx-0.1; nake tests"? Doing that I get

.nimble/pkgs/variant-0.2.0/variant.nim(76) getTypeId
.nimble/pkgs/variant-0.2.0/variant.nim(69) mangledName
.nimble/pkgs/variant-0.2.0/variant.nim(29) mangledName
.nimble/pkgs/nimx-0.1/nimx/image.nim(165, 32) template/generic instantiation from here
.nimble/pkgs/nimx-0.1/nimx/resource.nim(64, 35) template/generic instantiation from here
.nimble/pkgs/variant-0.2.0/variant.nim(140, 17) template/generic instantiation from here
.nimble/pkgs/variant-0.2.0/variant.nim(29, 46) Error: node has no type
yglukhov commented 7 years ago

Can you try reinstalling variant pls?

nimble install -y variant
yglukhov commented 7 years ago

Also please make sure you nim is fresh enough.

c-blake commented 7 years ago

I still get the exact same error (ending in "variant.nim(29, 46) Error: node has no type".

My Nim is (and was) at the tip of devel.

$ nim --version
Nim Compiler Version 0.15.3 (2016-12-16) [Linux: amd64]
Copyright (c) 2006-2016 by Andreas Rumpf

git hash: aedafb99787d3613c6776bea625d9a43b2b7a8ea
active boot switches: -d:release -d:useLinenoise -d:nativeStackTrace -d:noCaas

I could rebuild it with only -d:release boot switch (if you think that worthwhile to try).

yglukhov commented 7 years ago

Ah, ok thats interesting. Looks like a pretty recent Nim regression. Works for me with Nim 9099fdd8f02b83670ae0ca8a5e434499c56c9904 but fails with devel... I'll do some more experiments and report it to Nim tracker. Meanwhile you can use Nim which is not as fresh :no_mouth:

c-blake commented 7 years ago

Ok. Thanks.

dom96 commented 7 years ago

I was not using nimble and manually setting up the 17 dependencies..Aiee.

How come? :(

yglukhov commented 7 years ago

Filed the issue to Nim tracker: https://github.com/nim-lang/Nim/issues/5129

c-blake commented 7 years ago

@dom - I was anticipating perhaps making contributions or at least having .git/ directories around so I could see diffs of edits I may have made. So, I began setting up a tree of git clones of nimx and its dependencies. It didn't seem so crazy at the time, but nimx turned out to have a larger transitive closure of deps than I expected with a module name collision that caught me off guard. ;-) Then I "issued" before thinking much.

I can't be the only one thinking along these lines, though. Maybe nimble can/should/already has a mode to not only install the head/tip of version control but also keep version control meta files/.git/.hg directories around? Just hg/git status/diff add some value. I guess in an ideal world, then a user could fork some package on github, swap out the pkgs/ subdirectory with a clone of the fork for whichever package they might want to push back to github for a PR.

yglukhov commented 7 years ago

Relevant discussion here: https://github.com/nim-lang/nimble/issues/240

yglukhov commented 7 years ago

Still blocked by https://github.com/nim-lang/Nim/issues/5131

yglukhov commented 7 years ago

Fixed as of https://github.com/nim-lang/Nim/commit/2bb49136de3e3d798c4bf37d23f34ee868e7ebf7