From 9c775b068b64911e3302e3186e6b24cde8e9743d Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Tue, 12 Sep 2023 05:22:49 -0700 Subject: [PATCH] Use /usertools/cpu.bazelrc for TSL presubmit build Without this additional bazelrc file TSL will be built with the system compiler which happens to be GCC. I also had to disable a warning that was raised by clang. It puzzles me a bit that this is not needed for the Tensorflow build which definitely uses Clang. PiperOrigin-RevId: 564688122 --- .bazelrc | 1 + third_party/xla/.bazelrc | 1 + third_party/xla/third_party/tsl/.bazelrc | 1 + third_party/xla/third_party/tsl/.kokoro/linux/build.sh | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index 7feb49f753f..fd5677012d3 100644 --- a/.bazelrc +++ b/.bazelrc @@ -302,6 +302,7 @@ build:linux --copt="-Wno-deprecated" build:linux --copt="-Wno-deprecated-declarations" build:linux --copt="-Wno-ignored-attributes" build:linux --copt="-Wno-array-bounds" +build:linux --copt="-Wno-error=array-parameter" # Add unused-result as an error on Linux. build:linux --copt="-Wunused-result" diff --git a/third_party/xla/.bazelrc b/third_party/xla/.bazelrc index 7feb49f753f..fd5677012d3 100644 --- a/third_party/xla/.bazelrc +++ b/third_party/xla/.bazelrc @@ -302,6 +302,7 @@ build:linux --copt="-Wno-deprecated" build:linux --copt="-Wno-deprecated-declarations" build:linux --copt="-Wno-ignored-attributes" build:linux --copt="-Wno-array-bounds" +build:linux --copt="-Wno-error=array-parameter" # Add unused-result as an error on Linux. build:linux --copt="-Wunused-result" diff --git a/third_party/xla/third_party/tsl/.bazelrc b/third_party/xla/third_party/tsl/.bazelrc index 7feb49f753f..fd5677012d3 100644 --- a/third_party/xla/third_party/tsl/.bazelrc +++ b/third_party/xla/third_party/tsl/.bazelrc @@ -302,6 +302,7 @@ build:linux --copt="-Wno-deprecated" build:linux --copt="-Wno-deprecated-declarations" build:linux --copt="-Wno-ignored-attributes" build:linux --copt="-Wno-array-bounds" +build:linux --copt="-Wno-error=array-parameter" # Add unused-result as an error on Linux. build:linux --copt="-Wunused-result" diff --git a/third_party/xla/third_party/tsl/.kokoro/linux/build.sh b/third_party/xla/third_party/tsl/.kokoro/linux/build.sh index b25f0d26126..f05e02bfc6c 100644 --- a/third_party/xla/third_party/tsl/.kokoro/linux/build.sh +++ b/third_party/xla/third_party/tsl/.kokoro/linux/build.sh @@ -48,7 +48,7 @@ docker run --name tsl -w /tf/tsl -itd --rm \ bash # Build TSL -docker exec tsl bazel build \ +docker exec tsl bazel --bazelrc=/usertools/cpu.bazelrc build \ --output_filter="" \ --keep_going \ --build_tag_filters=$TAGS_FILTER \ @@ -58,7 +58,7 @@ docker exec tsl bazel build \ -- //tsl/... # Test TSL -docker exec tsl bazel test \ +docker exec tsl bazel --bazelrc=/usertools/cpu.bazelrc test \ --output_filter="" \ --keep_going \ --flaky_test_attempts=3 \ -- GitLab