chore(deps): grpc 4→5, protobuf 4→6
Some checks failed
Security / Security check (push) Failing after 2s

Two coupled majors that have been blocking the rest of the
Dart-side dependency lift in Studio (the constraint solver
pins meta/characters/etc. through these). Picked up:

- grpc 5.1.0 (was 4.2.0)
- protobuf 6.0.0 (was 4.2.0)
- analyzer 13.0.0, _fe_analyzer_shared 100.0.0
- google_cloud 0.5.0, googleapis_auth 2.3.1 (transitive)

The bindings now live in `lib/src/generated/fai/v1/` only —
the well-known-types `lib/src/generated/google/protobuf/`
copy has been deleted. protobuf 6 ships its own bundled
`well_known_types/google/protobuf/empty.pb.dart` and the
`HubAdminClient` API expects the *packaged* Empty type;
emitting a local copy created two distinct Empty types and
broke every `_admin.<rpc>(Empty())` call site.

`tools/generate.sh` now skips the WKT generation pass and
wipes `lib/src/generated/google/` on every run so the
duplicate-types breakage can't regress silently. The
import in `hub_client.dart` switches from the local copy to
`package:protobuf/well_known_types/google/protobuf/empty.pb
.dart`.

Smoke-verified: dart analyze clean, dart test green
(4 tests). Bumped to 0.17.0 — Studio absorbs in the next
commit.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-29 14:35:05 +02:00
parent 427bd6c0d9
commit 023adcec31
23 changed files with 4311 additions and 3652 deletions

View file

@ -55,9 +55,13 @@ if [[ ${#PROTO_FILES[@]} -eq 0 ]]; then
exit 1
fi
# Locate the well-known-types include directory. Required so we
# can generate Dart bindings for google.protobuf.Empty,
# google.protobuf.Struct, etc. that the platform's protos import.
# Locate the well-known-types include directory. Only needed
# for protoc's resolver; we do NOT generate the WKT Dart files
# anymore — `package:protobuf` (6.x+) ships them as
# `well_known_types/google/protobuf/empty.pb.dart` etc., and
# emitting our own copy creates duplicate-Empty-type errors at
# the API boundary (HubAdminClient expects the packaged Empty,
# our local copy is a distinct type to the analyser).
WKT_INCLUDE=""
for candidate in \
"/opt/homebrew/include" \
@ -75,23 +79,22 @@ if [[ -z "$WKT_INCLUDE" ]]; then
exit 1
fi
WKT_PROTOS=(
"$WKT_INCLUDE/google/protobuf/empty.proto"
"$WKT_INCLUDE/google/protobuf/struct.proto"
"$WKT_INCLUDE/google/protobuf/timestamp.proto"
)
# Wipe any stale WKT files generated by an earlier (pre-
# protobuf-6) version of this script. Keeping them around
# silently revives the duplicate-types breakage above on
# regen.
rm -rf "$OUT_DIR/google"
echo "generating Dart bindings"
echo " protos: ${#PROTO_FILES[@]} files under $PROTO_ROOT"
echo " WKT include: $WKT_INCLUDE"
echo " WKT include: $WKT_INCLUDE (protoc resolver only)"
echo " output: $OUT_DIR"
protoc \
--proto_path="$PROTO_ROOT" \
--proto_path="$WKT_INCLUDE" \
--dart_out=grpc:"$OUT_DIR" \
"${PROTO_FILES[@]}" \
"${WKT_PROTOS[@]}"
"${PROTO_FILES[@]}"
echo "done. generated files:"
find "$OUT_DIR" -name '*.dart' | sort