Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

whl_library: reproducible wheel fetching via ctx.download (hash-pinned) — enable repo_metadata(reproducible=True), Remote Asset API and RRCC eligibility

Abierto
#4,315 1 comentario 0 reacciones 0 asignados Ver en GitHub

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

Can Close? need: repro

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:

  1. 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.)
  2. The Remote Asset API downloader (--remote_downloader / FetchBlob with checksum.sri qualifiers) 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_downloader FetchBlob, 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, every ctx.download in the build becomes a single FetchBlob(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 from ctx.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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bazel-contrib/rules_python

Todos los issues de bazel-contrib/rules_python

Issues similares

Más issues de Build System

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.