-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler error in generated WASM/Protobuf #138
Comments
The codegen for a protobuf return value should be like: return ::djinni::Protobuf<...>::fromCpp(r); Looking at the code I don't see how it could generate Could you provide a minimal case(just the .djinni file and the .yaml protobuf declaration file, djinni does not actually use the protogen during codegen) that reproduces this problem(Protobuf without template arguments) so that I could have a closer look and debug it if there is indeed a bug? |
Edit: I updated the errors and the repo to reflect some issues with bad imports in a prior version of the error repo. I uploaded a repo with a minimal repro: https://github.com/guthriec/djinni-error-repro I'm on an Apple Silicon MacBook, in case that's relevant. Codegen steps: Then from the
|
Thanks! I will take a look. |
So your problem is that you did not provide a We can probably make this a bit less confusing by providing better error message than generating incorrect code. |
Ah ok that seems plausible. I haven't had a chance to verify yet but thanks! |
I did get back to checking and got my setup working. A couple of more things that I think might be worth calling out in the documentation: (1) Djinni expects the protobuf JS to be generated by https://github.com/protobufjs/protobuf.js/ (there are some other projects out there, including an official Google project that's not well-maintained). I'll leave this open just in case you want to update the docs. |
Hi,
I have an interface that includes some protobuf types (e.g.
Generating for WASM works fine, using a command like:
However, the generated code runs into compilation errors when I try to compile using Emscripten:
emcc -o test.html wasm/my_service.cpp -I../../my_dependency
yielding an error:
I notice I did not set
--wasm-include-prefix
, nor do I really understand what it means -- am I missing something there? Or is this a bug?The text was updated successfully, but these errors were encountered: