NixOS / NixOS/nixpkgs

bazel: missing procps causes persistent workers to be repeatedly destroyed

Open Beginner friendly
#565,271 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0.kind: bug
Dominant language
Nix
Stars
26.2k
Forks
20.1k
PR merge metrics
PR metrics pending

Description

Nixpkgs version
  • Unstable (26.11)
Describe the bug

bazel (bazel_9 is what i'm using) uses ps to track memory state of concurrent workers. its not terminal but it massively harms large build performance.

the Bazel package’s runtime tool list omits procps. the corresponding upstream worker-status logic is very clear on why this occurs.

Steps to reproduce
  1. Use bazel_9 in a sandboxed Nix derivation’s nativeBuildInputs, without procps.
  2. Build a target using persistent workers. I encountered this compiling IntelliJ Community.
  3. Inspect Bazel’s java.log: it repeatedly reports Cannot run program "ps", followed by worker destruction with KILLED_UNKNOWN.

i can provide a more precise repro or my original derivation if desired.

Expected behaviour

bazel should be able to manage many workers in its default build environment.

Screenshots

No response

Relevant log output
[com.google.devtools.build.lib.metrics.PsInfoCollector.collectDataFromPs]
Error while executing command ps
java.io.IOException: Cannot run program "ps":
Exec failed, error: 2 (No such file or directory)
Additional context

No response

System metadata
  • NixOS, x86_64-linux, Nix sandbox enabled
  • nixos-unstable, pinned to 83199d0d373dd3ac2b9a1996b1d0263f76ab7a4c
  • bazel_9, version 9.1.1
  • Custom derivation using Bazel in nativeBuildInputs
Notify maintainers

Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs
Is this issue important to you?

Add a 👍 reaction to issues you find important.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkgs/by-name/ba/bazel_9/package.nix and inspect the runtime tool list, then reproduce the sandboxed build using persistent workers. Compare the result with Bazel's WorkerProcessMetricsCollector logic and java.log; done means the sandbox can run ps and workers are no longer repeatedly destroyed with KILLED_UNKNOWN.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.