Skip to content

Commit

Permalink
Merge pull request #953 from dbnicholson/zipfile-bz2-lzma
Browse files Browse the repository at this point in the history
Include _bz2 and _lzma in bootstrap native libraries
  • Loading branch information
mhsmith committed Sep 4, 2023
2 parents b9c908d + 360f686 commit 7ef948c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions product/gradle-plugin/src/main/kotlin/PythonTasks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,10 @@ internal class TaskBuilder(
// standard FileFinder. All other native modules are loaded from a .zip using
// AssetFinder.
val BOOTSTRAP_NATIVE_STDLIB = listOf(
"_bz2.so", // zipfile < importer
"_ctypes.so", // java.primitive and importer
"_datetime.so", // calendar < importer (see test_datetime)
"_lzma.so", // zipfile < importer
"_random.so", // random < tempfile < zipimport
"_sha512.so", // random < tempfile < zipimport
"_struct.so", // zipfile < importer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1712,8 +1712,8 @@ def check_assets(self, apk_dir, kwargs):
self.test.assertCountEqual(
# For why each of these modules are needed, see BOOTSTRAP_NATIVE_STDLIB
# in PythonTasks.kt.
["java", "_ctypes.so", "_datetime.so", "_random.so", "_sha512.so",
"_struct.so", "binascii.so", "math.so", "mmap.so", "zlib.so"],
["java", "_bz2.so", "_ctypes.so", "_datetime.so", "_lzma.so", "_random.so",
"_sha512.so", "_struct.so", "binascii.so", "math.so", "mmap.so", "zlib.so"],
os.listdir(abi_dir))
self.check_python_so(join(abi_dir, "_ctypes.so"), python_version, abi)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def test_bootstrap(self):
for subdir, entries in [
# For why each of these modules are needed, see BOOTSTRAP_NATIVE_STDLIB
# in PythonTasks.kt.
(ABI, ["java", "_ctypes.so", "_datetime.so", "_random.so", "_sha512.so",
"_struct.so", "binascii.so", "math.so", "mmap.so", "zlib.so"]),
(ABI, ["java", "_bz2.so", "_ctypes.so", "_datetime.so", "_lzma.so", "_random.so",
"_sha512.so", "_struct.so", "binascii.so", "math.so", "mmap.so", "zlib.so"]),
(f"{ABI}/java", ["chaquopy.so"]),
]:
with self.subTest(subdir=subdir):
Expand Down

0 comments on commit 7ef948c

Please sign in to comment.