Shopify / mruby-engine

MRuby engine is a sandboxed scripting engine.
MIT License
78 stars 23 forks source link

Build error at value_guest.c:73 #32

Open zeroinside opened 7 years ago

zeroinside commented 7 years ago

Hello. I'm trying to build engine as its described in Readme.md, but I've encountered an error: $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc-multilib/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release Thread model: posix gcc version 6.3.1 20170109 (GCC)

./bin/rake spec --trace Invoke spec (first_time) Invoke compile (first_time) Invoke compile:x86_64-linux (first_time) Invoke compile:mruby_engine:x86_64-linux (first_time) Invoke copy:mruby_engine:x86_64-linux:2.4.0 (first_time) Invoke lib/mruby_engine (first_time, not_needed) Invoke tmp/x86_64-linux/mruby_engine/2.4.0/mruby_engine.so (first_time) Invoke tmp/x86_64-linux/mruby_engine/2.4.0/Makefile (first_time, not_needed) Invoke tmp/x86_64-linux/mruby_engine/2.4.0 (first_time, not_needed) Invoke ext/mruby_engine/extconf.rb (first_time, not_needed) Invoke ext/mruby_engine/dlmalloc.c (first_time, not_needed) Invoke ext/mruby_engine/eval_monitored.c (first_time, not_needed) Invoke ext/mruby_engine/eval_unmonitored.c (first_time, not_needed) Invoke ext/mruby_engine/ext.c (first_time, not_needed) Invoke ext/mruby_engine/host.c (first_time, not_needed) Invoke ext/mruby_engine/libunwind_test.c (first_time, not_needed) Invoke ext/mruby_engine/memory_pool.c (first_time, not_needed) Invoke ext/mruby_engine/memory_pool_test.c (first_time, not_needed) Invoke ext/mruby_engine/mruby_engine.c (first_time, not_needed) Invoke ext/mruby_engine/platform_darwin.c (first_time, not_needed) Invoke ext/mruby_engine/platform_linux.c (first_time, not_needed) Invoke ext/mruby_engine/value_guest.c (first_time, not_needed) Invoke ext/mruby_engine/value_host.c (first_time, not_needed) Execute tmp/x86_64-linux/mruby_engine/2.4.0/mruby_engine.so cd tmp/x86_64-linux/mruby_engine/2.4.0 /bin/make compiling ../../../../ext/mruby_engine/value_guest.c In file included from /usr/include/mruby/proc.h:71:0, from ../../../../ext/mruby_engine/mruby_engine_private.h:7, from ../../../../ext/mruby_engine/value_guest.c:1: ../../../../ext/mruby_engine/value_guest.c: In function ‘me_value_to_host_r’: ../../../../ext/mruby_engine/value_guest.c:73:38: error: dereferencing pointer to incomplete type ‘struct kh_ht’ for (int i = kh_begin(kh), f = kh_end(kh); i < f; ++i) { ^ make: *** [Makefile:242: value_guest.o] Error 1 rake aborted! Command failed with status (2): [/bin/make...]

travishaynes commented 7 years ago

I ran into this same issue. The problem was because I had a local copy of mruby installed, which conflicted with the mruby submodule included in the repository. The solution was to uninstall the local version.

It looks to me like @zeroinside was having the same problem, which you can see in this line from the compiler's output:

In file included from /usr/include/mruby/proc.h:71:0,

It's compiling against a locally installed version of mruby instead of using the submodule.