Skip to content

Commit

Permalink
Delete root-owned files in Kokoro builds
Browse files Browse the repository at this point in the history
Some of our Kokoro builds have been failing because Kokoro is unable to
copy root-owned files when the build is complete. This commit fixes the
problem by deleting these files at the end.
  • Loading branch information
acozzette committed Feb 17, 2021
1 parent 1e924ef commit 26cb6a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions kokoro/linux/cpp_distcheck/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions kokoro/release/python/linux/build_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 26cb6a7

Please sign in to comment.