test_single_bazel_version.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env bash
  2. # Copyright 2021 The gRPC authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. set -ex
  16. if [ "$#" != "1" ] ; then
  17. echo "Must supply bazel version to be tested." >/dev/stderr
  18. exit 1
  19. fi
  20. VERSION="$1"
  21. cd "$(dirname "$0")"/../../..
  22. EXCLUDED_TARGETS=(
  23. # iOS platform fails the analysis phase since there is no toolchain available
  24. # for it.
  25. "-//src/objective-c/..."
  26. "-//third_party/objective_c/..."
  27. # This could be a legitmate failure due to bitrot.
  28. "-//src/proto/grpc/testing:test_gen_proto"
  29. # This appears to be a legitimately broken BUILD file. There's a reference to
  30. # a non-existent "link_dynamic_library.sh".
  31. "-//third_party/toolchains/bazel_0.26.0_rbe_windows:all"
  32. # TODO(jtattermusch): add back once fixed
  33. "-//examples/android/binder/..."
  34. )
  35. export OVERRIDE_BAZEL_VERSION="$VERSION"
  36. # when running under bazel docker image, the workspace is read only.
  37. export OVERRIDE_BAZEL_WRAPPER_DOWNLOAD_DIR=/tmp
  38. bazel build -- //... "${EXCLUDED_TARGETS[@]}"