Skip to content

Refactor build parallelism computation into a dedicated script #2352

Description

@coderabbitai

Summary

Track a follow-up refactor to move build parallelism computation into a dedicated script instead of routing Taskfile evaluation through components/core/tools/scripts/utils/build-and-run-unit-tests.py.

Rationale

The current implementation works, but the parallelism calculation logic is being reused outside the unit-test utility. Keeping that computation in a dedicated script should make the ownership clearer, reduce coupling between unrelated build paths, and make future updates easier.

Affected areas

  • taskfile.yaml
  • components/core/tools/scripts/utils/build-and-run-unit-tests.py
  • Any shared build helper introduced for computing max parallel jobs

Proposed changes

  • Extract the max-parallelism calculation into a dedicated script with a narrow, reusable interface.
  • Update Taskfile and other build entry points to call the dedicated script instead of the unit-test utility.
  • Keep the precedence rules and behaviour unchanged unless a deliberate follow-up change is proposed.

Acceptance criteria

  • A dedicated script is the single source of truth for computing C++ build parallelism.
  • taskfile.yaml no longer depends on build-and-run-unit-tests.py for G_CPP_MAX_PARALLELISM_PER_BUILD_TASK.
  • Existing override behaviour for CLP_CPP_MAX_PARALLELISM_PER_BUILD_TASK is preserved.
  • Existing memory-aware parallelism behaviour remains covered by validation or tests.

Backlinks

Requested by @jackluo923.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions