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

Make gogo.proto import vendoring agnostic #265

Merged

Conversation

krajorama
Copy link
Contributor

@krajorama krajorama commented Nov 25, 2022

prometheus/alertmanager imports gogo.proto as gogoproto/gogo.proto

This is because it does not use vendoring and needs to look up gogoproto in the module cache, which results in a path like
/home/user/go/pkg/mod/github.com/gogo/protobuf@v1.3.2.

To avoid having @v1.3.2 in the proto definition it then sets this as an include path and import only gogoproto/gogo.proto.

This is an issue because protoc is not smart enough to recognize that github.com/gogo/protobuf/gogoproto/gogo.proto and gogoproto/gogo.proto are the same.

Signed-off-by: György Krajcsovits gyorgy.krajcsovits@grafana.com

prometheus/alertmanager imports gogo.proto as gogoproto/gogo.proto
This is because it does not use vendoring and needs to look up gogoproto
in the module cache, which results in a path like
/home/user/go/pkg/mod/github.com/gogo/protobuf@v1.3.2
To avoid having @v1.3.2 in the proto definition it then sets this
as an include path and import only gogoproto/gogo.proto.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama marked this pull request as draft November 25, 2022 09:10
@krajorama
Copy link
Contributor Author

Testing mimir build in grafana/mimir#3524

@krajorama krajorama marked this pull request as ready for review November 25, 2022 09:34
Copy link
Collaborator

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We should be clear this is changing something that was only added to the code in #264.

@bboreham bboreham merged commit 88dcecd into weaveworks:master Nov 25, 2022
krajorama added a commit to grafana/mimir that referenced this pull request Nov 28, 2022
New weaveworks common explicitly includes gogo protobuf on a more
generic location.
See weaveworks/common#265

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
krajorama added a commit to grafana/mimir that referenced this pull request Nov 30, 2022
New weaveworks common explicitly includes gogo protobuf on a more
generic location.
See weaveworks/common#265

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
zenador pushed a commit to grafana/mimir that referenced this pull request Dec 1, 2022
New weaveworks common explicitly includes gogo protobuf on a more
generic location.
See weaveworks/common#265

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
bboreham pushed a commit to grafana/mimir that referenced this pull request Dec 8, 2022
New weaveworks common explicitly includes gogo protobuf on a more
generic location.
See weaveworks/common#265

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
bboreham pushed a commit to grafana/mimir that referenced this pull request Dec 9, 2022
New weaveworks common explicitly includes gogo protobuf on a more
generic location.
See weaveworks/common#265

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
bboreham pushed a commit to grafana/mimir that referenced this pull request Dec 9, 2022
New weaveworks common explicitly includes gogo protobuf on a more
generic location.
See weaveworks/common#265

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
bboreham pushed a commit to grafana/mimir that referenced this pull request Dec 12, 2022
New weaveworks common explicitly includes gogo protobuf on a more
generic location.
See weaveworks/common#265

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
bboreham added a commit to grafana/mimir that referenced this pull request Dec 12, 2022
More details at https://github.com/grafana/mimir/security/dependabot/12

Many other libraries have updates forced by this change:

	github.com/prometheus/alertmanager c60fafa6025c
	github.com/prometheus/client_golang v1.14.0
	github.com/spf13/afero v1.8.2
	github.com/weaveworks/common 7c2720a9024d
	golang.org/x/crypto v0.1.0
	golang.org/x/net v0.1.0
	golang.org/x/sync v0.1.0
	go.opentelemetry.io/otel v1.11.1
	go.opentelemetry.io/otel/trace v1.11.1
	golang.org/x/sys v0.1.0

(Indirect dependencies)
	github.com/coreos/go-systemd/v22 v22.4.0
	github.com/go-openapi/runtime v0.25.0
	github.com/gofrs/uuid v4.3.1
	github.com/hashicorp/go-hclog v1.2.0
	github.com/matttproud/golang_protobuf_extensions v1.0.4
	go.mongodb.org/mongo-driver v1.11.0
	golang.org/x/mod v0.6.0
	golang.org/x/text v0.4.0
	golang.org/x/tools v0.2.0
	gopkg.in/ini.v1 v1.67.0
	gopkg.in/telebot.v3 v3.1.2

* Follow up weaveworks/common update to fix protobuf definitions

New weaveworks common explicitly includes gogo protobuf on a more
generic location.
See weaveworks/common#265

Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
masonmei pushed a commit to udmire/mimir that referenced this pull request Dec 16, 2022
…ana#3675)

More details at https://github.com/grafana/mimir/security/dependabot/12

Many other libraries have updates forced by this change:

	github.com/prometheus/alertmanager c60fafa6025c
	github.com/prometheus/client_golang v1.14.0
	github.com/spf13/afero v1.8.2
	github.com/weaveworks/common 7c2720a9024d
	golang.org/x/crypto v0.1.0
	golang.org/x/net v0.1.0
	golang.org/x/sync v0.1.0
	go.opentelemetry.io/otel v1.11.1
	go.opentelemetry.io/otel/trace v1.11.1
	golang.org/x/sys v0.1.0

(Indirect dependencies)
	github.com/coreos/go-systemd/v22 v22.4.0
	github.com/go-openapi/runtime v0.25.0
	github.com/gofrs/uuid v4.3.1
	github.com/hashicorp/go-hclog v1.2.0
	github.com/matttproud/golang_protobuf_extensions v1.0.4
	go.mongodb.org/mongo-driver v1.11.0
	golang.org/x/mod v0.6.0
	golang.org/x/text v0.4.0
	golang.org/x/tools v0.2.0
	gopkg.in/ini.v1 v1.67.0
	gopkg.in/telebot.v3 v3.1.2

* Follow up weaveworks/common update to fix protobuf definitions

New weaveworks common explicitly includes gogo protobuf on a more
generic location.
See weaveworks/common#265

Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
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

Successfully merging this pull request may close these issues.

2 participants