Have rules_rust specify the amount of memory required for actions

オープン
#4,428 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

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.

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

説明

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.

主要言語
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 を短くまとめたダイジェスト。