Skip to content

Commit 3c87b99

Browse files
Amit Patankartensorflower-gardener
Amit Patankar
authored andcommitted
Remove --distinct_host_configuration=false from tools/bazel.rc
Don't use --distinct_host_configuration=false by default, because it would break cross compiling, like android build and Raspberry Pi build. Instead, we add it for builds that we know they have the same host and target platforms. PiperOrigin-RevId: 199194260
1 parent 204fcd9 commit 3c87b99

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

tensorflow/tools/ci_build/pi/build_raspberry_pi.sh

-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ bazel build -c opt ${PI_COPTS} \
100100
--copt=-fomit-frame-pointer --cpu=armeabi \
101101
--crosstool_top=@local_config_arm_compiler//:toolchain \
102102
--verbose_failures \
103-
--distinct_host_configuration=true \
104103
//tensorflow/tools/benchmark:benchmark_model \
105104
//tensorflow/tools/pip_package:build_pip_package
106105

tensorflow/tools/ci_build/windows/cpu/pip/build_tf_windows.sh

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ if [[ "$release_build" != 1 ]]; then
7373
echo "build --define=override_eigen_strong_inline=true" >> "${TMP_BAZELRC}"
7474
fi
7575

76+
# The host and target platforms are the same in Windows build. So we don't have
77+
# to distinct them. This helps avoid building the same targets twice.
78+
echo "build --distinct_host_configuration=false" >> "${TMP_BAZELRC}"
79+
7680
echo "import %workspace%/${TMP_BAZELRC}" >> .bazelrc
7781

7882
run_configure_for_cpu_build

tools/bazel.rc

-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
# By default, we don't distinct target and host platfroms.
2-
# When doing cross compilation, use --config=cross_compile to distinct them.
3-
build --distinct_host_configuration=false
4-
build:cross_compile --distinct_host_configuration=true
5-
61
# Android configs. Bazel needs to have --cpu and --fat_apk_cpu both set to the
72
# target CPU to build transient dependencies correctly. See
83
# https://docs.bazel.build/versions/master/user-manual.html#flag--fat_apk_cpu
94
build:android --crosstool_top=//external:android/crosstool
105
build:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
11-
build:android --config=cross_compile
126
build:android_arm --config=android
137
build:android_arm --cpu=armeabi-v7a
148
build:android_arm --fat_apk_cpu=armeabi-v7a

0 commit comments

Comments
 (0)