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

Clarification of correct use of transitive dependencies and well-known google dependencies #100

Open
gshuflin opened this issue Sep 11, 2023 · 1 comment

Comments

@gshuflin
Copy link
Contributor

My organization has a number of protobuf files in repo G of the form:

syntax = "proto3";

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "common/v1/common.proto";

<further content>

Here, common refers to another repo in our organization containing a set of common protobuf files, and google is well-known Google protobufs that we don't have locally at all.

The protofetch.toml file for my project looks like:

name = "my-project"
description = "my-description"
proto_out_dir = "protos"

[G]
protocol = "https"
url = "github.com/my-org/G-repo"
branch = "main"
prune = true

[common]
protocol = "https"
url = "github.com/my-org/common-repo"
branch = "main"
transitive = true

When I run protobuf fetch, protofetch is able to successfully pull protofetch files from the G repo; but it is not able to discover that the import "common/v1/common.proto" lines in those files correspond to protobuf files contained in the common repo, despite the transitive = true flag. Instead, protofetch looks for those common protobuf within the G repo and exits with an error when it can't find them. I'm also having trouble understanding how the prune and transitive options are intended to be used from the README documentation.

Additionally, I also can't see any way to tell protofetch to avoid trying to find the google protobufs itself at all. Our protobuf-building code is capable of fetching those from Google itself, so it would be fine if protofetch could completely ignore them, rather than trying and failing to find them and then exiting with an error.

@rtimush rtimush assigned rtimush and unassigned rtimush Sep 14, 2023
@saraiva132
Copy link
Collaborator

Transitive and prune are poorly designed and confusing. They need to be re-implemented. For the case you are mentioning I don't think you need to use either

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

3 participants