whl_library: reproducible wheel fetching via ctx.download (hash-pinned) — enable repo_metadata(reproducible=True), Remote Asset API and RRCC eligibility
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- build-system
Línea de trabajo
Start by reading the whl_library repository rule and the pip hub or module extension code that generates wheel repositories; the issue names these entry points but no file paths or tests. Trace how resolved wheel URLs and hashes reach pip subprocesses, then check how downloads through ctx.download affect repository metadata. Done means an opt-in mode fetches pinned wheels through Bazel's downloader and marks the repository reproducible; the issue does not identify specific tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Context
whl_library (and the pip hub repos it generates) fetch wheels by shelling out to pip subprocesses (pip download/pip install --download). This makes repository materialization structurally non-reproducible: the repo rule cannot declare repo_metadata(reproducible=True), and the actual downloads never flow through bazel's downloader (ctx.download).
This has two costly consequences for large repos with many wheels:
- Bazel 9.3's remote repo contents cache (
--experimental_remote_repo_contents_cache, RRCC) cannot serve pip hub repos — it only caches fetches of reproducible repositories. Every clean checkout / cold CI machine re-downloads the entire resolved wheel set from scratch. (For us: ~750 wheels, re-fetched on every cold machine, every day.) - The Remote Asset API downloader (
--remote_downloader/ FetchBlob withchecksum.sriqualifiers) never sees wheel fetches, so they cannot be deduplicated fleet-wide through a Remote Asset service / CAS.
Why this is feasible
The wheel URLs+hashes are already fully resolved and hash-pinned at generation time (lockfile / requirements with --hash= / the module extension's lock file records). A mode that performs the artifact fetch itself via ctx.download(url, sha256=...) would:
- make the repo reproducible (deterministic inputs → deterministic outputs),
- allow
repo_metadata(reproducible=True), - route downloads through bazel's downloader (URL rewriting/proxies,
--remote_downloaderFetchBlob, downloader retries), and - make wheels eligible for the RRCC remote repo contents cache.
Pip subprocesses would then only be needed for the parts that genuinely require pip (sdist builds from source, metadata extraction), or could be kept behind a flag for compatibility.
Evidence / motivation
From a JFrog data-transfer investigation on our monorepo CI (Bazel 9.3, ~750 pinned wheels per materialization):
- wheel fetches that go through the downloader are hash-pinned and could be cache-served; today every cold CI machine refetches them (~1–2 GB/day just of downloader-mode wheels, plus the pip-subprocess part which bypasses any mirror/cache entirely and goes straight to
files.pythonhosted.org— flaky under load, ReadTimeouts). - With
--experimental_remote_downloader, everyctx.downloadin the build becomes a singleFetchBlob(uris, checksum.sri)served from the fleet CAS — except wheels, which stay per-machine. - We verified the wire format end-to-end (bazel
http_header:/http_header_url:qualifiers ↔ bb-remote-asset's http fetcher) — everything is in place except the fetch not originating fromctx.download.
Ask
An opt-in mode for whl_library (or the pip hub/module extension) to fetch pre-resolved, hash-pinned wheels with ctx.download and declare repo_metadata(reproducible=True) — e.g. pip.parse(..., download_mode = "ctx_download") or similar. Happy to contribute/help test if there's interest.
Refs: #2640 (credential helper injection into pip — related plumbing, different problem).
- Lenguaje dominante
- Starlark
- Estrellas
- 688
- Forks
- 728
- Merge medio
- 16 h 50 min
- PR fusionados (30 d)
- 136
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bazel-contrib/rules_python
-
Good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
bazel-contrib/rules_python#4358 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
bazel-contrib/rules_python#4251 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bazel-contrib/rules_python#4164 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
bazel-contrib/rules_python#4311 ·
Los mantenedores suelen responder en 1 día
-
pip.parse ignores uv.lock dependency-edge platform markersPosiblemente ocupada @kdelalic la tomó hace 7 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
bazel-contrib/rules_python#4287 ·
Los mantenedores suelen responder en 1 día
Todos los issues de bazel-contrib/rules_python
Issues similares
-
Update migenAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
YosysHQ/oss-cad-suite-build#220 ·
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
@apps/catalog enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ymm-oss/flutter-mobile-project-template#699 ·
Los mantenedores suelen responder en 15 días
-
area/open-control-plane has parent sig/core
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
openmcp-project/backlog#726 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jupyterhub/repo2docker#1578 ·