allow py_zipapp to not include the python runtime
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- build-system
Direzione di ricerca
Parti dall’implementazione di py_zipapp e ispeziona il layout di venv e i depset dei file di runtime. Confronta la logica di bootstrap esistente con il comportamento di runtime_env_toolchain, quindi stabilisci quale opzione di runtime esterno è supportata e verifica che la zipapp risultante venga eseguita senza file di runtime inclusi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Starlark
- Stelle
- 690
- Fork
- 722
- Merge medio
- 1g 55m
- PR unite (30g)
- 38
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bazel-contrib/rules_python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
bazel-contrib/rules_python#4179 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bazel-contrib/rules_python#4164 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bazel-contrib/rules_python#3821 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
bazel-contrib/rules_python#4181 ·
-
Release 2.4.0 Apertatype: release
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
bazel-contrib/rules_python#4175 · 3 commenti ·
Tutte le issue di bazel-contrib/rules_python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bazel-contrib/rules_go#4726 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
HL7/fhir-ig-publisher#1375 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
NousResearch/hermes-agent#122386 · 1 commento ·