Repository navigation
Fix import option emitted as a regular dependency - #792
Merged
Merged
Conversation
emcfarlane
commented
Nov 5, 2026
pkwarren
approved these changes
Nov 9, 2026
pkwarren
approved these changes
Nov 10, 2026
pkwarren
approved these changes
Nov 10, 2026
emcfarlane
enabled auto-merge (squash)
November 10, 2026 09:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an option import publicly imports a file that another import also brings in, the experimental compiler cleared the option import's flag. The file was then written to
dependencyinstead ofoption_dependency, and it lost its options-only restriction. For example:protoc emits
option_dependency: ["b.proto"]. We emitteddependency: ["other.proto", "b.proto"]. Edition 2026 makes this common, becausegoogle/protobuf/json_options.protopublicly importsjson_enumvalue_options.proto.The cause was not enough details in the flags to handle this case. Both to record how the dependency was imported and whether it is restricted to options. New field
dependencyis true when a file is reachable through a non-option import. Which is either directly, or through that import's public export. Visibility checks now usedependency.