Skip to content

Commit 26cb6a7

Browse files
committed
Delete root-owned files in Kokoro builds
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.
1 parent 1e924ef commit 26cb6a7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

kokoro/linux/cpp_distcheck/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ until docker pull $DOCKER_IMAGE_NAME; do sleep 10; done
1616
docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \
1717
bash -l /var/local/protobuf/tests.sh cpp || FAILED="true"
1818

19+
# This directory is owned by root. We need to delete it, because otherwise
20+
# Kokoro will attempt to rsync it and fail with a permission error.
21+
rm -rf src/core
22+
1923
if [ "$FAILED" = "true" ]; then
2024
exit 1
2125
fi

kokoro/release/python/linux/build_artifacts.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ cp kokoro/release/python/linux/config.sh config.sh
3030

3131
build_artifact_version() {
3232
MB_PYTHON_VERSION=$1
33-
34-
# Clean up env
35-
rm -rf venv
36-
sudo rm -rf $REPO_DIR
3733
cp -R $STAGE_DIR $REPO_DIR
3834

3935
source multibuild/common_utils.sh
@@ -47,6 +43,10 @@ build_artifact_version() {
4743
build_wheel $REPO_DIR/python $PLAT
4844

4945
mv wheelhouse/* $ARTIFACT_DIR
46+
47+
# Clean up env
48+
rm -rf venv
49+
sudo rm -rf $REPO_DIR
5050
}
5151

5252
build_artifact_version 2.7

0 commit comments

Comments
 (0)