Skip to content

Fix protobuf compilation error and CI error#2171

Draft
benhxy wants to merge 3 commits into
tensorflow:masterfrom
benhxy:ben/fix-build
Draft

Fix protobuf compilation error and CI error#2171
benhxy wants to merge 3 commits into
tensorflow:masterfrom
benhxy:ben/fix-build

Conversation

@benhxy
Copy link
Copy Markdown
Collaborator

@benhxy benhxy commented May 21, 2026

Fix protobuf compilation error

The build error was caused by a conflict between a workaround for Windows compilation and the googleapis dependency. To prevent compilation failures on Windows (where OPTIONAL can be defined as an empty string by the preprocessor), tensorflow_io had a patch in WORKSPACE that renamed OPTIONAL to OPIONAL in google/api/field_behavior.proto and a couple of other proto files in the com_google_googleapis repository.

However, #2168 brought in google/cloud/bigquery/storage/v1/table.proto which also uses OPTIONAL. Since the rename patch was only applied to a few hardcoded files, table.proto still used OPTIONAL but field_behavior.proto define it as OPIONAL, leading to the compilation error:

Enum type "google.api.FieldBehavior" has no value named "OPTIONAL" for option "google.api.field_behavior".

Fix CI build error

The error occurred because the workflow was running on ubuntu-24.04 using Python, and attempting to upgrade pip itself via sudo python3 -m pip install -U ... pip ....

On Ubuntu/Debian, the system-installed pip is managed by apt and does not contain the RECORD file that pip expects when uninstalling/upgrading. This caused pip to fail with:

ERROR: Cannot uninstall pip 24.0, RECORD file not found. Hint: The package was installed by debian.

@benhxy benhxy changed the title Fix protobuf compilation error Fix protobuf compilation error and CI error May 21, 2026
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.

1 participant