Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbf8eecd

Browse files
[3.13]gh-131531: Make Android build retry after network failures (GH-133193) (#133236)
Adds a retry strategy when downloading compilation resources for Android, plus some other cleanups.(cherry picked from commitfeac343)Co-authored-by: Malcolm Smith <smith@chaquo.com>
1 parentf68be0f commitbf8eecd

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

‎Android/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ it:
2525
`android-sdk/cmdline-tools/latest`.
2626
*`export ANDROID_HOME=/path/to/android-sdk`
2727

28-
The`android.py` script also requires the following commands to be on the`PATH`:
28+
The`android.py` script will automatically use the SDK's`sdkmanager` to install
29+
any packages it needs.
30+
31+
The script also requires the following commands to be on the`PATH`:
2932

3033
*`curl`
3134
*`java` (or set the`JAVA_HOME` environment variable)
32-
*`tar`
3335

3436

3537
##Building
@@ -97,7 +99,7 @@ similar to the `Android` directory of the CPython source tree.
9799
The Python test suite can be run on Linux, macOS, or Windows:
98100

99101
* On Linux, the emulator needs access to the KVM virtualization interface, and
100-
a DISPLAY environment variable pointing at an X server.
102+
a DISPLAY environment variable pointing at an X server. Xvfb is acceptable.
101103

102104
The test suite can usually be run on a device with 2 GB of RAM, but this is
103105
borderline, so you may need to increase it to 4 GB. As of Android

‎Android/android.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,19 @@ def make_build_python(context):
138138
run(["make","-j",str(os.cpu_count())])
139139

140140

141-
defunpack_deps(host):
141+
defunpack_deps(host,prefix_dir):
142142
deps_url="https://github.com/beeware/cpython-android-source-deps/releases/download"
143143
forname_verin ["bzip2-1.0.8-2","libffi-3.4.4-3","openssl-3.0.15-4",
144144
"sqlite-3.49.1-0","xz-5.4.6-1"]:
145145
filename=f"{name_ver}-{host}.tar.gz"
146146
download(f"{deps_url}/{name_ver}/{filename}")
147-
run(["tar","-xf",filename])
147+
shutil.unpack_archive(filename,prefix_dir)
148148
os.remove(filename)
149149

150150

151151
defdownload(url,target_dir="."):
152152
out_path=f"{target_dir}/{basename(url)}"
153-
run(["curl","-Lf","-o",out_path,url])
153+
run(["curl","-Lf","--retry","5","--retry-all-errors","-o",out_path,url])
154154
returnout_path
155155

156156

@@ -162,8 +162,7 @@ def configure_host_python(context):
162162
prefix_dir=host_dir/"prefix"
163163
ifnotprefix_dir.exists():
164164
prefix_dir.mkdir()
165-
os.chdir(prefix_dir)
166-
unpack_deps(context.host)
165+
unpack_deps(context.host,prefix_dir)
167166

168167
os.chdir(host_dir)
169168
command= [
@@ -241,16 +240,15 @@ def setup_sdk():
241240
# the Gradle wrapper is not included in the CPython repository. Instead, we
242241
# extract it from the Gradle GitHub repository.
243242
defsetup_testbed():
244-
# The Gradle version used for the build is specified in
245-
# testbed/gradle/wrapper/gradle-wrapper.properties. This wrapper version
246-
# doesn't need to match, as any version of the wrapper can download any
247-
# version of Gradle.
248-
version="8.9.0"
249243
paths= ["gradlew","gradlew.bat","gradle/wrapper/gradle-wrapper.jar"]
250-
251244
ifall((TESTBED_DIR/path).exists()forpathinpaths):
252245
return
253246

247+
# The wrapper version isn't important, as any version of the wrapper can
248+
# download any version of Gradle. The Gradle version actually used for the
249+
# build is specified in testbed/gradle/wrapper/gradle-wrapper.properties.
250+
version="8.9.0"
251+
254252
forpathinpaths:
255253
out_path=TESTBED_DIR/path
256254
out_path.parent.mkdir(exist_ok=True)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp