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

Đang mở
#3,946 11 bình luận 2 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với MODULE.bazel.lock và nội dung tệp BUILD mà nó nhúng, sau đó kiểm tra proof of concept lockfile-opt được liên kết và so sánh diff của nó với main. Hiểu cách ba crate universe được biểu diễn trước khi tinh chỉnh phương pháp tiếp cận. Được xem là hoàn tất khi các thay đổi lockfile cho một hoặc hai crate tạo ra các diff nhỏ hơn đáng kể và dễ review mà không làm hỏng hành vi của bzlmod.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Starlark
Star
857
Fork
701
Merge trung bình
4 ngày 7 giờ
Pull request đã merge (30 ngày)
46

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bazelbuild/rules_rust

Tất cả issue của bazelbuild/rules_rust

Issue tương tự

Thêm issue về Build System

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.