allow py_zipapp to not include the python runtime
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- python
- 领域
- build-system
调研方向
从 py_zipapp 的实现开始,检查其 venv 布局和运行时文件 depset。将现有的 bootstrap 逻辑与 runtime_env_toolchain 的行为进行比较,然后确定支持哪个外部运行时选项,并验证生成的 zipapp 无需捆绑运行时文件即可运行。
由索引模型根据 Issue 内容生成。
描述
The gist of the feature request is to allow using py_zipapp to create a zipapp that doesn't include the python runtime. The reason is because the runtime is large, and if you're using e.g. docker to provide the runtime separately, then the bundled runtime is unwanted overhead.
Not including the runtime files is trivial: just don't include those depsets of files when creating the zip.
However, the resulting zip isn't functional. This is because, under the hood, a venv layout is used, which expects bin/python to point to the runtime. But if the runtime is being provided externally, it doesn't have a play to point to.
There's 3 options I can think of:
(1) Use runtime_env_toolchain. It has some hacks/tricks to use a shell script as bin/python, but still act as a venv interpreter. Its fragile though, relying on undocumented python behavior.
(2) Lookup python at runtime and recreate venv at runtime. The logic for this already exists in one of the bootstraps (not sure if its in the zip one, though).
(3a) Write a relative symlink that "escapes" the zip file tree. Then its up to the user to ensure that path exists and points to a usable python.
(3b) Write an absolute symlink, i.e. make use of the "platform interpreter" feature. Then it's up to the user to ensure that path exists and points to a usable python.
- 主要语言
- Starlark
- 星标
- 690
- 派生
- 722
- 平均合并
- 1 天 14 小时
- 30 天内合并 PR
- 42
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bazel-contrib/rules_python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
bazel-contrib/rules_python#4164 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
bazel-contrib/rules_python#3821 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 45/100
bazel-contrib/rules_python#4181 ·
维护者通常 2 天内回复
-
Release 2.4.0未关闭type: release
难度 4/5 3-5 天 新手友好度 25/100
bazel-contrib/rules_python#4175 · 10 条评论 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 70/100
bazel-contrib/rules_python#4171 ·
维护者通常 2 天内回复
查看 bazel-contrib/rules_python 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
yegor256/copyrights-action#216 ·
-
update-request
难度 2/5 1-3 小时 新手友好度 75/100
msys2/MINGW-packages#32008 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
cytomining/copairs#145 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bot-found bug priority: P3
难度 2/5 1-3 小时 新手友好度 84/100
madenvel/KalinkaPlayer#179 ·