question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

include multiple import path?

See original GitHub issue

the protoc compilation support --proto_path= to be specified multiple times, but this project seems not? because in a real large project, there are multiple proto definition files in a complex hierarchy …

$ protoc --help
Usage: protoc [OPTION] PROTO_FILES
Parse PROTO_FILES and generate output based on the options given:
  -IPATH, --proto_path=PATH   Specify the directory in which to search for
                              imports.  May be specified multiple times;
                              directories will be searched in order.  If not
                              given, the current working directory is used.

  -oFILE,                     Writes a FileDescriptorSet (a protocol buffer,
    --descriptor_set_out=FILE defined in descriptor.proto) containing all of
                              the input files to FILE.

I read the code seems requiring the include to be one string only? https://github.com/konsumer/grpc-dynamic-gateway/blob/master/index.js#L37

While, I’ve tried to touch the code a bit if I can make it working, but the grpc.load({ file: p, root: include }) call seems undocumented? the Documentation will definitely need to be improved, while, do you know if it support multiple include proto path? https://grpc.io/grpc/node/grpc.html#.load__anchor

Another possibility is I see protoc can compile the complex hierarchy *.proto into a single protoset binary file, and it’s well supported by tools like grpcurl Are you aware if nodejs-grpc has similar protoset-files support? And add into this tool if possible

https://github.com/fullstorydev/grpcurl#protoset-files

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
nicolasnoblecommented, Sep 27, 2018

Right, that’s why we have the new proto-loader API, that offers a bit more options when it comes to this problem.

1reaction
c0bcommented, Oct 1, 2018

I can possibly try to make a PR to use @grpc/proto-loader ; while I am waiting some response from dcodeIO/protobuf.js#1117 the protoset is a different approach to tackle multi *.proto files situation

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python File Importation into Multi-Level Directory Modules and ...
Let's use a Python project with a directory structure (as shown below) to demonstrate how easy it can be to import from a...
Read more >
5. The import system — Python 3.11.1 documentation
Python includes a number of default finders and importers. ... The meta path may be traversed multiple times for a single import request....
Read more >
Importing files from different folder - python - Stack Overflow
When importing a file, Python only searches the directory that the entry-point script is running from and sys.path which includes locations such as...
Read more >
How to import modules, packages, functions, etc. in Python
You can import multiple functions, variables, etc. from the same module at once by writing them separated by commas. from math import pi ......
Read more >
Python – Import module from different directory - GeeksforGeeks
We can use sys.path to add the path of the new different folder (the folder from where we want to import the modules)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found