Skip to content

Upgrade github.com/golang/protobuf from v1.2.0 to v1.3.0#1967

Closed
bufdev wants to merge 1 commit intobazel-contrib:masterfrom
bufdev:golang-protobuf-v1.3.0
Closed

Upgrade github.com/golang/protobuf from v1.2.0 to v1.3.0#1967
bufdev wants to merge 1 commit intobazel-contrib:masterfrom
bufdev:golang-protobuf-v1.3.0

Conversation

@bufdev
Copy link
Copy Markdown

@bufdev bufdev commented Feb 27, 2019

This is necessary because https://github.com/golang/protobuf/releases/tag/v1.3.0 resulted in a new ProtoPackageIsVersion3 https://github.com/golang/protobuf/blob/v1.3.0/proto/lib.go#L946 meaning that code generated with v1.3.0 will not build against a dependency of v1.2.0. There's a bit of a chicken-and-egg problem that go_rules_dependencies depends on v1.2.0, but some use go_repository from Gazelle to depend on com_github_golang_protobuf, but go_rules_dependencies needs to be loaded before go_repository can be loaded from Gazelle.

I've verified this is a drop-in, I am using this in https://github.com/uber/prototool/blob/3c3a6dbdc3f490a385928221a8b6606f14ac1aa5/WORKSPACE#L15

It would probably be worthwhile to upgrade gogo/protobuf to v1.2.1 as well, but this isn't required.

bazel test //... passes locally using Bazel v0.22.0.

@jayconrod
Copy link
Copy Markdown
Collaborator

Sorry, I'm not going to update any dependencies in go_rules_dependencies until we're closer to a new major release, which will be in a month or so, at which point, I'll do them all at once. Updating protobuf in particular means verifying the third_party patch that provides extra rules. I'd prefer not to repeat that work later on.

You can override the protobuf version in your own workspace though. There are instructions at Overriding dependencies. It should be safe to call gazelle_dependencies and go_repository before go_rules_dependencies. You can apply the patch in @io_bazel_rules_go//third_party (but you won't need the Gazelle patch with go_repository).

@jayconrod jayconrod closed this Feb 27, 2019
@bufdev
Copy link
Copy Markdown
Author

bufdev commented Feb 27, 2019

Ok - FYI you’re going to have a lot of people broken on this, was trying to do a favor here to get ahead of it before others come along, but your call. This is likely going to break a lot of people if not fixed soon.

yushan26 pushed a commit to yushan26/rules_go that referenced this pull request Jun 16, 2025
This makes the exec tools toolchain disabled by default to prevent
toolchain resolution
from matching it and inadvertently pulling in a dependency on the
hermetic runtimes.
While the hermetic runtime wouldn't actually be used (precompiling is
disabled
by default), the dependency triggered downloading of the runtimes, which
breaks
environments which forbid remote downloads they haven't vetted (such a
case is
Bazel's own build process).

To fix this, a flag is added to control if the exec tools toolchain is
enabled or not.
When disabled (the default), the toolchain won't match, and the remote
dependency isn't
triggered.

Fixes bazel-contrib#1967.

---------

Co-authored-by: Richard Levasseur <rlevasseur@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants