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

WARN bufimagebuild File imports not found in your local dependencies #2767

Closed
alikleit opened this issue Feb 13, 2024 · 4 comments
Closed

WARN bufimagebuild File imports not found in your local dependencies #2767

alikleit opened this issue Feb 13, 2024 · 4 comments

Comments

@alikleit
Copy link

I'm working with Buf workspaces locally, with the following files:

common/company/common/v1/enums.proto

package company.common.v1;

enum MyEnum { 
   ....
}

user-apis/company/user/v1/user.proto

package company.user.v1;


message MyContract {
  string id = 1;
  company.common.v1.MyEnum my_enum= 2;
}

and above is defined in the buf.work.yaml as follows:

version: v1
directories:
  - common
  - user-apis

Whenever I build, I get the following warning:

WARN bufimagebuild File "company/user/v1/user.proto" imports "company/common/v1/enums.proto", which is not found in your local files or direct dependencies, but is found in local workspace module "buf.build/company/common". Declare dependency "buf.build/company/common" in the deps key in buf.yaml.

Declaring the dependency means that it should exist in BSR, additionally the docs mention the following:

You don't need to add modules to the deps field to use them locally within a workspace, but you will need to do so when you're ready to [push your modules](https://buf.build/docs/reference/workspaces#pushing-modules) to the BSR`

How to ignore this when working locally?

@bufdev
Copy link
Member

bufdev commented Feb 15, 2024

We'd need to see your buf.yaml files to comment fully, but this likely means that you have name: buf.build/company/common in common/buf.yaml. The warning is valid - if you have a named module, you should make sure it is declared as a dependency, even if buf.build/company/common is not in the BSR. Just add a dep for this in user-apis/buf.yaml.

@bufdev bufdev closed this as completed Feb 15, 2024
@alikleit
Copy link
Author

When we add this to deps, it complains that the name is not in the BSR @bufdev

@bufdev
Copy link
Member

bufdev commented Feb 16, 2024

If you can provide a specific, reproducible example, we can look into it - perhaps in a temporary GitHub repo.

@bufdev bufdev reopened this Feb 16, 2024
@bufdev
Copy link
Member

bufdev commented Feb 20, 2024

Closing as we don't have a reproducible example - if you add one, we'll reopen, thanks.

@bufdev bufdev closed this as completed Feb 20, 2024
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