zipapp exploded the python interpreter
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- build-system
Research direction
Start by reproducing the zipapp contents shown in the issue and tracing how the Python 3.10 interpreter and libraries are gathered into the archive. Done means the static interpreter is not duplicated under multiple names and unnecessary shared libraries are no longer packed, while the resulting zipapp still runs correctly.
Written by the indexing model from the issue text.
Description
We are using python 3.10 and the static python3 interpreter binary is about 45MB, but zipapp packs it three times so we end up with 150MB just for the interpreter alone, making the zipapp binary bloated.
$ ls -l runfiles/rules_python++python+python_3_10_x86_64-unknown-linux-gnu/bin/python*
-rwxrwxr-x 1 koi koi 44667000 Jan 1 1980 python
-rwxrwxr-x 1 koi koi 44667000 Jan 1 1980 python3
-rwxrwxr-x 1 koi koi 3149 Jan 1 1980 python3-config
-rwxrwxr-x 1 koi koi 44667000 Jan 1 1980 python3.10
-rwxrwxr-x 1 koi koi 3149 Jan 1 1980 python3.10-config
Also the static interpreter wouldn't need the shared libraries, but that is also being packed into zipapp, increase the size by another 45MB:
$ ls -l runfiles/rules_python++python+python_3_10_x86_64-unknown-linux-gnu/lib/
-rwxrwxr-x 1 koi koi 45131088 Jan 1 1980 libpython3.10.so.1.0
-rwxrwxr-x 1 koi koi 16800 Jan 1 1980 libpython3.so
-rwxrwxr-x 1 koi koi 2340016 Jan 1 1980 libtcl9.0.so
-rwxrwxr-x 1 koi koi 3082472 Jan 1 1980 libtcl9tk9.0.so
...
- Dominant language
- Starlark
- Stars
- 690
- Forks
- 722
- Avg merge
- 18h 7m
- Merged PRs (30d)
- 56
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bazel-contrib/rules_python
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bazel-contrib/rules_python#4164 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bazel-contrib/rules_python#3821 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
bazel-contrib/rules_python#4162 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
bazel-contrib/rules_python#4158 ·
-
help wanted
Difficulty 3/5 1-2 days Newbie friendliness 68/100
bazel-contrib/rules_python#4139 · 2 comments ·
All issues in bazel-contrib/rules_python
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 comment ·
-
Builders
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100