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

Not able to interpret imports from proto #13

Closed
maddypj opened this issue Jan 8, 2020 · 3 comments
Closed

Not able to interpret imports from proto #13

maddypj opened this issue Jan 8, 2020 · 3 comments

Comments

@maddypj
Copy link

maddypj commented Jan 8, 2020

Hello,
I am trying to run redis with redis-protobuf ( compiled from source)
I am able to run the module fine if the proto files are in flat directory structure.

It doesn't work in the following case-
I am trying load protofiles from nested directory structure. The base path is given in --dir option when loading the redis module.

loadmodule <redis-protobuf so path> --dir /a/b/c/

All the protos are located under c

c/d1/p1.proto
c/d1/p2.proto
c/d2/p3.proto

p1.proto has an import

import "d2/p3.proto"

Any of the schemas defined in the given directory structure are not getting loaded.
Same is true with standard protos like "google/protobuf/wrappers.proto"
I am new to redis-protobuf, any help appreciated. Thanks in advance

Mj

@sewenew
Copy link
Owner

sewenew commented Jan 9, 2020

Hi @maddypj

I've added support for loading nested Protobuf file, and your problem should be solved. Please download the latest code, and have a try.

However, in order to load standard proto files, you need to copy these standard .proto files to /a/b/c/google/protobuf directory, so that redis-protobuf can find them. These standard Proto files should located at protobuf-3.8.0-map-reflection/src/google/protobuf/ directory:

mkdir -p /a/b/c/google/protobuf
cp /path/to/protobuf-3.8.0-map-reflection/src/google/protobuf/*.proto /a/b/c/google/protobuf

If you still have any problem with redis-protobuf, feel free to let me know :)

Regards

@sewenew
Copy link
Owner

sewenew commented Jan 10, 2020

Hi @maddypj

Does the latest code fixed your problem?

Also I've uploaded these standard proto files to GitHub, you can copy these to /a/b/c/google/protobuf directory. And it should work.

If you still have any problem, feel free to let me know :)

Regards

@maddypj
Copy link
Author

maddypj commented Jan 10, 2020

Hello Sewenew,

Yes it works!! Thank you for fixing it promptly!

Regards

@maddypj maddypj closed this as completed Jan 10, 2020
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