Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit b92dd38

Browse files
committed
Merge branch 'dev' into 3.7
2 parents ac88d89 + bb65a40 commit b92dd38

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

3.7.Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ RUN mkdir -p /opt/python-build/app/libs/ && mv rubicon-java-${RUBICON_JAVA_VERSI
203203
ENV ASSETS_DIR $APPROOT/app/src/main/assets/
204204
ARG COMPRESS_LEVEL
205205
ADD 3.7.pythonhome-excludes /opt/python-build/
206-
RUN mkdir -p "$ASSETS_DIR" && cd "$PYTHON_INSTALL_DIR" && zip -x@/opt/python-build/3.7.pythonhome-excludes -$COMPRESS_LEVEL -q "$ASSETS_DIR"/pythonhome.${TARGET_ABI_SHORTNAME}.zip -r .
206+
RUN mkdir -p "$ASSETS_DIR/stdlib" && cd "$PYTHON_INSTALL_DIR" && zip -x@/opt/python-build/3.7.pythonhome-excludes -$COMPRESS_LEVEL -q "$ASSETS_DIR"/stdlib/pythonhome.${TARGET_ABI_SHORTNAME}.zip -r .
207+
# Rename the ZIP file to include its sha256sum. This enables fast, accurate
208+
# cache validation/invalidation when the ZIP file reaches the Android device.
209+
RUN sha256sum "$ASSETS_DIR"/stdlib/pythonhome.${TARGET_ABI_SHORTNAME}.zip | cut -d' ' -f1 > /tmp/sum
210+
RUN mv "$ASSETS_DIR"/stdlib/pythonhome.${TARGET_ABI_SHORTNAME}.zip "$ASSETS_DIR"/stdlib/pythonhome.`cat /tmp/sum`.${TARGET_ABI_SHORTNAME}.zip
207211
RUN cd rubicon-java-${RUBICON_JAVA_VERSION} && zip -$COMPRESS_LEVEL -q "$ASSETS_DIR"/rubicon.zip -r rubicon
208212

209213
RUN apt-get update -qq && apt-get -qq install rsync

3.7.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,12 @@ function main() {
187187
build_one_abi "$TARGET_ABI_SHORTNAME" "3.7" "$COMPRESS_LEVEL"
188188
done
189189

190-
# Make a ZIP file.
190+
# Make a ZIP file, writing it first to `.tmp` so that we atomically clobber an
191+
# existing ZIP file rather than attempt to merge the new contents with old.
191192
fix_permissions
192193
pushd build/3.7/app > /dev/null
193-
zip -x@../../../3.7.excludes -r -"${COMPRESS_LEVEL}" "../../../dist/Python-3.7-Android-support${BUILD_TAG}.zip" .
194+
zip -x@../../../3.7.excludes -r -"${COMPRESS_LEVEL}" "../../../dist/Python-3.7-Android-support${BUILD_TAG}.zip".tmp .
195+
mv "../../../dist/Python-3.7-Android-support${BUILD_TAG}.zip".tmp "../../../dist/Python-3.7-Android-support${BUILD_TAG}.zip"
194196
popd
195197
}
196198

0 commit comments

Comments
 (0)