echo "" | ./configure
}
-function set_gcs_remote_cache_options {
- echo "build --experimental_remote_spawn_cache" >> "${TMP_BAZELRC}"
- echo "build --experimental_remote_platform_override='properties:{name:\"build\" value:\"windows-x64\"}'" >> "${TMP_BAZELRC}"
- echo "build --remote_http_cache=https://storage.googleapis.com/$GCS_BUCKET_NAME" >> "${TMP_BAZELRC}"
- echo "build --google_credentials=$GOOGLE_CLOUD_CREDENTIAL" >> "${TMP_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
-export TMP_BAZELRC=.tmp.bazelrc
-rm -f "${TMP_BAZELRC}"
-touch "${TMP_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
-# --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
-echo "build --define=override_eigen_strong_inline=true" >> "${TMP_BAZELRC}"
-
-echo "import %workspace%/${TMP_BAZELRC}" >> .bazelrc
-
run_configure_for_cpu_build
-bazel build -c opt tensorflow/tools/pip_package:build_pip_package || exit $?
+# --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 $?
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 -k --test_output=errors \
+bazel test -c opt $BUILD_OPTS -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 \
--flaky_test_attempts=3 \
//${PY_TEST_DIR}/tensorflow/python/... \
//${PY_TEST_DIR}/tensorflow/contrib/...
-
-# Remove all options in .tmp.bazelrc
-echo "" > "${TMP_BAZELRC}"