From 0f2933044b1281bcd02049764f4a052402f0632d Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Thu, 15 Oct 2026 18:14:48 -0700 Subject: [PATCH] Disable external_include_paths in TF.Text OSS Bazel configuration. Open-source builds fetch `.bazelrc` from TensorFlow `v2.22.0-rc0`, which predates the `external_include_paths` toolchain feature. When `IS_NIGHTLY=nightly` or `TF_VERSION` points to a newer TensorFlow commit, `prepare_tf_dep.sh` updates `@org_tensorflow` in `WORKSPACE` to pull in the newer `@rules_ml_toolchain` from `tf_workspace3()`, which enables `external_include_paths` (`-isystem` for external repositories) by default and breaks TFLite header resolution (such as `schema_utils` via `tflite_op_shim`). Append `common --features=-external_include_paths` and `common --host_features=-external_include_paths` to `.bazelrc` in `oss_scripts/configure.sh` to match TensorFlow `master` while remaining compatible with `v2.22.0-rc0`. PiperOrigin-RevId: 1000522266 --- oss_scripts/configure.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oss_scripts/configure.sh b/oss_scripts/configure.sh index e03b08153..4202845b2 100755 --- a/oss_scripts/configure.sh +++ b/oss_scripts/configure.sh @@ -53,6 +53,8 @@ fi write_to_bazelrc "build:manylinux2014 --config=release_cpu_linux" write_to_bazelrc "test --test_env=TF_USE_LEGACY_KERAS=1" +write_to_bazelrc "common --features=-external_include_paths" +write_to_bazelrc "common --host_features=-external_include_paths" if [ -z "$HERMETIC_PYTHON_VERSION" ]; then if [ -n "$PY_VERSION" ]; then