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

オープン
#3,946 コメント 11 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust
領域
build-system

調査の方向性

MODULE.bazel.lock と、それに埋め込まれている BUILD ファイルの内容から始め、次にリンクされている lockfile-opt の proof of concept を調べ、その diff を main と比較します。アプローチを改良する前に、3 つの crate universe がどのように表現されているかを理解してください。1 つまたは 2 つの crate に対する lockfile の変更によって、bzlmod の動作を壊すことなく、実質的により小さくレビュー可能な diff が生成されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Starlark
スター
857
フォーク
701
平均マージ
4日 7時間
マージ済み PR(30日)
46

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bazelbuild/rules_rust のほかの issue

bazelbuild/rules_rust の issue をすべて見る

似ている issue

Build System の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。