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

document --imports examples and constraints #164

Open
kanaksinghal opened this issue Apr 12, 2024 · 1 comment
Open

document --imports examples and constraints #164

kanaksinghal opened this issue Apr 12, 2024 · 1 comment

Comments

@kanaksinghal
Copy link

kanaksinghal commented Apr 12, 2024

great tool, but I was stuck on proto imports

issues:

  1. setting grand parent dir of my main proto file in imports option doesn't work and I figured why after debugging the code
  2. /protobuf/google is not up to date. missing google/api/annotations.proto

I have my file structure like this:

- go.mod
- go.sum
- vendor
    - github.com
        - repo1
            - .../x.proto
        - repo2
            - .../y.proto
        - repo3
            - .../main.proto

I did this:

docker run --rm -p 4770:4770 -p 4771:4771 -v ./vendor:/vendor --imports="/vendor,/protobuf" /vendor/github.com/repo3/.../main.proto

it returns

github.com/repo1/.../x.proto File not found
github.com/repo2/.../y.proto File not found

after debugging the code I realised, that the /vendor is never passed to -I in protoc since it was part of the main.proto file path and this behaviour was not documented at all... 🤷‍♂️ so mounting another dir for imports worked like this:

docker run --rm -p 4770:4770 -p 4771:4771 -v ./vendor:/vendor -v ./vendor/github.com/repo3:/repo3 --imports="/vendor,/protobuf" /repo3/.../main.proto
@0bon
Copy link

0bon commented Jul 5, 2024

Any progress with this ? I am stuck on the same error. proto file Imports are not found during the run

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