diff --git a/kokoro/linux/cpp_distcheck/build.sh b/kokoro/linux/cpp_distcheck/build.sh index 42ac88caffb4..a28843e9cba1 100755 --- a/kokoro/linux/cpp_distcheck/build.sh +++ b/kokoro/linux/cpp_distcheck/build.sh @@ -16,6 +16,10 @@ until docker pull $DOCKER_IMAGE_NAME; do sleep 10; done docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \ bash -l /var/local/protobuf/tests.sh cpp || FAILED="true" +# This directory is owned by root. We need to delete it, because otherwise +# Kokoro will attempt to rsync it and fail with a permission error. +rm -rf src/core + if [ "$FAILED" = "true" ]; then exit 1 fi diff --git a/kokoro/release/python/linux/build_artifacts.sh b/kokoro/release/python/linux/build_artifacts.sh index 6b1836f407e5..a35fc6f4279c 100755 --- a/kokoro/release/python/linux/build_artifacts.sh +++ b/kokoro/release/python/linux/build_artifacts.sh @@ -30,10 +30,6 @@ cp kokoro/release/python/linux/config.sh config.sh build_artifact_version() { MB_PYTHON_VERSION=$1 - - # Clean up env - rm -rf venv - sudo rm -rf $REPO_DIR cp -R $STAGE_DIR $REPO_DIR source multibuild/common_utils.sh @@ -47,6 +43,10 @@ build_artifact_version() { build_wheel $REPO_DIR/python $PLAT mv wheelhouse/* $ARTIFACT_DIR + + # Clean up env + rm -rf venv + sudo rm -rf $REPO_DIR } build_artifact_version 2.7