allow py_zipapp to not include the python runtime
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu từ phần triển khai py_zipapp và kiểm tra bố cục venv cùng các depset của tệp runtime. So sánh logic bootstrap hiện có với hành vi của runtime_env_toolchain, sau đó xác định tùy chọn runtime bên ngoài nào được hỗ trợ và xác minh rằng zipapp tạo ra chạy được mà không có các tệp runtime đi kèm.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Starlark
- Star
- 688
- Fork
- 724
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 48
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bazel-contrib/rules_python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
bazel-contrib/rules_python#4201 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bazel-contrib/rules_python#4164 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
go:embed stdlib_list.txt file in gazelle/python/std_modules.go is missingCó thể đã có người làm @udaya2899 đã nhận 11 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
bazel-contrib/rules_python#3821 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bazel 7 native py_binary: startup and import failures with rules_python 2.4.1Có thể đã có người làm @gleyba đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
bazel-contrib/rules_python#4234 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Release 2.4.2Đang mởtype: release
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 8/100
bazel-contrib/rules_python#4232 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày