Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Bump github.com/bufbuild/protocompile from 0.1.0 to 0.5.1 #21

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 13, 2023

Bumps github.com/bufbuild/protocompile from 0.1.0 to 0.5.1.

Release notes

Sourced from github.com/bufbuild/protocompile's releases.

v0.5.1

This is an urgent bug-fix release, to remedy a potential deadlock error in the previous release (v0.5.0).

The only change in this release is a fix to this deadlock issue. With v0.5.0, if a compile operation was using an override version of google/protobuf/descriptor.proto, it was possible for the call to compiler.Compile to halt, only returning if the context was cancelled or times out. This is now fixed.

v0.5.0

DO NOT USE!

This release introduced a potential deadlock in calls to the Compile method of a protocompile.Compiler. Use v0.5.1 instead, which fixes the deadlock issue.


This release addresses an issue introduced in v0.3.0 wherein the results of compilation could sometimes have custom options represented as unrecognized fields, instead of as known extension fields.

While fixing that issue, several other changes were made opportunistically to improve code maintainability. This resulted in some changes that are technically not backwards compatible. However, these incompatible changes are highly unlikely to pose source compatibility issues for users. Methods were removed from an interface that were highly unlikely to be called outside of this repo.

Fixes:

  1. It was previously possible for descriptors to be returned with unrecognized fields if an override version of google/protobuf/descriptor.proto were in use. This has been fixed so that all custom options interpreted by the compiler should be represented as known extension fields.

Changes:

  1. The linker.Result interface has had several methods removed:
    • ResolveEnumType(protoreflect.FullName) protoreflect.EnumDescriptor
    • ResolveMessageType(protoreflect.FullName) protoreflect.MessageDescriptor
    • ResolveOptionsType(protoreflect.FullName) protoreflect.MessageDescriptor (just recently introduced in v0.3.0)
    • ResolveExtension(protoreflect.FullName) protoreflect.ExtensionTypeDescriptor
  2. The linker.ResolverFromFile function has been updated so that the returned resolver properly implements visibility rules of the Protobuf language. It can resolve any element that is visible to the given file, including elements visible via transitive public imports.

Additions:

  1. The various entry-point functions in the options sub-package now accept optional variadic InterpreterOption params. A single such option is now provided, WithOverrideDescriptorProto, which allows the caller to provide an override version of google/protobuf/descriptor.proto to use for interpreting options.

v0.4.0

Fixes:

  1. If a protocompile.Resolver returns search results with parser results or descriptor protos that are shared across more than one compile operation, a data race could occur. This happens when a descriptor proto needs to be modified during compilation (like to replace unqualified references with fully-qualified references during linking, to interpret options, or to add source code info). In that case the modification could be made to the same descriptor, concurrently from the different compile operations. If the race detector is enabled, this will result in a crash.
  2. If a program directly calls parser.ResultFromAST, passing false for whether to validate the result, it could get back a different file descriptor proto than if true were passed, even if the result is in fact valid. In particular, when validation was skipped, field descriptors may be missing values for the label field. This is now fixed such that there is no difference in the result (other than the possibility of an error when validating, due to extra validation checks).
  3. If a protocompiler.Resolver returns a search result with an invalid type reference, such that a field's type_name field resolved to a message but the type field was incorrectly set to TYPE_ENUM, an invalid compile result would be produced. And if the converse occurred (type_name resolved to an enum, but type indicated TYPE_MESSAGE), it would be silently ignored but produce a valid result (by correcting the errant type field value). Now, if either of these kinds of mismatches are detected, an error will occur.
  4. The binary format of a CanonicalProto from a linker.Result did not match the serialization format that protoc uses in some obscure cases. If the compile operation contained an override version of "google/protobuf/descriptor.proto" that re-declared a known field (e.g. same tag number as a field statically known to the program) with an incompatible type, protoc includes it with other unrecognized fields after recognized fields are serialized. But this repo was including it with recognized fields. This has been fixed.

Changes:

  1. When computing source code info, comments that would previously have been dropped due to ambiguity may not be attributed. When a sequence of comments is ambiguous (i.e. unclear whether they should be attributed as trailing comment to prior token, leading comment to subsequent token, or detached), instead of being dropped they will now be attributed as follows:

    • If there is one comment, it will be detached.
    • If there are two or more comments, the first will be a trailing comment on prior token, the last will be a leading comment on subsequent token, and any other comments in between will be detached.

    This mirrors the behavior of protoc as of v22.0, in which an equivalent change was made to comment attribution logic.

Additions:

  1. A new function, Clone(parser.Result) parser.Result, has been added to the parser sub-package. This makes a deep copy of a parser.Result, which can be used to make defensive copies (such as to prevent data races). This clones the result's file descriptor proto and also re-creates an internal index that maps elements of the file descriptor proto to nodes in the AST.

v0.3.0

This release contains a few fixes but is mostly to align with the recent release of Protocol Buffers v22.0.

... (truncated)

Commits
  • 583d154 Go back to waiting for override descriptor.proto with all other deps (#115)
  • 49c8099 Retain custom options as known fields, even with custom descriptor.proto (#...
  • d4ce4f4 Undo recent go work sync (#111)
  • 191ceca Bump github.com/bufbuild/buf from 1.14.0 to 1.15.0 in /internal/tools (#108)
  • 2fe9380 Bump golang.org/x/sync from 0.0.0-20210220032951-036812b2e83c to 0.1.0 (#107)
  • e83f01f Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 (#106)
  • fa737f6 Sleep not necessary: race detector consistently detects race without it (#104)
  • 5340254 Update protoc to v22.0 (#100)
  • 2c27603 Fix data race in compiler when resolver provides unlinked descriptor proto (#...
  • 80a64ae Update deps to address depend-a-bot alerts (#99)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [github.com/bufbuild/protocompile](https://github.com/bufbuild/protocompile) from 0.1.0 to 0.5.1.
- [Release notes](https://github.com/bufbuild/protocompile/releases)
- [Commits](bufbuild/protocompile@v0.1.0...v0.5.1)

---
updated-dependencies:
- dependency-name: github.com/bufbuild/protocompile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file go Pull requests that update Go code labels Mar 13, 2023
@CLAassistant
Copy link

CLAassistant commented Apr 29, 2023

CLA assistant check
All committers have signed the CLA.

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Aug 7, 2023

Superseded by #41.

@dependabot dependabot bot closed this Aug 7, 2023
@dependabot dependabot bot deleted the dependabot/go_modules/github.com/bufbuild/protocompile-0.5.1 branch August 7, 2023 09:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant