Skip to content

tensorflow-serving: fix project build at HEAD (Bazel 7.7.0 pin, tensorflow.patch refresh, static libc++) - #16061

Open
alencheung wants to merge 1 commit into
google:masterfrom
alencheung:tensorflow-serving-build-fix
Open

alencheung wants to merge 1 commit into
google:masterfrom
alencheung:tensorflow-serving-build-fix

Conversation

@alencheung

Copy link
Copy Markdown

The tensorflow-serving project currently fails to build at HEAD. Three independent breaks; all verified fixed by this change (the full build_image -> build_fuzzers --sanitizer address --architecture x86_64 -> reproduce sequence passes afterwards):

  1. Bazel 9.x dropped WORKSPACE repositories. bazelisk resolves the latest release, in which @com_google_fuzztest (required by setup_configs to define --config=oss-fuzz) is unresolvable. Fix: pin .bazelversion to 7.7.0 — the version the pinned TF commit (2f504bd) builds with.

  2. third_party/tensorflow/tensorflow.patch is stale against serving's own TF pin (tensorflow/serving@549f7a1 pins 2f504bd): 3 hunks no longer apply (the graph_execution_options.h fields, the tf_runtime repo_mapping block, and the gpu_communicator.h PackedKernelArg alias all changed upstream) and 1 hunk needs a context refresh (absl/strings:string_view inserted in xla/tsl/cuda/BUILD.bazel). The org_tensorflow repository fetch fails with CONTENT_DOES_NOT_MATCH_TARGET otherwise. Fix: refresh the patch inside tensorflow-serving.diff.

  3. Binaries link a dynamic libc++.so.1 from the hermetic rules_ml_toolchain, which base-runner does not ship — fuzzers fail to load at run time (error while loading shared libraries: libc++.so.1). Fix: -static-libstdc++ -l:libc++abi.a.

After these, the existing json_tensor_test_fuzz@JsonFuzzTest.TheF target builds and loads in base-runner (verified), and out-of-tree REST-JSON harnesses over Fill{Predict,Classification,Regression}RequestFromJson reproduce the known unbounded-recursion crash under ASAN (tensorflow_serving/util/json_tensor.cc:393 in FillTensorProto, the parse-side half of CVE-2025-0649) — relevant context for #15357 and tensorflow/serving#4143, which add such targets but currently cannot build on top of the project as-is.

- pin Bazel 7.7.0 via .bazelversion (bazelisk resolves 9.x, which no
  longer reads WORKSPACE repositories -> @com_google_fuzztest unresolvable,
  setup_configs/--config=oss-fuzz fail)
- refresh third_party/tensorflow/tensorflow.patch against the pinned TF
  commit 2f504bd: 3 hunks obsolete upstream (graph_execution_options.h
  fields, tf_runtime repo_mapping, gpu_communicator.h PackedKernelArg),
  1 hunk context drift (absl/strings:string_view in xla/tsl/cuda/BUILD.bazel)
- link with -static-libstdc++ -l:libc++abi.a so binaries run in
  base-runner (hermetic rules_ml_toolchain clang otherwise links its own
  dynamic libc++.so.1)

Verified end-to-end: build_image -> build_fuzzers --sanitizer address
--architecture x86_64 -> reproduce all succeed; existing
json_tensor_test_fuzz target builds and runs.
@google-cla

google-cla Bot commented Aug 25, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions

Copy link
Copy Markdown

alencheung is a new contributor to projects/tensorflow-serving. The PR must be approved by known contributors before it can be merged. The past contributors are: maflcko

This branch has not been deployed

No deployments
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.

2 participants