genotrance / nimgraphql

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

Ast issue running test/tnimgraphql.nim #3

Closed lantos1618 closed 4 years ago

lantos1618 commented 5 years ago

Is this package still being maintained? Getting the following trying to run the test


/home/***/.cache/nim/graphql_d/graphql.nim.c:271:65: error: unknown type name ‘GraphQLAstNode’
 N_LIB_PRIVATE N_NIMCALL(void, checkAST__4R2CUukFXXVA7xdqgdFNCA)(GraphQLAstNode* astNode, NCSTRING* error);
                                                                 ^~~~~~~~~~~~~~
/home/***/.cache/nim/graphql_d/graphql.nim.c:372:1: error: unknown type name ‘GraphQLAstNode’; use ‘struct’ keyword to refer to the type
 GraphQLAstNode* ast__t82G23f24OAfKf9auCicqKg;
 ^~~~~~~~~~~~~~
 struct 
/home/***/.cache/nim/graphql_d/graphql.nim.c:425:1: error: unknown type name ‘GraphQLAstNode’; use ‘struct’ keyword to refer to the type
 GraphQLAstNode* ast__t82G23f24OAfKf9auCicqKg_2;
 ^~~~~~~~~~~~~~
 struct 
/home/***/.cache/nim/graphql_d/graphql.nim.c:645:65: error: unknown type name ‘GraphQLAstNode’
 N_LIB_PRIVATE N_NIMCALL(void, checkAST__4R2CUukFXXVA7xdqgdFNCA)(GraphQLAstNode* astNode, NCSTRING* error) {
                                                                 ^~~~~~~~~~~~~~

Have python2 c2nim nimgen.

genotrance commented 5 years ago

Can you please share all steps, Nim version and OS? I just tested on Win/Lin and it worked.

lantos1618 commented 5 years ago

just running exactly https://github.com/genotrance/nimgraphql/blob/master/tests/tnimgraphql.nim

~/Documents/nim/nimgraphql$ nimble install nimgraphql

~/Documents/nim/nim_orm_test$ nimble install https://github.com/genotrance/nimgraphql
Downloading https://github.com/genotrance/nimgraphql using git
Setting up Git repo: https://github.com/graphql/libgraphqlparser
Pulling repository
Running 'bash -c 'cd nimgraphql/ast && python2 ast.py cxx ast.ast > ../Ast'
Running 'bash -c 'cd nimgraphql/ast && python2 ast.py cxx_impl ast.ast > .'
Running 'bash -c 'cd nimgraphql/ast && python2 ast.py cxx_visitor ast.ast '
Running 'bash -c 'cd nimgraphql/ast && python2 ast.py c ast.ast > ../c/Gra'
Running 'bash -c 'cd nimgraphql/ast && python2 ast.py c_impl ast.ast > ../'
Running 'bash -c 'cd nimgraphql/ast && python2 ast.py c_visitor_impl ast.a'
Running 'bash -c 'cd nimgraphql/ast && python2 ast.py cxx_json_visitor_hea'
Running 'bash -c 'cd nimgraphql/ast && python2 ast.py cxx_json_visitor_imp'
Processing nimgraphql/c/GraphQLAst.h
  Appending keys for wildcard *.h
Generating nimgraphql/GraphQLAst.nim
Processing nimgraphql/c/GraphQLAstNode.h
  Appending keys for wildcard *.h
Generating nimgraphql/GraphQLAstNode.nim
Processing nimgraphql/c/GraphQLAstVisitor.h
  Appending keys for wildcard *.h
Generating nimgraphql/GraphQLAstVisitor.nim
Processing nimgraphql/c/GraphQLAstToJSON.h
  Appending keys for wildcard *.h
Generating nimgraphql/GraphQLAstToJSON.nim
Processing nimgraphql/c/GraphQLParser.h
  Appending keys for wildcard *.h
Generating nimgraphql/GraphQLParser.nim
Processing nimgraphql/GraphQLAst.nim
  Appending keys for wildcard *.nim
Processing nimgraphql/GraphQLAstToJSON.nim
  Appending keys for wildcard *.nim
Processing nimgraphql/GraphQLParser.nim
  Appending keys for wildcard *.nim
Processing nimgraphql/GraphQLAstVisitor.nim
  Appending keys for wildcard *.nim
Processing nimgraphql/GraphQLAstNode.nim
  Appending keys for wildcard *.nim
Resetting nimgraphql
Running 'bash -c 'cd nimgraphql/ast && python2 ast.py c ast.ast > ../c/Gra'
  Verifying dependencies for nimgraphql@0.1.0
      Info: Dependency on nimgen@>= 0.5.0 already satisfied
  Verifying dependencies for nimgen@0.5.1
      Info: Dependency on c2nim@>= 0.9.14 already satisfied
  Verifying dependencies for c2nim@0.9.14
      Info: Dependency on regex@>= 0.10.0 already satisfied
  Verifying dependencies for regex@0.12.0
      Info: Dependency on unicodedb@>= 0.7.2 already satisfied
  Verifying dependencies for unicodedb@0.7.2
      Info: Dependency on unicodeplus@>= 0.5.0 already satisfied
  Verifying dependencies for unicodeplus@0.5.1
      Info: Dependency on unicodedb@>= 0.7 already satisfied
  Verifying dependencies for unicodedb@0.7.2
 Installing nimgraphql@0.1.0
    Prompt: nimgraphql@0.1.0 already exists. Overwrite? [y/N]
    Answer: y
   Success: nimgraphql installed successfully.

~/Documents/nim/nimgraphql$ nim c -r /tests/tnimgraphql.nim

~/Documents/nim/nim_orm_test$ nim -v

Nim Compiler Version 1.0.0 [Linux: amd64]
Compiled at 2019-09-23
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: f7a8fc46c0012033917582eb740dc0343c093e35
active boot switches: -d:release

~/Documents/nim/nim_orm_test$ uname -a

Linux abc-7348 5.0.0-32-generic #34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
lantos1618 commented 4 years ago

were you able to re-create the error?

lantos1618 commented 4 years ago
~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) 
lantos1618 commented 4 years ago

worked

$ git clone https://github.com/genotrance/nimgraphql
$ cd nimgraphql
$ nimble install
$ nimble test

[Suite] GraphQL Parsing Tests
  [OK] parsing without schema support
  [OK] parsing with schema support