Skip to content
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

Referencing a message from another proto file in an rpc causes missing imports in generated files #39

Open
ebuxk opened this issue Feb 26, 2024 · 1 comment

Comments

@ebuxk
Copy link

ebuxk commented Feb 26, 2024

When generating the below common.proto & game-broken.proto, Private/SGame/GameContext.cpp has compilation issues.

GameContext.cpp(19): Error C2665 : 'TURBOLINK_TO_GRPC': no overloaded function could convert all the argument types

I found 2 ways to work around this:

  1. Editing the generated files. Manually add the include for /SCommon/CommonMarshaling.h to /SGame/GameContext.cpp.
  2. Wrapping the Player message from common.proto with a message defined inside game.proto. See game-workaround.proto below.

common.proto

package common;
message Player {
  uint64 id = 1;
  string username = 2;
  string auth_key = 3;
}

game-broken.proto

package game;
import "common.proto";

service TestTurbo {
  rpc TestTurboFunc(common.Player) returns (common.Player);
}

game-workaround.proto

package game;
import "common.proto";
message TestTurboFuncMessage {
    common.Player player = 1;
}
service TestTurbo {
  rpc TestTurboFunc(TestTurboFuncMessage) returns (TestTurboFuncMessage);
}

Thank you for all your time and focus on turbolink. 👍

@WilSimpson
Copy link

This isn't an issue with this repo, it's an issue with the protogen. You can check out the PR #11 for this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants