-
Notifications
You must be signed in to change notification settings - Fork 285
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
v1 and v2 are incompatible when loading local libraries. #3546
Comments
Hi @lian-yue , this looks like a configuration issue when migrating multiple modules to v2. I'll propose a solution that moves all the The top version: v2
modules:
- path: mod/post/proto # Directory path is changed to the `proto` directory.
name: buf.build/bufver/post
- path: pkg/error/proto
name: buf.build/bufver/error
- path: pkg/type/proto
name: buf.build/bufver/type
deps:
- buf.build/bufbuild/protovalidate. # Only external non-local deps need to be specified
lint:
use:
- STANDARD
except:
- FIELD_NOT_REQUIRED
- PACKAGE_NO_IMPORT_CYCLE
disallow_comment_ignores: true
breaking:
use:
- FILE
except:
- EXTENSION_NO_DELETE
- FIELD_SAME_DEFAULT Now to output generated code in each modules directory you can use multiple version: v2
managed:
enabled: true
disable:
- file_option: go_package
module: buf.build/bufver/type
override:
- file_option: go_package_prefix
value: github.com/lian-yue/bufver/pkg/error/genpb/go
plugins:
- local: protoc-gen-go
opt: paths=source_relative
out: ./pkg/error/genpb/go # Directory to output
inputs:
- directory: ./pkg/error/proto # Input is specified so only this module is generated. To now generate this module for the output in
This can be done for each module, invoking |
Currently, I can avoid migrating the submodule's What I hope to achieve is that each repository is independent, with the root directory only configuring each repository's If everything is configured in the root directory, then it essentially becomes a single repository. |
The error: |
Closing as I think this issue is resolved. Please re-open if there is an issue or reach out on our public slack to get any help. |
GitHub repository with your minimal reproducible example (do not leave this field blank or fill out this field with "github.com/bufbuild/buf" or we will automatically close your issue, see the instructions above!)
https://github.com/lian-yue/bufver
Commands
Output
Expected Output
Anything else?
When the parent directory has a
buf.yaml
file configured with themodules
field, for example:/buf.yaml
In version
v1
, local files can be loaded without errors.In version
v2
, errors occur indicating that the file cannot be found.Configuration that does not cause errors in version v1:
/mod/post/buf.yaml
Configuration in version v2:
/mod/post/buf.yaml
This configuration causes errors.
I want the parent configuration with
path + name
fields to prioritize loading local files instead of directly loading remote file contents. This is because the local setup is intended to manage multiple pkg directories.The
/mod/post/buf.yaml
file'smodules.path
field cannot be configured as../../pkg/post
.Reproducing the Issue: Version 2 Cannot Execute Successfully
Version 1 Can Execute Successfully
The text was updated successfully, but these errors were encountered: