MODULE.bazel.lock is diff-unfriendly for large crate universes

Abierto
#3,946 11 comentarios 2 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
rust
Área
build-system

Línea de trabajo

Comienza con MODULE.bazel.lock y el contenido del archivo BUILD que incorpora, después inspecciona la prueba de concepto vinculada lockfile-opt y compara su diff con main. Comprende cómo se representan los tres universos de crates antes de seguir perfeccionando el enfoque. Se considera terminado cuando los cambios en el lockfile para uno o dos crates producen diffs sustancialmente más pequeños y revisables sin romper el comportamiento de bzlmod.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

crate-universe

We recently transitioned to using bzlmod to manage our 3 rather large crate universes. It's working great, and I really like not having to worry about the individual lockfiles.

There's one problem: The MODULE.bazel.lock file has become huge; it takes about 2x the space that the original lockfiles did. But worse, it's very diff-unfriendly. It contains entire BUILD files, and changings one crate will cause the entire master BUILD file to change, resulting in a pages-long inscrutable diff. This makes it challenging to review changes that include crate universe modifications, and often overloads diff viewer tools.

I have put together a proof of concept that reduces the MODULE.bazel.lock size to be comparable to the old lockfiles it replaces, but more importantly, it removes the very long BUILD content lines, so that changes affecting only one or two crates don't change the MODULE.bazel.lock file so dramatically.

Proof of concept is here: https://github.com/bazelbuild/rules_rust/compare/main...jblebrun:rules_rust:lockfile-opt

I'm not ready to make a PR with this, since I got quite a bit of help from AI to generate it, and I want to fully understand what it's doing before expecting others to do the same.

But I figured I'd open this issue, in case anyone else is struggling with the issue as well, is exploring possible resolutions already, or is interested in helping to review and refine my proof-of-concept solution.

Lenguaje dominante
Starlark
Estrellas
857
Forks
701
Merge medio
4 d 7 h
PR fusionados (30 d)
46

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 bazelbuild/rules_rust

Todos los issues de bazelbuild/rules_rust

Issues similares

Más issues de Build System

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.