build: pip installs into venv/ make `make all` rebuild the local wheels

Aperta Adatta ai principianti
#277 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
build-system

Direzione di ricerca

Inizia leggendo le regole del Makefile per i wheels locali e il commento sopra il target packages; riproduci il problema con make -n -W venv/bin update_packages_lock_local. Aggiorna la gestione dei prerequisiti e il commento in base alla correzione proposta nell’issue, poi verifica che l’esecuzione a secco non pianifichi più ricostruzioni non necessarie dei wheels e che il comportamento documentato di make all sia corretto.

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

Descrizione

Problem

The rules that build the local wheels in packages/ list $(PYBIN) (venv/bin, a directory) as a normal prerequisite:

$(PACKAGE_DIR)/$(HTMLTOOLS_WHEEL): $(PYBIN) $(PACKAGE_DIR)/py-htmltools
$(PACKAGE_DIR)/$(SHINY_WHEEL): $(PYBIN) $(PACKAGE_DIR)/py-shiny
$(PACKAGE_DIR)/$(SHINYWIDGETS_WHEEL): $(PYBIN) $(PACKAGE_DIR)/py-shinywidgets
$(PACKAGE_DIR)/$(FAICONS_WHEEL): $(PYBIN) $(PACKAGE_DIR)/py-faicons
$(PACKAGE_DIR)/$(LIBSASS_WHEEL): $(PYBIN)

Any pip install that adds a file to venv/bin changes that folder's timestamp. That includes make test-deps, the first make test-scripts, and pip install -e packages/py-shiny. After that, the next make all deletes every local wheel and rebuilds it from whatever state the submodules are in, and downloads libsass again. An editable install also writes into packages/py-*, which triggers the same rebuild.

So local changes in a submodule can end up in the wheels that ship, without anyone asking for a rebuild.

This happens on main today through retrieve_packages → build/shinylive/pyodide/<wheel> → packages/<wheel>. update_packages_lock_local now also depends on the wheels, which adds a second path to the same rebuild.

The comment above the packages target is also out of date. It says the wheels "must be run manually after updating the package submodules; it will not run automatically with make all". make all does rebuild them.

How to see it

make -n -W venv/bin update_packages_lock_local

This prints rm -f ./packages/htmltools*.whl and pip wheel ... for every local package.

Possible fix

  • Make the venv an order-only prerequisite, so it must exist but its timestamp does not matter. For example: $(PACKAGE_DIR)/$(SHINY_WHEEL): $(PACKAGE_DIR)/py-shiny | $(PYBIN), and $(PACKAGE_DIR)/$(LIBSASS_WHEEL): | $(PYBIN).
  • Decide whether a change to the packages/py-* folders should still trigger a rebuild. A folder's timestamp changes only when entries are added or removed at its top level, so it is a weak signal either way.
  • Rewrite the comment above packages: so it says what make all does.
Lingua principale
TypeScript
Stelle
253
Fork
25
Merge medio
6g 22h
PR unite (30g)
13

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di posit-dev/shinylive

Tutte le issue di posit-dev/shinylive

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.