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

build error when a.proto import b.proto, and the protos under same dir #198

Open
sky92zwq opened this issue Jan 8, 2024 · 2 comments
Open
Labels
documentation Improvements or additions to documentation P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee)

Comments

@sky92zwq
Copy link

sky92zwq commented Jan 8, 2024

here is my dir layout:
a.proto depends on b.proto, so import b.proto in a.proto.

├── proto
│   ├── BUILD
│   ├── CMakeLists.txt
│   ├── a.proto
│   └── b.proto
├── src
│   ├── BUILD
│   └── main.cc
├── test
│   ├── BUILD
│   ├── main.cc
├── BUILD
├── CMakeLists.txt
├── README.md
└──WORKSPACE

bazel build got error:

proto/a.proto:5:1: Import "b.proto" was not found or had errors.

but cmake works fine.
why should I add import proto/b.proto in a.proto, but just import b.proto?

@comius
Copy link
Collaborator

comius commented Feb 5, 2024

@alexeagle, @thesayyn can you triage?

@thesayyn
Copy link
Collaborator

thesayyn commented Feb 5, 2024

why should I add import proto/b.proto in a.proto, but just import b.proto

afaik every import statement has to be relative to the workspace root if you are not using strip_import_prefix so this works as intended.

@thesayyn thesayyn added documentation Improvements or additions to documentation P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) labels Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee)
Projects
None yet
Development

No branches or pull requests

3 participants