Skip to content

Commit 8a058a8

Browse files
committed
update to 3.8.10
1 parent e4576b9 commit 8a058a8

File tree

99 files changed

+2715
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2715
-31
lines changed

pydk-all.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,28 @@ else
1010
echo "not bash, those previously rising errors are ash/sh/dash/... flavours"
1111
fi
1212

13-
PYMINOR_DEFAULT=9
13+
PYMINOR_DEFAULT=8
14+
PYMICRO=10
15+
16+
PYMINOR_DEFAULT=7
17+
PYMICRO=10
1418

1519
export PYMAJOR=3
1620
export PYMINOR=${PYMINOR:-$PYMINOR_DEFAULT}
21+
export PYVER=${PYMAJOR}.${PYMINOR}.${PYMICRO}
1722

18-
if echo $PYMINOR |grep -q 7
23+
#echo $PYMINOR |grep -q 7
24+
if false
1925
then
20-
# python 3.7.x
21-
export PYVER=${PYMAJOR}.${PYMINOR}.7
26+
# python 3.7.x
2227
export OPENSSL_VERSION="1.0.2t"
2328
else
24-
# python 3.8.x / 3.9.x
25-
#export PYVER=${PYMAJOR}.${PYMINOR}.5
26-
export PYVER=${PYMAJOR}.${PYMINOR}.1
29+
# python 3.8.x / 3.9.x
2730
export OPENSSL_VERSION="1.1.1h"
2831
fi
2932

3033
export LIBFFI_VERSION=3.3
3134

32-
3335
export HOST_TRIPLET=x86_64-linux-gnu
3436
export HOST_TAG=linux-x86_64
3537

@@ -54,7 +56,6 @@ export HOME=${PYTHONPYCACHEPREFIX}
5456
#UNITS="unit"
5557
UNITS=""
5658

57-
5859
# select a place for android build
5960
export ENV=aosp
6061
ROOT="${ORIGIN}/${ENV}"
@@ -280,6 +281,9 @@ if [ -f CMakeLists.txt ]
280281
then
281282
echo " * using previous CMakeLists.txt in $(pwd)"
282283
else
284+
285+
# TODO: check wasm/wasi cmake + CMAKE_CACHE_ARGS "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"
286+
283287
cat > CMakeLists.txt <<END
284288
285289
cmake_minimum_required(VERSION 3.13.0)
@@ -729,7 +733,7 @@ export TOOLCHAIN="${ORIGIN}/emsdk/emsdk_env.sh"
729733
. $TOOLCHAIN
730734
export PATH="$EMSDK/upstream/emscripten:$BASEPATH"
731735

732-
export WCMAKE="emcmake $CMAKE -Wno-dev -DCMAKE_INSTALL_PREFIX=${APKUSR}"
736+
export WCMAKE="emcmake $CMAKE -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Wno-dev -DCMAKE_INSTALL_PREFIX=${APKUSR}"
733737

734738
cat > ${HOST}/${ABI_NAME}.sh <<END
735739
#!/bin/sh
@@ -834,7 +838,7 @@ then
834838
then
835839
echo "emsdk libs ready"
836840
else
837-
ALL="struct_info zlib bzip2 freetype harfbuzz ogg vorbis libpng bullet"
841+
ALL="struct_info libfetch zlib bzip2 freetype harfbuzz ogg vorbis libpng bullet"
838842
for one in $ALL
839843
do
840844
embuilder --pic build $one
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--- Python-3.7.10/Lib/importlib/_bootstrap_external.py 2021-02-16 02:29:22.000000000 +0100
2+
+++ Python-3.7.10-aosp/Lib/importlib/_bootstrap_external.py 2021-03-04 15:06:27.752072064 +0100
3+
@@ -1315,6 +1315,7 @@
4+
refreshed when the directory the finder is handling has been modified.
5+
6+
"""
7+
+ PATCHED = 1
8+
9+
def __init__(self, path, *loader_details):
10+
"""Initialize with the path to search on and a variable number of
11+
@@ -1386,9 +1387,14 @@
12+
# If a namespace package, return the path if we don't
13+
# find a module in the next section.
14+
is_namespace = _path_isdir(base_path)
15+
+
16+
# Check for a file w/ a proper suffix exists.
17+
for suffix, loader_class in self._loaders:
18+
full_path = _path_join(self.path, tail_module + suffix)
19+
+ try:
20+
+ print("1394: trying", full_path)
21+
+ except:
22+
+ pass
23+
_bootstrap._verbose_message('trying {}', full_path, verbosity=2)
24+
if cache_module + suffix in cache:
25+
if _path_isfile(full_path):
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--- Python-3.7.10/Lib/locale.py 2021-02-16 02:29:22.000000000 +0100
2+
+++ Python-3.7.10-aosp/Lib/locale.py 2021-03-04 15:06:27.760071792 +0100
3+
@@ -46,6 +46,10 @@
4+
5+
from _locale import *
6+
7+
+ if hasattr(sys, 'getandroidapilevel'):
8+
+ if sys.getandroidapilevel()<21:
9+
+ raise ImportError("android-api19")
10+
+
11+
except ImportError:
12+
13+
# Locale emulation
14+
@@ -88,6 +92,9 @@
15+
""" setlocale(integer,string=None) -> string.
16+
Activates/queries locale processing.
17+
"""
18+
+ if category>LC_ALL:
19+
+ raise Error('_locale emulation invalid category')
20+
+
21+
if value not in (None, '', 'C'):
22+
raise Error('_locale emulation only supports "C" locale')
23+
return 'C'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--- Python-3.7.10/Lib/modulefinder.py 2021-02-16 02:29:22.000000000 +0100
2+
+++ Python-3.7.10-aosp/Lib/modulefinder.py 2021-03-04 15:06:27.764071657 +0100
3+
@@ -185,8 +185,8 @@
4+
if q:
5+
self.msgout(4, "find_head_package ->", (q, tail))
6+
return q, tail
7+
- self.msgout(4, "raise ImportError: No module named", qname)
8+
- raise ImportError("No module named " + qname)
9+
+ self.msgout(4, "raise ImportError: No module named1", qname)
10+
+ raise ImportError("No module named1 " + qname)
11+
12+
def load_tail(self, q, tail):
13+
self.msgin(4, "load_tail", q, tail)
14+
@@ -199,7 +199,7 @@
15+
m = self.import_module(head, mname, m)
16+
if not m:
17+
self.msgout(4, "raise ImportError: No module named", mname)
18+
- raise ImportError("No module named " + mname)
19+
+ raise ImportError("No module named2 " + mname)
20+
self.msgout(4, "load_tail ->", m)
21+
return m
22+
23+
@@ -215,7 +215,7 @@
24+
subname = "%s.%s" % (m.__name__, sub)
25+
submod = self.import_module(sub, subname, m)
26+
if not submod:
27+
- raise ImportError("No module named " + subname)
28+
+ raise ImportError("No module named3 " + subname)
29+
30+
def find_all_submodules(self, m):
31+
if not m.__path__:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--- Python-3.7.10/Lib/platform.py 2021-02-16 02:29:22.000000000 +0100
2+
+++ Python-3.7.10-aosp/Lib/platform.py 2021-03-04 15:06:27.768071521 +0100
3+
@@ -188,6 +188,9 @@
4+
The file is read and scanned in chunks of chunksize bytes.
5+
6+
"""
7+
+ if hasattr(sys, 'getandroidapilevel'):
8+
+ return 'libc', f'{sys.getandroidapilevel()}-bionic'
9+
+
10+
V = _comparable_version
11+
if hasattr(os.path, 'realpath'):
12+
# Python 2.2 introduced os.path.realpath(); it is used
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- Python-3.7.10/Lib/runpy.py 2021-02-16 02:29:22.000000000 +0100
2+
+++ Python-3.7.10-aosp/Lib/runpy.py 2021-03-04 15:06:27.772071386 +0100
3+
@@ -133,7 +133,7 @@
4+
msg = "Error while finding module specification for {!r} ({}: {})"
5+
raise error(msg.format(mod_name, type(ex).__name__, ex)) from ex
6+
if spec is None:
7+
- raise error("No module named %s" % mod_name)
8+
+ raise error("No module named5 %s" % mod_name)
9+
if spec.submodule_search_locations is not None:
10+
if mod_name == "__main__" or mod_name.endswith(".__main__"):
11+
raise error("Cannot use package as __main__ module")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- Python-3.7.10/Lib/test/test_zlib.py 2021-02-16 02:29:22.000000000 +0100
2+
+++ Python-3.7.10-aosp/Lib/test/test_zlib.py 2021-03-04 15:06:27.776071250 +0100
3+
@@ -437,7 +437,14 @@
4+
sync_opt = ['Z_NO_FLUSH', 'Z_SYNC_FLUSH', 'Z_FULL_FLUSH',
5+
'Z_PARTIAL_FLUSH']
6+
7+
- ver = tuple(int(v) for v in zlib.ZLIB_RUNTIME_VERSION.split('.'))
8+
+ v = zlib.ZLIB_RUNTIME_VERSION.split('-', 1)[0].split('.')
9+
+ if len(v) < 4:
10+
+ v.append('0')
11+
+ elif not v[-1].isnumeric():
12+
+ v[-1] = '0'
13+
+
14+
+ ver = tuple(map(int, v))
15+
+
16+
# Z_BLOCK has a known failure prior to 1.2.5.3
17+
if ver >= (1, 2, 5, 3):
18+
sync_opt.append('Z_BLOCK')
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- Python-3.7.10/Makefile.pre.in 2021-02-16 02:29:22.000000000 +0100
2+
+++ Python-3.7.10-aosp/Makefile.pre.in 2021-03-04 15:06:27.780071115 +0100
3+
@@ -226,7 +226,7 @@
4+
PY3LIBRARY= @PY3LIBRARY@
5+
DLLLIBRARY= @DLLLIBRARY@
6+
LDLIBRARYDIR= @LDLIBRARYDIR@
7+
-INSTSONAME= @INSTSONAME@
8+
+INSTSONAME= libpython$(LDVERSION).so
9+
10+
11+
LIBS= @LIBS@
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--- Python-3.7.10/Modules/_decimal/libmpdec/io.c 2021-02-16 02:29:22.000000000 +0100
2+
+++ Python-3.7.10-aosp/Modules/_decimal/libmpdec/io.c 2021-03-04 15:06:27.784070980 +0100
3+
@@ -871,9 +871,15 @@
4+
if (*spec->sep) {
5+
return 0;
6+
}
7+
+
8+
spec->type = *cp++;
9+
spec->type = (spec->type == 'N') ? 'G' : 'g';
10+
- lc = localeconv();
11+
+#if __ANDROID__ && (__ANDROID_API__ < 21)
12+
+ #warning "====================================== broken_localeconv ================================"
13+
+ lc = broken_localeconv();
14+
+#else
15+
+ lc = localeconv(); //PATCHED
16+
+#endif
17+
spec->dot = lc->decimal_point;
18+
spec->sep = lc->thousands_sep;
19+
spec->grouping = lc->grouping;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--- Python-3.7.10/Modules/_localemodule.c 2021-02-16 02:29:22.000000000 +0100
2+
+++ Python-3.7.10-aosp/Modules/_localemodule.c 2021-03-04 15:06:27.788070843 +0100
3+
@@ -96,6 +96,10 @@
4+
PyErr_SetString(Error, "invalid locale category");
5+
return NULL;
6+
}
7+
+#else
8+
+#ifdef __ANDROID__
9+
+ return PyUnicode_FromFormat("%s", "C");
10+
+#endif
11+
#endif
12+
13+
if (locale) {
14+
@@ -213,7 +217,16 @@
15+
}
16+
17+
/* if LC_NUMERIC is different in the C library, use saved value */
18+
- l = localeconv();
19+
+//PMPP API<21
20+
+#if __ANDROID__ && (__ANDROID_API__ < 21)
21+
+ /* Don't even try on Android's broken locale.h. */
22+
+ /* maybe can use c++ stdlib to implement */
23+
+ l = broken_localeconv();
24+
+#else
25+
+ /* if LC_NUMERIC is different in the C library, use saved value */
26+
+ l = localeconv(); //PATCHED
27+
+#endif
28+
+//PMPP API<21
29+
30+
/* hopefully, the localeconv result survives the C library calls
31+
involved herein */

0 commit comments

Comments
 (0)