Have rules_rust specify the amount of memory required for actions

Đang mở
#4,428 1 bình luận 0 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
63/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
build-system

Hướng nghiên cứu

Read rust/private/rustc_resource_set.bzl and the ctx.actions.run call in rust/private/clippy.bzl around lines 235–246; compare them with rust/private/rustc.bzl around line 2060 and the linked PR #3474. Start by checking how resource estimates are currently supplied for Rust compiler actions. Done means relevant actions specify memory estimates so Bazel can account for their memory use; the issue does not give target values or named tests.

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

Mô tả

awaiting-response core

Is your feature request related to a problem? Please describe.
rust/private/rustc.bzl:2060 passes resource_set = get_rustc_resource_set(toolchain). Every function in rust/private/rustc_resource_set.bzl returns only a CPU count, e.g. return {"cpu": 1}. rust/private/clippy.bzl:235-246, the ctx.actions.run(mnemonic = "Clippy", ...) call, has no resource_set, so Clippy actions get a default of 250 MB.

This means bazel doesn't properly limit resources based on system memory available because it thinks actions use the default of 250 MB. This can cause an overutilization of resources and crash the actions.

Describe the solution you'd like
Specify resource utilization estimates in actions.

Describe alternatives you've considered
Cap system CPU or job parallelization. This artificially restricts other action specifications that prescribe the resource requirements appropriately.

Additional context
It looks like https://github.com/bazelbuild/rules_rust/pull/3474 started this but nothing picked it up.

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.