Have rules_rust specify the amount of memory required for actions

Aperta
#4,428 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
63/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
build-system

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Starlark
Stelle
857
Fork
701
Merge medio
4g 7h
PR unite (30g)
46

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bazelbuild/rules_rust

Tutte le issue di bazelbuild/rules_rust

Issue simili

Altre issue su Build System

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.