genotrance / nimgraphql

Nimgraphql is a Nim wrapper for the libgraphqlparser library
MIT License
25 stars 3 forks source link

Error: cannot open file: nimgraphql/GraphQLAstNode #2

Closed timotheecour closed 5 years ago

timotheecour commented 6 years ago
nimble test
  Executing task test in /Users/timothee/git_clone/nim/nimgraphql/nimgraphql.nimble
Hint: used config file '/Users/timothee/git_clone/nim/Nim/config/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/.config/nim/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/git_clone/nim/Nim/config/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/.config/nim/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/.config/nim/config.nims' [Conf]
/Users/timothee/.config/nim/config.nims [config.nims used]
/Users/timothee/git_clone/nim/nimgraphql/tests/testgql.nim(1, 28) Error: cannot open file: nimgraphql/GraphQLAstNode
  import unittest, nimgraphql/[GraphQLAstNode, GraphQLParser, GraphQLAstToJSON, GraphQLAstVisitor]
                             ^
stack trace: (most recent call last)
/Users/timothee/git_clone/nim/nimgraphql/nimgraphql.nimble(27) testTask
/Users/timothee/git_clone/nim/Nim/lib/system/nimscript.nim(237) exec
/Users/timothee/git_clone/nim/Nim/lib/system/nimscript.nim(237, 7) Error: unhandled exception: FAILED: nim cpp -r tests/testgql
genotrance commented 6 years ago

Did you install the package? Or clone and nimble develop then nimble setup?

Looks like nimgen hasn't been run yet.

timotheecour commented 6 years ago

oops, I hadn't; however:

nimble setup
  Executing task setup in /Users/timothee/git_clone/nim/nimgraphql/nimgraphql.nimble
Hint: used config file '/Users/timothee/git_clone/nim/Nim/config/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/.config/nim/nim.cfg' [Conf]
Resetting Git repo
File doesn't exist: GraphQLAst.h
stack trace: (most recent call last)
/Users/timothee/git_clone/nim/nimgraphql/nimgraphql.nimble(21) setupTask
/Users/timothee/git_clone/nim/Nim/lib/system/nimscript.nim(237) exec
/Users/timothee/git_clone/nim/Nim/lib/system/nimscript.nim(237, 7) Error: unhandled exception: FAILED: nimgen nimgraphql.cfg
genotrance commented 6 years ago

Do you have python2 in the path? It needs to generate the header files. That's done by libgraphqlparser.

timotheecour commented 6 years ago

I do

timotheecour commented 6 years ago

btw: not yet familiar with nimgen but I feel like nimgraphql.cfg would be much better off as a pure nim file cfg should IMO only be used for the simplest things; nimgraphql.cfg is already way past that complexity threshold; it'd be more DRY, more reusable, modular, debuggable, modifyable etc (lots of duplication inside that file)

genotrance commented 5 years ago

The duplication was just a first effort to get this working. The cfg is simpler now. Are you on OSX by any chance?

As for complexity, it started as a simple way to drive nimgen to do things. I added a CLI method recently for an even simpler way. It could have been a library but that's perhaps a higher bar to wrap anything.

Most wrappers are simple, these C++ ones are like this because of all the limitations being discussed in the other thread. It is interesting nonetheless and probably worth considering. However, how you would get a nimble install X to build and run this EXE is something I'm wondering about.

timotheecour commented 5 years ago

Are you on OSX by any chance?

yes

However, how you would get a nimble install X to build and run this EXE is something I'm wondering about

not sure I understand; nimble install X can run arbitrary code including executing a shell command

I added a CLI method recently for an even simpler way

cool, will check it again

timotheecour commented 5 years ago

side note: btw what do you think of something like https://github.com/AutoFFI/AutoFFI/blob/master/src/clang.cpp ?