bazel-contrib / bazel-contrib/rules_python

Support adding patch_cmds in pip.override

Aperta
#3,512 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Starlark
Stelle
688
Fork
721
Merge medio
15h 7m
PR unite (30g)
76

Descrizione

# 🚀 feature request

### Description

Currently, the following exists for patching targets. However, for certain targets like pytorch, we have custom commands that patch the rpath of shared object libraries in our current workspace. However, this isn't doable with pip.override as we can't quite generate a patch for rpath differences. We can't patch the wheel beforehand because we're using pip torch relies on an rpath that is variable to change depending on the sha256sum of the wheel so we have to patch after the wheel is built as we can't know the sha256sum of the wheel before it's built

```
pip.override(
file = ".whl",
patch_strip = 1,
patches = [
"",
],
)
```

### Describe the solution you'd like

ideally if pip.override has a `patch_cmds` optional argument that would be great
```
pip.override(
file = ".whl",
patch_strip = 1,
patches = [
"",
],
patch_cmds = [
]
)
```

### Describe alternatives you've considered

We've tried patching before the wheel is built, but like the description above says, it's currently a chicken and egg problem

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by locating the pip.override entry point and the existing handling for patches and patch_strip. Trace how the wheel is processed after it is built, then determine where an optional patch_cmds argument would fit. Done means pip.override accepts and runs the commands while preserving existing patch behavior; the issue names no specific files or tests to run.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
build-system
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.