[fix grpc_build_protobuf_at_head test timeout] added bazel override for protobuf in build_python.sh (#37404)

Fix for grpc_build_protobuf_at_head -> python_linux_opt_native_buildonly timeout

Found the following error during Python build:
![Screenshot 2024-08-02 12 16 54 PM](https://github.com/user-attachments/assets/8a57d770-dedb-4e6c-8117-b2b498d72657)

When we mount and reuse the existing repo from host machine inside docker container, the `tools/bazel.rc` file is shared to the docker container and the Bazel override host location written to `tools/bazel.rc` from tools/.../grpc_build_submodule_at_head.sh (outside docker container) forces bazel to look for the same host location inside the docker container, which doesn't exist.
Hence overriding it again with the working directory inside the container should solve this issue.

Closes #37404

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37404 from sreenithi:fix_build_protobuf_at_head_timeout cae74938ff
PiperOrigin-RevId: 662526169
pull/37443/head
Sreenithi Sridharan 3 months ago committed by Copybara-Service
parent 28730dcfd9
commit 39e0f06de1
  1. 5
      tools/internal_ci/linux/grpc_build_submodule_at_head.sh
  2. 13
      tools/run_tests/helper_scripts/build_python.sh

@ -36,7 +36,6 @@ echo "This suite tests whether gRPC HEAD builds with HEAD of submodule '${SUBMOD
echo "If a test breaks, either"
echo "1) some change in the grpc repository has caused the failure"
echo "2) some change that was just merged in the submodule head has caused the failure."
echo ""
echo "submodule '${SUBMODULE_NAME}' is at commit: $(cd third_party/${SUBMODULE_NAME}; git rev-parse --verify HEAD)"
echo ""
@ -51,8 +50,6 @@ case "$SUBMODULE_NAME" in
;;
protobuf)
BAZEL_DEP_NAME="com_google_protobuf"
# TODO(xuanwang-amos): Remove the following once python test gets fixed for protobuf-at-head test.
EXTRA_EXCLUDE_FILTER="python"
;;
esac
if [ -z "$BAZEL_DEP_NAME" ]
@ -90,4 +87,4 @@ tools/buildgen/generate_projects.sh
git add -A
git -c user.name='foo' -c user.email='foo@google.com' commit -m 'Update submodule' --allow-empty
tools/run_tests/run_tests_matrix.py -f linux --exclude c sanity basictests_arm64 openssl dbg $EXTRA_EXCLUDE_FILTER --inner_jobs 16 -j 2 --build_only
tools/run_tests/run_tests_matrix.py -f linux --exclude c sanity basictests_arm64 openssl dbg --inner_jobs 16 -j 2 --build_only

@ -86,6 +86,19 @@ function toolchain() {
fi
}
# When we mount and reuse the existing repo from host machine inside docker
# container, the `tools/bazel.rc` file is shared to the docker container and
# the Bazel override written to `bazel.rc` from tools/.../grpc_build_submodule_at_head.sh
# (outside docker container) forces bazel to look for the same host location
# inside the docker container, which doesn't exist.
# Hence overriding it again with the working directory inside the container
# should solve this issue
BAZEL_DEP_PATH="$(pwd)/third_party/protobuf"
BAZEL_DEP_NAME="com_google_protobuf"
echo "bazel override_repository is set for ${BAZEL_DEP_NAME} to ${BAZEL_DEP_PATH}"
echo "build --override_repository=${BAZEL_DEP_NAME}=${BAZEL_DEP_PATH}" >> "tools/bazel.rc"
echo "query --override_repository=${BAZEL_DEP_NAME}=${BAZEL_DEP_PATH}" >> "tools/bazel.rc"
####################
# Script Arguments #
####################

Loading…
Cancel
Save