Fix protobuf compilation error and CI error
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.