--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
Visit this group at http://groups.google.com/group/capnproto.
Cool!You say there's no C++ plugin yet, but is the code that's calling the plugin in place? (in other words, is it possible to start play with for building plugins for other languages?)
On Sat, Aug 3, 2013 at 5:38 AM, Andreas Stenius <g...@astekk.se> wrote:Cool!You say there's no C++ plugin yet, but is the code that's calling the plugin in place? (in other words, is it possible to start play with for building plugins for other languages?)Correct. "capnpc compile" invokes plugins in exactly the same way that the Haskell capnpc does. In fact, if you rename/symlink capnp as capnpc, it will behave exactly like the Haskell capnpc, and should function as a drop-in replacement except for the lack of a built-in C++ code generator.
There is a bug still in that it won't always provide all the schema nodes for imported files that weren't explicitly listed on the command line. You can work around that for the moment by explicitly listing all dependencies, or just testing against files that don't import anything. I'll probably fix this Monday.
Ok, thanks (after sending that I realized it wouldn't be so hard to produce the needed files myself on a linux box.. any how)..Got a few weird errors:src/capnp/compiler/capnp.c++: In member function ‘kj::MainBuilder::Validity capnp::compiler::CompilerMain::generateOutput()’:src/capnp/compiler/capnp.c++:311:87: error: ‘strsignal’ was not declared in this scopeMakefile:1027: recipe for target `src/capnp/compiler/capnp.o' failedmake: *** [src/capnp/compiler/capnp.o] Error 1
and:src/kj/string.c++: In function 'char* kj::_::{anonymous}::DoubleToBuffer(double, char*)':src/kj/string.c++:232:65: error: 'snprintf' was not declared in this scopesrc/kj/string.c++: In function 'char* kj::_::{anonymous}::FloatToBuffer(float, char*)':src/kj/string.c++:288:64: error: 'snprintf' was not declared in this scopeMakefile:1043: recipe for target `src/kj/string.lo' failedmake: *** [src/kj/string.lo] Error 1
Now I'm at:libtool: compile: g++ -std=c++11 -DHAVE_CONFIG_H -I. -I./src -I./src -O2 -DNDEBUG -MT src/kj/exception.lo -MD -MP -MF src/kj/.deps/exception.Tpo -c src/kj/exception.c++ -DDLL_EXPORT -DPIC -o src/kj/.libs/exception.osrc/kj/exception.c++:28:22: fatal error: execinfo.h: No such file or directorycompilation terminated.Makefile:1043: recipe for target `src/kj/exception.lo' failedmake: *** [src/kj/exception.lo] Error 1
Until next update/question..
OK, finally :)I got fed up with cygwin and it's weirdness.. so I took a back to basics debugging technique by tossing in a --save-temps to the compile flags and inspected the pre-compiled version of the file and figured out that __STRICT_ANSI__ was defined.. looked at the compile flags again and noticed the --std=c++11, tried with --std=gnu++11 instead and voilá, presto, profit, etc.. :) (I changed the macro arg to the AX_CXX_.. check in configure.ac from [noext] to [ext])
2013/8/8 Andreas Stenius <g...@astekk.se>
Just a quick feedback.. would be nice to know what it tried to run here:$ make*** Uncaught exception ***src/capnp/compiler/capnp.c++:297: error from OS: execlp(exeName.cStr(), exeName.cStr(), nullptr): No such file or directorystack:capnpc-c++: plugin failed: exit code 1Makefile:2237: recipe for target `src/capnp/test.capnp.h' failedmake: *** [src/capnp/test.capnp.h] Error 1Guess that shows when you indeed have a stack trace.. :p
Doh.. sorry. My bad, for not reading the source to figure out all parts of the error messages.I missed that the plugin name was on the line with the exit code.
OK, so the capnpc-capnp plugin works like a charm :)But when I try to compile the schema.capnp file, it complains:$ capnpc -ocapnp src/capnp/schema.capnpterminate called after throwing an instance of 'kj::ExceptionImpl'what(): src/capnp/schema-loader.c++:1193: requirement not met: no schema node loaded for id; id = 13386661402618388268stack:capnpc-capnp: plugin failed: Aborted
On Wed, Aug 7, 2013 at 10:48 PM, Andreas Stenius <g...@astekk.se> wrote:OK, finally :)I got fed up with cygwin and it's weirdness.. so I took a back to basics debugging technique by tossing in a --save-temps to the compile flags and inspected the pre-compiled version of the file and figured out that __STRICT_ANSI__ was defined.. looked at the compile flags again and noticed the --std=c++11, tried with --std=gnu++11 instead and voilá, presto, profit, etc.. :) (I changed the macro arg to the AX_CXX_.. check in configure.ac from [noext] to [ext])Arg. This is frustrating because -std=gnu++11 breaks the Clang-Linux build because it enables GCC-specific extensions in the stdc++ headers which Clang doesn't yet support. But I suppose -std=gnu++11 is more correct so I guess I'll look for a different work-around.
On Thu, Aug 8, 2013 at 12:46 AM, Andreas Stenius <g...@astekk.se> wrote:2013/8/8 Andreas Stenius <g...@astekk.se>Just a quick feedback.. would be nice to know what it tried to run here:$ make*** Uncaught exception ***src/capnp/compiler/capnp.c++:297: error from OS: execlp(exeName.cStr(), exeName.cStr(), nullptr): No such file or directorystack:capnpc-c++: plugin failed: exit code 1Makefile:2237: recipe for target `src/capnp/test.capnp.h' failedmake: *** [src/capnp/test.capnp.h] Error 1Guess that shows when you indeed have a stack trace.. :pDoh.. sorry. My bad, for not reading the source to figure out all parts of the error messages.I missed that the plugin name was on the line with the exit code.It's definitely a crappy error message. The problem is that the "Uncaught exception" message is being printed in the subprocess, due to exec() failing. I guess I should improve that.
On Thu, Aug 8, 2013 at 1:37 AM, Andreas Stenius <g...@astekk.se> wrote:OK, so the capnpc-capnp plugin works like a charm :)But when I try to compile the schema.capnp file, it complains:$ capnpc -ocapnp src/capnp/schema.capnpterminate called after throwing an instance of 'kj::ExceptionImpl'what(): src/capnp/schema-loader.c++:1193: requirement not met: no schema node loaded for id; id = 13386661402618388268stack:capnpc-capnp: plugin failed: AbortedThis is probably the bug I mentioned earlier where you need to list all imported files explicitly. schema.capnp imports c++.capnp. This should be fixed head, though -- do a git pull.
Glad to hear this is all it takes to get things working on Cygwin! I'll definitely make this an officially-supported platform for the next release.
[...]
But when I try to compile the schema.capnp file, it complains:$ capnpc -ocapnp src/capnp/schema.capnpterminate called after throwing an instance of 'kj::ExceptionImpl'what(): src/capnp/schema-loader.c++:1193: requirement not met: no schema node loaded for id; id = 13386661402618388268stack:capnpc-capnp: plugin failed: Aborted
This is probably the bug I mentioned earlier where you need to list all imported files explicitly. schema.capnp imports c++.capnp. This should be fixed head, though -- do a git pull.
Yeah, I realized you'd mentioned there was an issue regarding file inclusion once I got into bed.. :p