Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Fixes for Tink Python's create_release.sh script:
Browse files Browse the repository at this point in the history
 - Save a copy of the WORKSPACE before building wheels, and restore it afterwards.
 - Give ownership of all the files in the Tink Python folder to the non-root user.

PiperOrigin-RevId: 459043624
  • Loading branch information
morambro authored and Copybara-Service committed Jul 5, 2022
1 parent bdb89bb commit 7a4fa64
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/tools/distribution/create_release.sh
Expand Up @@ -46,6 +46,10 @@ build_linux() {
# https://docs.docker.com/engine/security/trust/content_trust/).
export DOCKER_CONTENT_TRUST=1

# We use setup.py to build wheels; setup.py makes changes to the WORKSPACE
# file so we save a copy for backup.
cp WORKSPACE WORKSPACE.bak

# Build binary wheels.
docker run \
--volume "${TINK_PYTHON_ROOT_PATH}/..:/tmp/tink" \
Expand All @@ -60,6 +64,12 @@ build_linux() {
"${IMAGE}" \
"${workdir}/tools/distribution/test_linux_binary_wheels.sh"

# Restore the original WORKSPACE.
mv WORKSPACE.bak WORKSPACE

# Docker runs as root so we transfer ownership to the non-root user.
sudo chown -R "$(id -un):$(id -gn)" "${TINK_PYTHON_ROOT_PATH}"

echo "### Building Linux source distribution ###"
local sorted=( $( echo "${PYTHON_VERSIONS[@]}" \
| xargs -n1 | sort -V | xargs ) )
Expand Down

0 comments on commit 7a4fa64

Please sign in to comment.