echo "" | ./configure
}
+function set_gcs_remote_cache_options {
+ echo "build --experimental_remote_spawn_cache" >> .bazelrc
+ echo "build --experimental_remote_platform_override='properties:{name:\"build\" value:\"windows-x64\"}'" >> .bazelrc
+ echo "build --remote_http_cache=https://storage.googleapis.com/$GCS_BUCKET_NAME" >> .bazelrc
+ echo "build --google_credentials=$GOOGLE_CLOUD_CREDENTIAL" >> .bazelrc
+}
+
function create_python_test_dir() {
rm -rf "$1"
mkdir -p "$1"
source "tensorflow/tools/ci_build/windows/bazel/bazel_test_lib.sh" \
|| { echo "Failed to source bazel_test_lib.sh" >&2; exit 1; }
+# Recreate an empty bazelrc file under source root
+rm -f .bazelrc
+touch .bazelrc
+
skip_test=0
for ARG in "$@"; do
if [[ "$ARG" == --skip_test ]]; then
skip_test=1
+ elif [[ "$ARG" == --enable_gcs_remote_cache ]]; then
+ set_gcs_remote_cache_options
fi
done
-run_configure_for_cpu_build
-
# --define=override_eigen_strong_inline=true speeds up the compiling of conv_grad_ops_3d.cc and conv_ops_3d.cc
# by 20 minutes. See https://github.com/tensorflow/tensorflow/issues/10521
-BUILD_OPTS="--define=override_eigen_strong_inline=true"
-bazel build -c opt $BUILD_OPTS tensorflow/tools/pip_package:build_pip_package || exit $?
+echo "build --define=override_eigen_strong_inline=true" >> .bazelrc
+
+run_configure_for_cpu_build
+
+bazel build -c opt tensorflow/tools/pip_package:build_pip_package || exit $?
if [[ "$skip_test" == 1 ]]; then
exit 0
# Define no_tensorflow_py_deps=true so that every py_test has no deps anymore,
# which will result testing system installed tensorflow
-bazel test -c opt $BUILD_OPTS -k --test_output=errors \
+bazel test -c opt -k --test_output=errors \
--define=no_tensorflow_py_deps=true --test_lang_filters=py \
--test_tag_filters=-no_pip,-no_windows,-no_oss \
--build_tag_filters=-no_pip,-no_windows,-no_oss --build_tests_only \